Public Member Functions

FbxScene Class Reference

This reference page is linked to from the following overview topics: FBX SDK 2014, Supported Scene Elements, Information and Technical Support, Your First FBX SDK Program, Importing a Scene, Exporting a Scene, Managing Memory with the FBX SDK Manager, FBX Objects, FBX Properties, Connections, FBX Scenes, Merging Two Scenes, FBX Nodes, Transformation Data, Lights, Animation Data Structures, Animation Classes and their Interrelationships, Writing and Using your Own Evaluator, Extracting the Animation Data from a FBX File, Evaluating the Animation in a Scene, Using Python FBX with Eclipse, List of Python Fbx classes.


Search for all occurrences

Detailed Description

This class contains the description of a 3D scene.

It contains the nodes (including the root node) (FbxNode), materials, textures, videos, gobos, poses, characters, character poses, control set plugs, generic nodes, scene information, global settings, and a global evaluator. The nodes are structured in a tree under the scene's root node.

When an object is created using the FBX SDK, a scene is usually passed as argument to the object creation function to specify that the object belongs to this scene. At this point, a connection is made with the object as source and the scene as destination.

All objects in the scene can be queried by connection index. In addition, generic nodes, materials, and textures can also be queried by name. In this latter case, the first object with the queried name will be returned.

The global evaluator (FbxAnimEvaluator) is used to compute animation values for animated scenes.

Definition at line 61 of file fbxscene.h.

#include <fbxscene.h>

Inheritance diagram for FbxScene:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void FillPoseArray (FbxArray< FbxPose * > &pPoseArray)
 Clear then fill a pose array with all existing pose included in the scene.
virtual FbxObjectClone (FbxObject::ECloneType pCloneType=eDeepClone, FbxObject *pContainer=NULL) const
 Clone this scene object (and everything else it contains if clone type is eDeepClone)
virtual FbxObjectCopy (const FbxObject &pObject)
 Copy an object content into this object.
void ConnectMaterials ()
void BuildMaterialLayersDirectArray ()
void ReindexMaterialConnections ()
FbxSetAddTakeTimeWarpSet (char *pTakeName)
FbxSetGetTakeTimeWarpSet (char *pTakeName)
void ForceKill ()
void ConvertNurbsSurfaceToNurbs ()
void ConvertMeshNormals ()
void ConvertNurbsCurvesToNulls ()
void ConnectTextures ()
void BuildTextureLayersDirectArray ()
void FixInheritType (FbxNode *pNode)
void UpdateScaleCompensate (FbxNode *pNode, FbxIOSettings &pIOS)
FbxClassId ConvertAttributeTypeToClassID (FbxNodeAttribute::EType pAttributeType)
FbxGlobalLightSettingsGlobalLightSettings ()
FbxGlobalCameraSettingsGlobalCameraSettings ()

Clear scene

void Clear ()
 Delete the node tree below the root node and restore default settings.

Node Tree Access

FbxNodeGetRootNode () const
 Get the root node of the scene.

Texture Material and Video Access

void FillTextureArray (FbxArray< FbxTexture * > &pTextureArray)
 Clear, then fill, a texture array with all existing textures included in the scene.
void FillMaterialArray (FbxArray< FbxSurfaceMaterial * > &pMaterialArray)
 Clear, then fill, a material array with all existing materials included in the scene.

Generic Node Access

int GetGenericNodeCount () const
 Get number of generic nodes in the scene.
FbxGenericNodeGetGenericNode (int pIndex)
 Get generic node at given index.
FbxGenericNodeGetGenericNode (char *pName)
 Access a generic node from its name.
bool AddGenericNode (FbxGenericNode *pGenericNode)
 Add a generic node to this scene.
bool RemoveGenericNode (FbxGenericNode *pGenericNode)
 Remove the generic node from this scene.

Character Management

int GetCharacterCount () const
 Get number of characters.
