Motion Builder Scripting?

Hi Guys,

I’m a Maya PyMel type of person and I just started looking at Jason Parks Python scripting in Motion Builder training kit.

I was just wondered what people think of Python scripting in MB? My initial though is that it looks much harder than it could be. Like you might quickly want to write you own command language on top :slight_smile: Also is learning ORC necessary for doing Motion Builder interfaces these days, or can you now do more with Python? If not how well does something like QT and Motion Builder play together?

Thanks,
Sune

i recently have been learning python in mobu and there are some other posters here who know a lot about it.

they seem to have made a lot of changes to python since jason parks’ masterclass in 7.5. a lot more functionality is exposed in 2009+ so it is much easier to do some things.

as far as difficulty goes, it depends. in my limited experience, i’ve found that if you’re creating things (constraints, objects, characters, whatever) then it is really pretty easy to operate on the objects because all of the constructors return objects that you can work with. finding handles for objects that already exist makes things a fair bit more difficult, and the docs haven’t gotten any easier to work with.

ui stuff is easier in the new versions, and there is a visual ui layout plugin that i use to block out ui’s. you can find it here: http://neill3d.com/tool-programming-in-mobu/ui-builder

it’s good but a little buggy and it’s missing some of the new ui features like HBoxLayout and VBoxLayout which allow you to put multiple controls in a single region. i do find it very useful to prototype the ui and then export to .py so i can modify easily after that.

A big problem I’ve found working with is that you really don’t want to do stuff that depends on Motionbuilder to update something(sort of:P), let me give you an example:

I was creating a tool that was suppose to find frames were a character had no animation applied to it.

I tried using the FBPlayerControl to change frames and getting translation and rotation data on the different frames, but you cant depend on MoBu really changing frame when you ask it to, which is a problem.

The workaround in the end was to get the fcurves and evaluate them at frames.

so aslong as you’re not depened on asking mobu to change something and then ask for the result, you’re fine to go.