A character is considered to be characterized when the bone (FBModelSkeleton
) and model root (FBModelRoot
) instances are assigned to their slots. Following are the required slots: HipsLink
, LeftUpLegLink
, LeftLegLink
, LeftFootLink
, RightUpLegLink
, RightLegLink
, RightFootLink
, SpineLink
, LeftArmLink
, LeftForeArmLink
, LeftHandLink
, RightArmLink
, RightForeArmLink
, RightHandLink
, and HeadLink
.
Before you characterize a model, it must be in a T-stance or rest pose facing the positive Z-axis. For biped models, the rest pose is a stance with all the fingers and thumbs in a straight position. For quadrupeds, it is a stance where the four limbs and all the toes point towards the floor. Stance is important because when you characterize a model, the current stance of the model is used as the starting pose. All future movements are based on the starting pose.
To follow the instructions in this section, download the files and scripts from http://area.autodesk.com/downloads/scripts/motionbuilder-animation-scripts.
Open the GremlinGreen_NoCharacterization.fbx file in MotionBuilder and run the character_characterization.py script to see a full workflow for characterization.
Following are the points to keep in mind:
The model instances must be assigned to their slots before characterization. The following code is used for linking the models to their slots.
property = characterObject.PropertyList.Find(slot + "Link")
property.append (myJoint)
After the models link to their slots, you can turn on characterization using lCharacter.SetCharacterizeOn(True)
.
Base slots are mandatory for characterization.
Open the GremlinGreen_AfterCharacterization_MergeMia.fbx file and run the character_create_input.py script to set the character input of grem to mia. Setting the character input drives the grem character using the animation in mia as shown in the following figure.
Following are the points to keep in mind:
Character.ActiveInput
must be True to drive a character using the control rig or marker set.FBSystem().Scene.Characters
returns a list of characters in a scene.lCharacter.InputCharacter = lScene.Characters[0]
sets the input to another character in a scene. If the input character has animation, it is used for driving the animation.Additionally, you can run the commented code in the character_create_input.py
script to introduce other inputs like the control rig and marker set. lCharacter.CreateControlRig(True)
creates the control rig for the character (True
or False
specifies whether to create a IK/FK or IK only control rig). The control rig is shown in the following figure.
You can refer to the MotionBuilder online help for more information about the character input types.