FbxCharacterGetCharacter (int pIndex)
 Get character at given index.
int CreateCharacter (const char *pName)
 Create a new character.
void DestroyCharacter (int pIndex)
 Destroy character.

ControlSetPlug Management

int GetControlSetPlugCount () const
 Get number of ControlSetPlugs.
FbxControlSetPlugGetControlSetPlug (int pIndex)
 Get ControlSetPlug at given index.
int CreateControlSetPlug (char *pName)
 Create a new ControlSetPlug.
void DestroyControlSetPlug (int pIndex)
 Destroy ControlSetPlug.

Character Pose Management

int GetCharacterPoseCount () const
 Get number of character poses.
FbxCharacterPoseGetCharacterPose (int pIndex)
 Get character pose at given index.
int CreateCharacterPose (char *pName)
 Create a new character pose.
void DestroyCharacterPose (int pIndex)
 Destroy character pose.

Pose Management

int GetPoseCount () const
 Get number of poses.
FbxPoseGetPose (int pIndex)
 Get pose at given index.
bool AddPose (FbxPose *pPose)
 Add a pose to this scene.
bool RemovePose (FbxPose *pPose)
 Remove the specified pose from the scene.
bool RemovePose (int pIndex)
 Remove the pose at the given index from the scene.

Scene information

FbxDocumentInfoGetSceneInfo ()
 Get the scene information.
void SetSceneInfo (FbxDocumentInfo *pSceneInfo)
 Set the scene information.

Global Settings

FbxGlobalSettingsGetGlobalSettings ()
 Access global settings.
const FbxGlobalSettingsGetGlobalSettings () const
 Const access to global settings.

Global Evaluator

The global evaluator is used to compute animation values for animated scenes.A typical usage would be to compute the global transform matrix of a node lNode at a given time lTime.
      FbxAMatrix& lGlobalMatrix = lNode->GetScene()->GetEvaluator()->GetNodeGlobalTransform(lNode, lTime);

      or the exact equivalent:

      FbxAMatrix& lGlobalMatrix = lNode->EvaluateGlobalTransform(lTime);
The user can create one or more evaluators in the scene. The default evaluator is set using SetEvaluator. When GetEvaluator is called, if the scene has no evaluator, an evaluator is created with default values.
void SetEvaluator (FbxAnimEvaluator *pEvaluator)
 Set the global evaluator used by this scene evaluation engine.
FbxAnimEvaluatorGetEvaluator ()
 Get the global evaluator used by this scene evaluation engine.

Material Access

int GetMaterialCount () const
 Get number of materials.
FbxSurfaceMaterialGetMaterial (int pIndex)
 Get the material at the given index.
FbxSurfaceMaterialGetMaterial (char *pName)
 Get the material by its name.
bool AddMaterial (FbxSurfaceMaterial *pMaterial)
 Add the material to this scene.
bool RemoveMaterial (FbxSurfaceMaterial *pMaterial)
 Remove the material from this scene.

Texture Access

int GetTextureCount () const
 Get number of textures (type FbxTexture).
FbxTextureGetTexture (int pIndex)
 Get the texture at the given index.
FbxTextureGetTexture (char *pName)
 Get the texture by its name.
bool AddTexture (FbxTexture *pTexture)
 Add the texture to this scene.
bool RemoveTexture (FbxTexture *pTexture)
 Remove the texture from this scene.

Node Access

int GetNodeCount () const
 Get number of nodes.
FbxNodeGetNode (int pIndex)
 Get the node at the given index.
bool AddNode (FbxNode *pNode)
 Add the node to this scene.
bool RemoveNode (FbxNode *pNode)
 Remove the node from this scene.
int GetCurveOnSurfaceCount ()
 Helper method for determining the number of nodes that have curves on surface attributes in the scene.
FbxNodeFindNodeByName (const FbxString &pName)
 Get the first node with this name.

Geometry Access

