In the MotionBuilder UI, a model can be any object in a scene, created using geometry. Models can represent simple objects like cubes, or complex objects like characters.FBModel is a base class which is not used so much directly, but is the parent of well-used classes like FBCamera, FBLight, and FBModelMarker.It also implements a number of widely-implemented functions and attributes, such as: Clone(), FBDelete() UI attributes such as Show, Pickable, and Visibility Positional atributes such as Rotation, Scaling, and Translation The following Python snippet shows how to create, show, rotate, and delete a cube
from pyfbsdk import * myCube = FBModelCube("cube") myCube.Show = True myCube.Rotation = FBVector3d(45, 45, 45) myCube.FBDelete()
There is a few ways to get a handle on existing models in a scene: FBFindObjectsByName and FBFindObjectsByNamespace return a list of objects matching a pattern (can contain *). For usage, see: FindObjectsWithWildcard.py If you know the name of the model, use FBFindModelByName, as demonstrated in FBComponent.py. FBGetSelectedModels can get a handle to an object which is derived from FBModel. It searches the scene for a model, based on the model's unique name and returns a list of all the selected things in the scene. FBSelectObjectsByNamespace selects (or deselects) objects in the current scene.
See sample: ResetLocalTranslationRotation.py.
Public Member Functions |
|
FBModel (str pName) | |
Constructor. |
|
FBModel | Clone () |
Clone the model. |
|
FBDelete () | |
Open Reality deletion function. |
|
str | FbxGetObjectSubType () |
Returns the class sub type inherited by the
class of an object, for example: 'Default',
'Mesh'. |
|
str | FbxGetObjectType () |
Returns the class type inherited by the
class of an object, for example: 'Model'.
|
|
GetBoundingBox (FBVector3d pMin, FBVector3d pMax) | |
Get the bounding box of the model. |
|
GetMatrix (FBMatrix pMatrix, int pWhat=kModelTransformation, bool pGlobalInfo=True, FBEvaluateInfo pEvaluateInfo=None) | |
Get a matrix from the model. |
|
int | GetSelectedPointsCount () |
Get the number of selected points in the
model. |
|
GetVector (FBVector3d pVector, int pWhat=kModelTranslation, bool pGlobalInfo=True, FBEvaluateInfo pEvaluateInfo=None) | |
Get a vector from the model. |
|
SetMatrix (FBMatrix pMatrix, int pWhat=kModelTransformation, bool pGlobalInfo=True, bool pPushUndo=False, FBEvaluateInfo pEvaluateInfo=None) | |
Set a matrix for the model. |
|
SetVector (FBVector3d pVector, int pWhat=kModelTranslation, bool pGlobalInfo=True, bool pPushUndo=False, FBEvaluateInfo pEvaluateInfo=None) | |
Set a vector for the model. |
|
SetupPropertiesForShapes () | |
Setup Shape Properties. |
|
Public Attributes |
|
FBAnimationNode | AnimationNode |
Read Only Property: Animation node of
the model. |
|
FBListModel | Children |
List: Children for model. |
|
FBVector3d | GeometricRotation |
Read Write Property: Geometric
rotation. |
|
FBVector3d | GeometricScaling |
Read Write Property: Geometric
scaling. |
|
FBVector3d | GeometricTranslation |
Read Write Property: Geometric
translation. |
|
FBGeometry | Geometry |
Read Write Property: Geometry for the
model. |
|
bool | Icon3D |
Read Write Property: Is model a 3D
icon? |
|
bool | IsConstrained |
Read Only Property: Is model
constrained? |
|
bool | IsDeformable |
Read Write Property: Is model
deformable (weights)? |
|
FBModel | LookAt |
Read Write Property: Look at model
(interest point). |
|
FBListMaterial | Materials |
List: Materials for model. |
|
FBModel | Parent |
Read Write Property: Parent model.
|
|
bool | Pickable |
Read Write Property: Indicate if a
model can be picked in the viewer. This has a default value of
'true'. |
|
FBVector3d | PostRotation |
Read Write Property: Post Rotation
(considered if RotationActive is true) |
|
FBVector3d | PreRotation |
Read Write Property: Pre Rotation
(considered if RotationActive is true) |
|
bool | QuaternionInterpolate |
Read Write Property: Use quaternion
interpolation. |
|
FBAnimatableVector3d | Rotation |
Read Write Property: Lcl rotation.
|
|
bool | RotationActive |
Read Write Property: Is model using
Rotation Limits? |
|
FBVector3d | RotationMax |
Read Write Property: Max Rotation
Limit (considered if RotationActive is true) |
|
bool | RotationMaxX |
Read Write Property: Is model using
Maximum Rotation Limits On X? |
|
bool | RotationMaxY |
Read Write Property: Is model using
Maximum Rotation Limits On Y? |
|
bool | RotationMaxZ |
Read Write Property: Is model using
Maximum Rotation Limits On Z? |
|
FBVector3d | RotationMin |
Read Write Property: Min Rotation
Limit (considered if RotationActive is true) |
|
bool | RotationMinX |
Read Write Property: Is model using
Minimum Rotation Limits On X? |
|
bool | RotationMinY |
Read Write Property: Is model using
Minimum Rotation Limits On Y? |
|
bool | RotationMinZ |
Read Write Property: Is model using
Minimum Rotation Limits On Z? |
|
FBModelRotationOrder | RotationOrder |
Read Write Property: Rotation order.
|
|
bool | RotationSpaceForLimitOnly |
Read Write Property: Apply Post
Rotation Matrix only for Limits? |
|
FBAnimatableVector3d | Scaling |
Read Write Property: Lcl scaling.
|
|
FBScene | Scene |
Read Only Property: Scene containing
the model. |
|
FBListShader | Shaders |
List: Shaders for model. |
|
FBModelShadingMode | ShadingMode |
Read Write Property: Shading mode for
the model. |
|
bool | Show |
Read Write Property: Indicate if the
viewer should show the object, according to its
visibility value. This has a default value of 'false'. |
|
bool | SoftSelected |
Read Write Property: Is model Soft
selected? |
|
FBListTexture | Textures |
List: Textures with Special UseType
(Other than "Color" which should connect to materials). |
|
FBAnimatableVector3d | Translation |
Read Write Property: Lcl translation.
|
|
FBModel | UpVector |
Read Write Property: UpVector model.
|
|
FBAnimatableDouble | Visibility |
Read Write Property: Visibility of
model. This can be overriden by the 'Show' property. |
FBModel Clone | ( | ) |
Clone the model.
This will duplicate the current model.
FBDelete | ( | ) |
str FbxGetObjectSubType | ( | ) |
Returns the class sub type inherited by the class of an object, for example: 'Default', 'Mesh'.
str FbxGetObjectType | ( | ) |
Returns the class type inherited by the class of an object, for example: 'Model'.
GetBoundingBox | ( | FBVector3d | pMin, | |
FBVector3d | pMax | |||
) |
Get the bounding box of the model.
pMin | Minimum value of the bounding box. | |
pMax | Maximum value of the bounding box. |
GetMatrix | ( | FBMatrix | pMatrix, | |
int | pWhat =
kModelTransformation , |
|||
bool | pGlobalInfo =
True , |
|||
FBEvaluateInfo | pEvaluateInfo =
None |
|||
) |
Get a matrix from the model.
pMatrix | Matrix to fill with requested information. | |
pWhat | Type of information requested (default=transformation). | |
pGlobalInfo | true if it is GlobalInfo, false if Local (default=true). | |
pEvaluateInfo | EvaluateInfo, Take Display if none specified. |
int GetSelectedPointsCount | ( | ) |
Get the number of selected points in the model.
GetVector | ( | FBVector3d | pVector, | |
int | pWhat =
kModelTranslation , |
|||
bool | pGlobalInfo =
True , |
|||
FBEvaluateInfo | pEvaluateInfo =
None |
|||
) |
Get a vector from the model.
pVector | Vector to fill with requested values. | |
pWhat | Type of information requested (default=translation, inverses not supported). | |
pGlobalInfo | true if it is GlobalInfo, false if Local (default=true). | |
pEvaluateInfo | EvaluateInfo, Take Display if none specified |
SetMatrix | ( | FBMatrix | pMatrix, | |
int | pWhat =
kModelTransformation , |
|||
bool | pGlobalInfo =
True , |
|||
bool | pPushUndo = False , |
|||
FBEvaluateInfo | pEvaluateInfo =
None |
|||
) |
Set a matrix for the model.
pMatrix | Information to use to set the model's matrix. | |
pWhat | Type of matrix to set (default=transformation). | |
pGlobalInfo | true if it is GlobalInfo, false if Local (default=true). | |
pPushUndo | true if this operation is undoable, don't push undo in non UI thread. | |
pEvaluateInfo | EvaluateInfo, Take Display if none specified |
SetVector | ( | FBVector3d | pVector, | |
int | pWhat =
kModelTranslation , |
|||
bool | pGlobalInfo =
True , |
|||
bool | pPushUndo = False , |
|||
FBEvaluateInfo | pEvaluateInfo =
None |
|||
) |
Set a vector for the model.
pVector | Vector to use to set values. | |
pWhat | Type of information to set (default=translation, inverses not supported). | |
pGlobalInfo | true if it is GlobalInfo, false if Local (default=true). | |
pPushUndo | true if this operation is undoable, don't push undo in non UI thread. | |
pEvaluateInfo | EvaluateInfo, Take Display if none specified |
SetupPropertiesForShapes | ( | ) |
Setup Shape Properties.
Normally this function is called automatically at the next global synchronization point after the geometry has been updated. However you must call it explicitly to access the shape properties immediately after shapes adding/removing before next global synchronization point.
Read Only Property: Animation node of the model.
FBListModel Children |
List: Children for model.
Read Write Property: Geometric rotation.
Read Write Property: Geometric scaling.
Read Write Property: Geometric translation.
Read Write Property: Geometry for the model.
Read Only Property: Is model constrained?
Read Write Property: Is model deformable (weights)?
FBListMaterial Materials |
List: Materials for model.
Read Write Property: Indicate if a model can be picked in the viewer. This has a default value of 'true'.
Read Write Property: Post Rotation (considered if RotationActive is true)
Read Write Property: Pre Rotation (considered if RotationActive is true)
Read Write Property: Use quaternion interpolation.
FBAnimatableVector3d Rotation |
Read Write Property: Lcl rotation.
Read Write Property: Is model using Rotation Limits?
Read Write Property: Max Rotation Limit (considered if RotationActive is true)
Read Write Property: Is model using Maximum Rotation Limits On X?
Read Write Property: Is model using Maximum Rotation Limits On Y?
Read Write Property: Is model using Maximum Rotation Limits On Z?
Read Write Property: Min Rotation Limit (considered if RotationActive is true)
Read Write Property: Is model using Minimum Rotation Limits On X?
Read Write Property: Is model using Minimum Rotation Limits On Y?
Read Write Property: Is model using Minimum Rotation Limits On Z?
Read Write Property: Rotation order.
Read Write Property: Apply Post Rotation Matrix only for Limits?
FBAnimatableVector3d Scaling |
Read Write Property: Lcl scaling.
FBListShader Shaders |
List: Shaders for model.
Read Write Property: Shading mode for the model.
Read Write Property: Indicate if the viewer should show the object, according to its visibility value. This has a default value of 'false'.
Read Write Property: Is model Soft selected?
FBListTexture Textures |
List: Textures with Special UseType (Other than "Color" which should connect to materials).
FBAnimatableVector3d Translation |
Read Write Property: Lcl translation.
FBAnimatableDouble Visibility |
Read Write Property: Visibility of model. This can be overriden by the 'Show' property.