Saturday, November 23, 2013

Motionbuilder modding

Color Themes


The fact that motionbuilders UI is built with Qt opens up a lot of possibilites for us to change it.
It allows us pretty much to rewrite the entire UI.

In this case I used a stylesheet created by Yasin Uludag, you can find it right here in this thread.
Thanks for sharing this Yasin!

Save the .stylesheet file in a folder of your choice and make sure you link to this location in Line 2. You will have the theme applied on your next motionbuilder startup.


UI Customization


You can add any custom widget right into to the standard motionbuilder UI, manipulate existing ones and what not.

Its a little hard to find out where the standard widgets are but with a bit of trial and error you can find your way around! The code for it is really ugly, but trust me, it works ;)

Here is a small example where I just hide the standard Go To Stance Pose button in the Character controls and add a simple QPushButton right on top of it.

The theming is cool, but for some reason it doesnt apply it to all the UI elements and unfortunately I don't really have much time to dig into this any further at the moment.

Maybe someone else does, I would love to see this brought to the next level with full theming :)

Thats all for now, thanks for listening!

2 comments:

  1. Fun stuff! About the stylesheet - you need to specify each UI element used in the widget that you utilize the stylesheet for. Most likely, whatever the element you noticed to be missing the theme, most likely it is missing from the stylesheet definitions, or, perhaps, you might be missing some reference.
    Another cool thing with themes you can do, is actually specify themes directly within your python code. I.e. you want to stylize certain QPushButtons in your UI with specific look. You can try this:

    LAYOUT_STYLE = '''
    QPushButton {
    background-color: #2B2B2B;
    border-width: 2px;
    border-color: #707070;
    border-style: solid;
    border-radius: 8;
    padding: 2px;
    padding-left: 2px;
    padding-right: 2px;
    min-width: 20 px;
    max-width: 20 px;
    min-height: 20 px;
    max-height: 20 px;
    }

    QPushButton:hover {
    border-width: 2px;
    border-color: BAE0E6;
    }
    QPushButton:pressed {
    background-color: #747C7D;
    }
    QPushButton:checked {
    background-color: #ADADAD;
    }
    '''

    myButton = QtGui.QPushButton('Test')
    myButton.setStyleSheet(LAYOUT_STYLE)

    ReplyDelete
    Replies
    1. I think that autodesk is probably embedding their own UI into the QLayouts... From what I can tell the only thing thats purely Qt is the Character Controls window and a few other things like QListWidgetItems in the Scene Navigator...oh well :D

      Delete