int GetGeometryCount () const
 Get number of geometries.
FbxGeometryGetGeometry (int pIndex)
 Get the geometry at the given index.
bool AddGeometry (FbxGeometry *pGeometry)
 Add the geometry to this scene.
bool RemoveGeometry (FbxGeometry *pGeometry)
 Remove the geometry from this scene.

Video Access

int GetVideoCount () const
 Get number of videos.
FbxVideoGetVideo (int pIndex)
 Get the video at the given index.
bool AddVideo (FbxVideo *pVideo)
 Add the video to this scene.
bool RemoveVideo (FbxVideo *pVideo)
 Remove the video from this scene.

Utilities

void SyncShowPropertyForInstance ()
 Synchronize all the Show properties of node instances.

Member Function Documentation

void Clear ( ) [virtual]

Delete the node tree below the root node and restore default settings.

Reimplemented from FbxDocument.

FbxNode* GetRootNode ( ) const

Get the root node of the scene.

Returns:
Pointer to the root node.
Remarks:
This node is not saved. Do not use it to apply a global transformation to the node hierarchy. If a global transformation must be applied, insert a new node below this one.
void FillTextureArray ( FbxArray< FbxTexture * > &  pTextureArray)

Clear, then fill, a texture array with all existing textures included in the scene.

Parameters:
pTextureArrayAn array of texture pointers.
void FillMaterialArray ( FbxArray< FbxSurfaceMaterial * > &  pMaterialArray)

Clear, then fill, a material array with all existing materials included in the scene.

Parameters:
pMaterialArrayAn array of material pointers.
int GetGenericNodeCount ( ) const

Get number of generic nodes in the scene.

Returns:
Number of Generic Nodes in this scene.
FbxGenericNode* GetGenericNode ( int  pIndex)

Get generic node at given index.

Parameters:
pIndexPosition in the list of the generic nodes.
Returns:
Pointer to the generic node or NULL if the index is out of bounds.
FbxGenericNode* GetGenericNode ( char *  pName)

Access a generic node from its name.

Parameters:
pNameName of the generic node.
Returns:
found generic node
bool AddGenericNode ( FbxGenericNode pGenericNode)

Add a generic node to this scene.

Parameters:
pGenericNodePointer to the generic node to be added.
Returns:
If the passed parameter is NULL, this method will return false, otherwise true.
bool RemoveGenericNode ( FbxGenericNode pGenericNode)

Remove the generic node from this scene.

Parameters:
pGenericNodePointer to the generic node to be removed.
Returns:
If the passed parameter is NULL, this method will return false, otherwise true.
Remarks:
The pointed object is not referenced by the scene anymore but is not deleted.
int GetCharacterCount ( ) const

Get number of characters.

Returns:
Number of characters in this scene.
FbxCharacter* GetCharacter ( int  pIndex)

Get character at given index.

Parameters:
pIndexPosition in the list of the characters.
Returns:
Pointer to the character or NULL if index is out of bounds.
int CreateCharacter ( const char *  pName)

Create a new character.

Parameters:
pNameName given to character.
Returns:
Index of the created character.
void DestroyCharacter ( int  pIndex)

Destroy character.

Parameters:
pIndexSpecify which character to destroy.
int GetControlSetPlugCount ( ) const

Get number of ControlSetPlugs.

Returns:
Number of ControlSet plugs in this scene.
FbxControlSetPlug* GetControlSetPlug ( int  pIndex)

Get ControlSetPlug at given index.

Parameters:
pIndexPosition in the list of the ControlSetPlug
Returns:
Pointer to ControlSetPlug or NULL if index is out of bounds.
int CreateControlSetPlug ( char *  pName)

Create a new ControlSetPlug.

Parameters:
pNameName given to ControlSetPlug.
Returns:
Index of created ControlSetPlug.
void DestroyControlSetPlug ( int  pIndex)

Destroy ControlSetPlug.

