Devices > 
Model templates
 
 
 

Model templates (FBModelTemplate) are bound to the animation nodes (FBAnimationNode) of models (FBModel).

A model template can be bound to markers or to skeleton nodes depending on the arguments passed to the FBModelTemplate:: FBModelTemplate() constructor. The animation nodes which are bound to the model template are created by the plugin device using a call to AnimationNodeOutCreate().

The model templates have to be arranged in a hierarchy that corresponds to the skeleton node hierachy of the physical device. The hierarchy of model template is created by calling FBProperlyListModelTemplate::Add() on the FBModelTemplate::Children property. A root model template is created by passing kFBModelTemplateRoot to the constructor. The root must then added to the device model template, for example: ModelTemplate.Children.Add(mRootTemplate);.

Once the hierarchy is created, the model templates are bound to specific animation nodes by calling FBPropertyListModelTemplateBinding::Add() on the FBModelTemplate::Bindings property. A model template would typically have bindings to two animation node, one for translation and one for rotation. When model templates are no longer used the bindings should be removed using FBPropertyListModelTemplateBinding::Remove().

A model template is an empty placeholder for input/output information to animate a model. When the placeholder is set, the data is then applied to its child model (if the child exists). This creates a link between the for example a mocap device and the bones or markers of a 3D model in a MotionBuilder scene.

Model binding means binding templates to models and is used to get the same device to animate different sets of models in a single scene.

This is similar to the analogy of the input for characters in the Character tool. When creating a device, instead of creating specific models within the creation routines, you should create objects of the class FBModelTemplate. If it has no children, it is impossible to create a model binding for the device. For an example project, see ordevice_template.

When model templates exist for a device, you are able to select the model binding (the set of models to be driven by the device input) from the Model Binding list under the Device controls (Online, Live & Recording).

Best practice is to add a prefix to the root of your model template hierarchy (as in the examples) to differentiate models that belong to your root model from other models already in the scene.

A device plug-in could create model templates in its override of FBDevice:: FBCreate() or in response to the FBDevice::DeviceOperation() call with the kOpStart flag.

ModelTemplateBindNotify and ModelTemplateUnBindNotify are callbacks that send notification of a change in the binding status of a model.