n-gist

Some of my affairs


Driven Keys from Maya to MotionBuilder

Driven Keys from Maya to MotionBuilder

Driven Keys is a nice thing that does not work when we transfer scene from MAYA to MotionBuilder. There are solutions on the Internet, but most of them just explain how to build Relation Constraint in MotionBuilder between driver and driven objects manually. That is impossible with a large number of objects, or when changing/tuning connections, in terms of time costs.

Solution is two python scripts. One is for export data from MAYA, second is for import to MotionBuilder.

Export

Driven Keys - Export

On pressing ‘Construct’ button, Driven Keys data is collected, serialized and saved in ExtraAttributes fields of the created objects acting as data containers. After this, the scene can be sent to MotionBuilder. Data is collected for selected driven objects or for entire scene, if nothing selected. MAYA can stuck hard if you select these objects while AttributeEditor is opened, especially if ExtraAttributes category exposed, thats why data splits to smaller chunks, but it is recommended to keep AttributeEditor closed. ‘Delete’ button deletes these objects, and other four is just shortcuts for SDK window, selecting all objects in scene and sending them to MotionBuilder.

Import

Driven Keys - Import

Once all objects are transferred to MotionBuilder, connections network can be constructed using ‘Update’ button, which will create Relation Constraints for each driven object attribute. It is possible to activate, deactivate and delete these constraints with the corresponding buttons.

Supports:

Does not supports:

Worth to note. There is no way to drive attribute on one axis, leaving it free on other axes. In order to be able to control attributes on other axes, they need to be constrained too, otherwise attributes on not constrained axes will be frozen at current values.

DrivenKeys_MAYAtoMOBU.zip