Parameters:
pIndexSpecify which ControlSetPlug to destroy.
int GetCharacterPoseCount ( ) const

Get number of character poses.

Returns:
Number of character poses in this scene.
Remarks:
Character Poses and Poses are two distinct entities having their own lists.
FbxCharacterPose* GetCharacterPose ( int  pIndex)

Get character pose at given index.

Parameters:
pIndexPosition in the list of character poses.
Returns:
Pointer to the character pose or NULL if index is out of bounds.
int CreateCharacterPose ( char *  pName)

Create a new character pose.

Parameters:
pNameName given to character pose.
Returns:
Index of created character pose.
void DestroyCharacterPose ( int  pIndex)

Destroy character pose.

Parameters:
pIndexSpecify which character pose to destroy.
int GetPoseCount ( ) const

Get number of poses.

Returns:
Number of poses in the scene.
Remarks:
Poses and Character Poses are two distinct entities having their own lists.
FbxPose* GetPose ( int  pIndex)

Get pose at given index.

Parameters:
pIndexPosition in the list of poses.
Returns:
Pointer to the pose or NULL if index is out of bounds.
bool AddPose ( FbxPose pPose)

Add a pose to this scene.

Parameters:
pPoseThe pose (for example: bind pose, rest pose) to be added to the scene.
Returns:
If the pose is correctly added to the scene, return true. Otherwise, if the pose is already in the scene, return false.
bool RemovePose ( FbxPose pPose)

Remove the specified pose from the scene.

Parameters:
pPoseThe pose (for example: bind pose, rest pose) to be removed from the scene.
Returns:
If the pose was successfully removed from the scene, return true. Otherwise, if the pose could not be found return false.
bool RemovePose ( int  pIndex)

Remove the pose at the given index from the scene.

Parameters:
pIndexIndex of the pose to be removed.
Returns:
If the pose was successfully removed from the scene, return true. Otherwise, if the pose could not be found return false.
FbxDocumentInfo* GetSceneInfo ( ) [inline]

Get the scene information.

Returns:
Pointer to the scene information object.

Definition at line 279 of file fbxscene.h.

{ return GetDocumentInfo(); }
void SetSceneInfo ( FbxDocumentInfo pSceneInfo) [inline]

Set the scene information.

Parameters:
pSceneInfoPointer to the scene information object.

Definition at line 284 of file fbxscene.h.

{ SetDocumentInfo(pSceneInfo); }
FbxGlobalSettings& GetGlobalSettings ( )

Access global settings.

Returns:
Reference to the Global Settings.
const FbxGlobalSettings& GetGlobalSettings ( ) const

Const access to global settings.

Returns:
Const reference to the Global Settings.
void SetEvaluator ( FbxAnimEvaluator pEvaluator)

Set the global evaluator used by this scene evaluation engine.

Parameters:
pEvaluatorThe evaluator to be used for evaluation processing of this scene.
FbxAnimEvaluator* GetEvaluator ( )

Get the global evaluator used by this scene evaluation engine.

If no evaluator were previously set, this function will return either the first evaluator found attached to this scene, or a new default evaluator.

Returns:
The evaluator to be used for evaluation processing of this scene.
void FillPoseArray ( FbxArray< FbxPose * > &  pPoseArray)

Clear then fill a pose array with all existing pose included in the scene.

Parameters:
pPoseArrayAn array of pose pointers.
int GetMaterialCount ( ) const

Get number of materials.

Returns:
Number of materials in this scene.
FbxSurfaceMaterial* GetMaterial ( int  pIndex)

Get the material at the given index.

Parameters:
pIndexPosition in the list of materials.
Returns:
Pointer to the material or NULL if the index is out of bounds.
Remarks:
pIndex must be between 0 and GetMaterialCount().
FbxSurfaceMaterial* GetMaterial ( char *  pName)

Get the material by its name.

