This reference page is linked to from the following overview topics: Your First Python Program, Naming Conventions, Data types & properties, FBComponent - The Base Entity Class, FBProperty - Object Properties, FBPlug - Object Connection Management, Scene Elements, FBModel - Transformation Data and the Scene Graph, FBLight - Lights, FBCamera - Cameras, FBGeometry - Meshes and Surfaces, FBCharacter - Characters, Animation, Model templates.
Model class.
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:
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:
#include <fbmodel.h>
Public Member Functions |
|
FBModel (char *pName, HIObject pObject=NULL) | |
Constructor. |
|
virtual void | FBDelete () |
Open Reality deletion function. |
|
IQuery_Declare (Implementation) | |
ICallback_Declare (Implementation) | |
virtual HFBModel | Clone () |
Clone the model. |
|
void | SetMatrix (FBMatrix pMatrix, int pWhat=kModelTransformation, bool pGlobalInfo=true, bool pPushUndo=false, HFBEvaluateInfo pEvaluateInfo=NULL) |
Set a matrix for the model. |
|
void | GetMatrix (FBMatrix &pMatrix, int pWhat=kModelTransformation, bool pGlobalInfo=true, HFBEvaluateInfo pEvaluateInfo=NULL) |
Get a matrix from the model. |
|
void | SetVector (FBVector3d pVector, int pWhat=kModelTranslation, bool pGlobalInfo=true, bool pPushUndo=false, HFBEvaluateInfo pEvaluateInfo=NULL) |
Set a vector for the model. |
|
void | GetVector (FBVector3d &pVector, int pWhat=kModelTranslation, bool pGlobalInfo=true, HFBEvaluateInfo pEvaluateInfo=NULL) |
Get a vector from the model. |
|
void | SetSchematicPosition (int pX, int pY) |
Set the position in the schematic view for
the model. |
|
void | SetSchematicPosition (FBVector2d pVector2d) |
Set the position in the schematic view for
the model. |
|
FBVector2d | GetSchematicPosition () |
Get the position in the schematic view for
the model. |
|
void | GetBoundingBox (FBVector3d &pMin, FBVector3d &pMax) |
Get the bounding box of the model. |
|
int | NoFrustumCullingRequire () |
Acquire no frustum culling request. |
|
int | NoFrustumCullingRelease () |
Release no frustum culling request. |
|
bool | UseFrustumCulling () |
Get the current Frustum Culling Status.
|
|
virtual bool | HasCustomDisplay () |
Function to overload to handle custom
display. |
|
virtual void | CustomModelDisplay (FBCamera *pCamera, FBModelShadingMode pShadingMode, FBModelRenderPass pRenderPass, float pPickingAreaWidth, float pPickingAreaHeight) |
Custom display function called when
HasCustomDisplay returns true;. |
|
virtual bool | CustomModelPicking (int pNbHits, unsigned int *pSelectBuffer, FBCamera *pCamera, int pMouseX, int pMouseY, FBTVector *pLocalRaySrc, FBTVector *pLocalRayDir, FBTVector *pWorldRaySrc, FBTVector *pWorldRayDir, FBMatrix *pGlobalInverseMatrix, FBTVector *pOutPickedPoint) |
Custom picking for selection. |
|
unsigned char * | GetSelectedPoints () |
Get the list of the points selection state.
|
|
int | GetSelectedPointsCount () |
Get the number of selected points in the
model. |
|
virtual bool | FbxStore (HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat) |
Store and Retrieve function that can be
overloaded. |
|
virtual bool | FbxRetrieve (HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat) |
void | SetupPropertiesForShapes () |
Setup Shape Properties. |
|
virtual char * | FbxGetObjectType () |
Returns the class type inherited by the
class of an object, for example: 'Model'. |
|
virtual char * | FbxGetObjectSubType () |
Returns the class sub type inherited by the
class of an object, for example: 'Default', 'Mesh'. |
|
Public Attributes |
|
FBPropertyListModel | Children |
List: Children for model. |
|
FBPropertyListShader | Shaders |
List: Shaders for model. |
|
FBPropertyListMaterial | Materials |
List: Materials for model. |
|
FBPropertyListTexture | Textures |
List: Textures with Special UseType
(Other than "Color" which should connect to materials). |
|
FBPropertyListDeformer | Deformers |
List: Deformers (Skeleton Deformer or
Point Cache Deformer). |
|
FBPropertyBool | Icon3D |
Read Write Property: Is model a 3D
icon? |
|
FBPropertyBool | SoftSelected |
Read Write Property: Is model Soft
selected? |
|
FBPropertyBool | IsDeformable |
Read Only Property: Is model
deformable? |
|
FBPropertyBool | IsConstrained |
Read Only Property: Is model
constrained? |
|
FBPropertyBool | SkeletonDeformable |
Read Write Property: Model skeleton
deformable. |
|
FBPropertyBool | BlendShapeDeformable |
Read Write Property: Model blendshape
deformable. |
|
FBPropertyBool | ConstrainDeformable |
Read Write Property: Model constraint
deformable. |
|
FBPropertyBool | PointCacheDeformable |
Read Write Property: Model point
cache deformable. |
|
FBPropertyBool | PointCacheRecord |
Read Write Property: Record Point
Cache for model? Not Savable |
|
FBPropertyModel | Parent |
Read Write Property: Parent model.
|
|
FBPropertyModel | LookAt |
Read Write Property: Look at model
(interest point). |
|
FBPropertyModel | UpVector |
Read Write Property: UpVector model.
|
|
FBPropertyGeometry | Geometry |
Read Write Property: Geometry for the
model. |
|
FBPropertyMesh | TessellatedMesh |
Read Only Property: Tessellated Mesh
for the model. |
|
FBPropertyModelVertexData | ModelVertexData |
Read Only Property: ModelVertexData
for the model. |
|
FBPropertyCluster | Cluster |
Read Only Property: Link Cluster for
the model. |
|
FBPropertyScene | Scene |
Read Only Property: Scene containing
the model. |
|
FBPropertyModelShadingMode | ShadingMode |
Read Write Property: Shading mode for
the model. |
|
FBPropertyAnimationNode | AnimationNode |
Read Only Property: Animation node of
the model. |
|
FBPropertyModelRotationOrder | RotationOrder |
Read Write Property: Rotation order.
|
|
FBPropertyBool | RotationSpaceForLimitOnly |
Read Write Property: Apply Post
Rotation Matrix only for Limits? |
|
FBPropertyBool | RotationActive |
Read Write Property: Is model using
Rotation Limits? |
|
FBPropertyVector3d | PreRotation |
Read Write Property: Pre Rotation
(considered if RotationActive is true) |
|
FBPropertyVector3d | PostRotation |
Read Write Property: Post Rotation
(considered if RotationActive is true) |
|
FBPropertyVector3d | RotationMin |
Read Write Property: Min Rotation
Limit (considered if RotationActive is true) |
|
FBPropertyVector3d | RotationMax |
Read Write Property: Max Rotation
Limit (considered if RotationActive is true) |
|
FBPropertyBool | RotationMinX |
Read Write Property: Is model using
Minimum Rotation Limits On X? |
|
FBPropertyBool | RotationMinY |
Read Write Property: Is model using
Minimum Rotation Limits On Y? |
|
FBPropertyBool | RotationMinZ |
Read Write Property: Is model using
Minimum Rotation Limits On Z? |
|
FBPropertyBool | RotationMaxX |
Read Write Property: Is model using
Maximum Rotation Limits On X? |
|
FBPropertyBool | RotationMaxY |
Read Write Property: Is model using
Maximum Rotation Limits On Y? |
|
FBPropertyBool | RotationMaxZ |
Read Write Property: Is model using
Maximum Rotation Limits On Z? |
|
FBPropertyAnimatableBool | Visibility |
Read Write Property: Visibility of
model. |
|
FBPropertyBool | VisibilityInheritance |
Read Write Property: //!< When
this value is set to True the Visibility of this model
is also applied to all its descendants |
|
FBPropertyAnimatableVector3d | Translation |
Read Write Property: Lcl translation.
|
|
FBPropertyAnimatableVector3d | Rotation |
Read Write Property: Lcl rotation.
|
|
FBPropertyAnimatableVector3d | Scaling |
Read Write Property: Lcl scaling.
|
|
FBPropertyVector3d | GeometricTranslation |
Read Write Property: Geometric
translation. |
|
FBPropertyVector3d | GeometricRotation |
Read Write Property: Geometric
rotation. |
|
FBPropertyVector3d | GeometricScaling |
Read Write Property: Geometric
scaling. |
|
FBPropertyBool | QuaternionInterpolate |
Read Write Property: Use quaternion
interpolation. |
|
FBPropertyBool | Show |
Read Write Property: Indicate if the
viewer should show the object, according to its visibility value.
|
|
FBPropertyBool | Pickable |
Read Write Property: Indicate if a
model can be picked in the viewer. |
FBModel | ( | char * | pName, |
HIObject | pObject =
NULL |
||
) |
Constructor.
pName | Name of model. |
pObject | For internal use only(default=NULL). |
virtual void FBDelete | ( | ) | [virtual] |
IQuery_Declare | ( | Implementation | ) |
ICallback_Declare | ( | Implementation | ) |
Reimplemented from FBComponent.
virtual HFBModel Clone | ( | ) | [virtual] |
Clone the model.
This will duplicate the current model.
void SetMatrix | ( | FBMatrix | pMatrix, |
int | pWhat =
kModelTransformation , |
||
bool | pGlobalInfo =
true , |
||
bool | pPushUndo = false , |
||
HFBEvaluateInfo | pEvaluateInfo =
NULL |
||
) |
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 |
void GetMatrix | ( | FBMatrix & | pMatrix, |
int | pWhat =
kModelTransformation , |
||
bool | pGlobalInfo =
true , |
||
HFBEvaluateInfo | pEvaluateInfo =
NULL |
||
) |
Get a matrix from the model.
pWhat | Type of information requested (default=transformation). |
pGlobalInfo | true if it is GlobalInfo, false if Local (default=true). |
pMatrix | Matrix to fill with requested information. |
pEvaluateInfo | EvaluateInfo, Take Display if none specified. |
void SetVector | ( | FBVector3d | pVector, |
int | pWhat =
kModelTranslation , |
||
bool | pGlobalInfo =
true , |
||
bool | pPushUndo = false , |
||
HFBEvaluateInfo | pEvaluateInfo =
NULL |
||
) |
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 |
void GetVector | ( | FBVector3d & | pVector, |
int | pWhat =
kModelTranslation , |
||
bool | pGlobalInfo =
true , |
||
HFBEvaluateInfo | pEvaluateInfo =
NULL |
||
) |
Get a vector from the model.
pWhat | Type of information requested (default=translation, inverses not supported). |
pGlobalInfo | true if it is GlobalInfo, false if Local (default=true). |
pVector | Vector to fill with requested values. |
pEvaluateInfo | EvaluateInfo, Take Display if none specified |
void SetSchematicPosition | ( | int | pX, |
int | pY | ||
) |
Set the position in the schematic view for the model.
pX | X position to set. |
pY | Y position to set. |
void SetSchematicPosition | ( | FBVector2d | pVector2d | ) |
Set the position in the schematic view for the model.
pVector2d | Position to set. |
FBVector2d GetSchematicPosition | ( | ) |
Get the position in the schematic view for the model.
void 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. |
int NoFrustumCullingRequire | ( | ) |
Acquire no frustum culling request.
int NoFrustumCullingRelease | ( | ) |
Release no frustum culling request.
bool UseFrustumCulling | ( | ) |
Get the current Frustum Culling Status.
virtual bool HasCustomDisplay | ( | ) | [inline, virtual] |
virtual void CustomModelDisplay | ( | FBCamera * | pCamera, |
FBModelShadingMode | pShadingMode, | ||
FBModelRenderPass | pRenderPass, | ||
float | pPickingAreaWidth, | ||
float | pPickingAreaHeight | ||
) | [inline, virtual] |
Custom display function called when HasCustomDisplay returns true;.
pCamera | Current camera for display. |
pShadingMode | Shading mode to render see FBModelShadingMode. |
pRenderPass | Actual rendering pass, see FBModelRenderPass. |
pPickingAreaWidth | Width of picking area. |
pPickingAreaHeight | Height of picking area. |
Definition at line 468 of file fbmodel.h.
{}
virtual bool CustomModelPicking | ( | int | pNbHits, |
unsigned int * | pSelectBuffer, | ||
FBCamera * | pCamera, | ||
int | pMouseX, | ||
int | pMouseY, | ||
FBTVector * | pLocalRaySrc, | ||
FBTVector * | pLocalRayDir, | ||
FBTVector * | pWorldRaySrc, | ||
FBTVector * | pWorldRayDir, | ||
FBMatrix * | pGlobalInverseMatrix, | ||
FBTVector * | pOutPickedPoint | ||
) | [inline, virtual] |
Custom picking for selection.
pNbHits | Number of hits. |
pSelectBuffer | OpenGL hit buffer. |
pCamera | Current camera for rendering. |
pMouseX | Mouse X position. |
pMouseY | Mouse Y position. |
pLocalRaySrc | Local picking ray source. |
pLocalRayDir | Local picking ray direction. |
pWorldRaySrc | World coordinate picking ray source. |
pWorldRayDir | World coordinate picking ray direction. |
pGlobalInverseMatrix | Inverse transformation matrix of the model. |
pOutPickedPoint | Picked position. |
Definition at line 483 of file fbmodel.h.
{ return false; }
unsigned char* GetSelectedPoints | ( | ) |
Get the list of the points selection state.
int GetSelectedPointsCount | ( | ) |
Get the number of selected points in the model.
virtual bool FbxStore | ( | HFBFbxObject | pFbxObject, |
kFbxObjectStore | pStoreWhat | ||
) | [virtual] |
Store and Retrieve function that can be overloaded.
pFbxObject | FBX Object that is used to communicate I/O operations. |
pStoreWhat | Which attributes are currently stored/retrieved. |
Reimplemented from FBBox.
virtual bool FbxRetrieve | ( | HFBFbxObject | pFbxObject, |
kFbxObjectStore | pStoreWhat | ||
) | [virtual] |
Reimplemented from FBBox.
void 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.
virtual char* FbxGetObjectType | ( | ) | [virtual] |
Returns the class type inherited by the class of an object, for example: 'Model'.
Reimplemented from FBBox.
virtual char* FbxGetObjectSubType | ( | ) | [virtual] |
Returns the class sub type inherited by the class of an object, for example: 'Default', 'Mesh'.
Reimplemented from FBBox.
List: Textures with Special UseType (Other than "Color" which should connect to materials).
List: Deformers (Skeleton Deformer or Point Cache Deformer).
Read Write Property: Is model a 3D icon?
Read Write Property: Is model Soft selected?
Read Only Property: Is model deformable?
Read Only Property: Is model constrained?
Read Write Property: Model skeleton deformable.
Not Savable
Read Write Property: Model blendshape deformable.
Not Savable
Read Write Property: Model constraint deformable.
Not Savable
Read Write Property: Model point cache deformable.
Not Savable
Read Write Property: Record Point Cache for model? Not Savable
FBPropertyModel Parent |
Read Write Property: Parent model.
FBPropertyModel LookAt |
Read Write Property: Look at model (interest point).
FBPropertyModel UpVector |
Read Write Property: UpVector model.
FBPropertyGeometry Geometry |
Read Write Property: Geometry for the model.
FBPropertyMesh TessellatedMesh |
Read Only Property: Tessellated Mesh for the model.
FBPropertyModelVertexData ModelVertexData |
Read Only Property: ModelVertexData for the model.
FBPropertyCluster Cluster |
Read Only Property: Link Cluster for the model.
FBPropertyScene Scene |
Read Only Property: Scene containing the model.
FBPropertyModelShadingMode ShadingMode |
Read Write Property: Shading mode for the model.
FBPropertyAnimationNode AnimationNode |
Read Only Property: Animation node of the model.
FBPropertyModelRotationOrder RotationOrder |
Read Write Property: Rotation order.
Read Write Property: Apply Post Rotation Matrix only for Limits?
Read Write Property: Is model using Rotation Limits?
Read Write Property: Pre Rotation (considered if RotationActive is true)
Read Write Property: Post Rotation (considered if RotationActive is true)
Read Write Property: Min Rotation Limit (considered if RotationActive is true)
Read Write Property: Max 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: 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: Visibility of model.
This can be overriden by the 'Show' property.
Read Write Property: //!< When this value is set to
True
the Visibility of this model is also applied to
all its descendants
Read Write Property: Lcl translation.
Read Write Property: Lcl rotation.
Read Write Property: Lcl scaling.
Read Write Property: Geometric translation.
Read Write Property: Geometric rotation.
Read Write Property: Geometric scaling.
Read Write Property: Use quaternion interpolation.
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: Indicate if a model can be picked in the viewer.
This has a default value of 'true'.