Parameters:
pNameName of the material.
Returns:
Pointer to the material or NULL if not found.
bool AddMaterial ( FbxSurfaceMaterial pMaterial)

Add the material to this scene.

Parameters:
pMaterialPointer to the material to be added.
Returns:
true on successful addition.
bool RemoveMaterial ( FbxSurfaceMaterial pMaterial)

Remove the material from this scene.

Parameters:
pMaterialPointer to the material to be removed.
Returns:
true on successful removal.
int GetTextureCount ( ) const

Get number of textures (type FbxTexture).

Returns:
Number of textures in this scene. Includes types FbxFileTexture, FbxLayeredTexture and FbxProceduralTexture.
Remarks:
To get the number of textures of a specific type, use GetSrcCount(). For example:
 int lNbFileTextures = lScene->GetSrcObjectCount<FbxFileTexture>();
 int lNbLayeredTextures = lScene->GetSrcObjectCount<FbxLayeredTexture>();
 int lNbProceduralTextures = lScene->GetSrcObjectCount<FbxProceduralTexture>();
FbxTexture* GetTexture ( int  pIndex)

Get the texture at the given index.

pIndex must be between 0 and GetTextureCount().

Parameters:
pIndexPosition in the list of textures.
Returns:
Pointer to the texture or NULL if the index is out of bounds.
Remarks:
To get the texture of a specific texture type, use GetSrcObject(). For example:
 FbxFileTexture* lFileTexture = lScene->GetSrcObject<FbxFileTexture>(i);
 FbxLayeredTexture* lLayeredTexture = lScene->GetSrcObject<FbxLayeredTexture>(i);
 FbxProceduralTexture* lProceduralTexture = lScene->GetSrcObject<FbxProceduralTexture>(i);
FbxTexture* GetTexture ( char *  pName)

Get the texture by its name.

Parameters:
pNameName of the texture.
Returns:
Pointer to the texture or NULL if not found.
bool AddTexture ( FbxTexture pTexture)

Add the texture to this scene.

Parameters:
pTexturePointer to the texture to be added.
Returns:
true on successful addition.
bool RemoveTexture ( FbxTexture pTexture)

Remove the texture from this scene.

Parameters:
pTexturePointer to the texture to be removed.
Returns:
true on successful removal.
int GetNodeCount ( ) const

Get number of nodes.

Returns:
Number of nodes in this scene.
FbxNode* GetNode ( int  pIndex)

Get the node at the given index.

Parameters:
pIndexPosition in the list of nodes.
Returns:
Pointer to the node or NULL if the index is out of bounds.
Remarks:
pIndex must be between 0 and GetNodeCount().
bool AddNode ( FbxNode pNode)

Add the node to this scene.

Parameters:
pNodePointer to the node to be added.
Returns:
true on successful addition.
bool RemoveNode ( FbxNode pNode)

Remove the node from this scene.

Parameters:
pNodePointer to the node to be removed.
Returns:
true on successful removal.
int GetCurveOnSurfaceCount ( )

Helper method for determining the number of nodes that have curves on surface attributes in the scene.

Since the curve-on-surface nodes are connected to nurbs geometry and not any FbxNode in the scene, they won't normally be picked up in a graph traversal.

Returns:
The number of curve-on-surface nodes in the scene
FbxNode* FindNodeByName ( const FbxString pName)

Get the first node with this name.

Parameters:
pNameName of the node.
Returns:
Pointer to the node, or NULL if node is not found.
int GetGeometryCount ( ) const

Get number of geometries.

Returns:
Number of geometries in this scene.
FbxGeometry* GetGeometry ( int  pIndex)

Get the geometry at the given index.

Parameters:
pIndexPosition in the list of geometries.
Returns:
Pointer to the geometry or NULL if the index is out of bounds.
Remarks:
pIndex must be between 0 and GetGeometryCount().
bool AddGeometry ( FbxGeometry pGeometry)

Add the geometry to this scene.

Parameters:
pGeometryPointer to the geometry to be added.
Returns:
true on successful addition.
bool RemoveGeometry ( FbxGeometry pGeometry)

Remove the geometry from this scene.

Parameters:
pGeometryPointer to the geometry to be removed.
Returns:
true on successful removal.
int GetVideoCount ( ) const

Get number of videos.

Returns:
Number of videos in this scene.
FbxVideo* GetVideo ( int  pIndex)

Get the video at the given index.

Parameters:
pIndexPosition in the list of videos.
Returns:
Pointer to the video or NULL if the index is out of bounds.
Remarks:
pIndex must be between 0 and GetVideoCount().
bool AddVideo ( FbxVideo pVideo)

Add the video to this scene.

Parameters:
pVideoPointer to the video to be added.
Returns:
true on successful addition.
bool RemoveVideo ( FbxVideo pVideo)

Remove the video from this scene.

Parameters:
pVideoPointer to the video to be removed.
Returns:
true on successful removal.
void SyncShowPropertyForInstance ( )

Synchronize all the Show properties of node instances.

Walks all the node attributes defined in the scene and synchronize the Show property of all the nodes that reference the node attribute so that they all contain the same value. This method should be called after the FBX scene is completely created (typically right after the calls to the FbxImporter::Import() or just before the calls to the FbxExporter::Export().

Remarks:
Applications only need to call this method if their interpretation of the Show property implies that setting the Show state on one instance affect all of them.
See also:
FbxNode::Visibility property, FbxNode::Show property
virtual FbxObject* Clone ( FbxObject::ECloneType  pCloneType = eDeepClone,
FbxObject pContainer = NULL 
) const [virtual]

Clone this scene object (and everything else it contains if clone type is eDeepClone)

Parameters:
pCloneTypeThe type of clone to be created. By default, the clone type is eDeepClone.
pContainerAn optional parameter to specify which object will "contain" the new object. By contain, we mean the new object will become a source to the container, connection-wise.
Returns:
The new clone, or NULL (if the specified clone type is not supported).
Remarks:
This method overwrites the FbxObject::Clone() method. When the clone type is "deep", the whole scene network is cloned. With the "reference" clone type, this method is simply calling the parent's Clone() method

Reimplemented from FbxObject.

virtual FbxObject& Copy ( const FbxObject pObject) [virtual]

Copy an object content into this object.

Parameters:
pObjectThe source object to copy data from.
Returns:
Returns the destination object being modified by the source.
Remarks:
This function replace the assignment operator (operator=). It will copy all property values and the name. Connections are NOT copied.

Reimplemented from FbxDocument.

void ConnectMaterials ( )
void BuildMaterialLayersDirectArray ( )
void ReindexMaterialConnections ( )
FbxSet* AddTakeTimeWarpSet ( char *  pTakeName)
FbxSet* GetTakeTimeWarpSet ( char *  pTakeName)
void ForceKill ( )
void ConvertNurbsSurfaceToNurbs ( )
void ConvertMeshNormals ( )
void ConvertNurbsCurvesToNulls ( )
void ConnectTextures ( )
void BuildTextureLayersDirectArray ( )
void FixInheritType ( FbxNode pNode)
void UpdateScaleCompensate ( FbxNode pNode,
FbxIOSettings pIOS 
)
FbxClassId ConvertAttributeTypeToClassID ( FbxNodeAttribute::EType  pAttributeType)
FbxGlobalLightSettings& GlobalLightSettings ( ) [inline]

Definition at line 610 of file fbxscene.h.

{ return *mGlobalLightSettings; }
FbxGlobalCameraSettings& GlobalCameraSettings ( ) [inline]

Definition at line 611 of file fbxscene.h.

{ return *mGlobalCameraSettings; }

The documentation for this class was generated from the following file:

FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene
FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene FbxScene