Public Member Functions | Public Attributes

FBScene Class Reference

This reference page is linked to from the following overview topics: MotionBuilder 2014, MotionBuilder 2013, Your First Python Program, FBSystem - The System Class, Scene Elements, FBScene - The Scene Class, FBModel - Transformation Data and the Scene Graph.


Search for all occurrences

Detailed Description

Access to the MotionBuilder scene.

In MotionBuilder, the scene is the environment where your models exist. The scene contains models which you can import, select, transform, copy, tweak, and animate.

The FBScene object is obtained from the scene attribute of FBSystem.

The FBScene class contains many attributes that you can use to access objects, e.g cameras, characters, lights, and takes, essentially everything you see in the Navigator in the UI. A project can only contain one scene, and if you try to create an instance of a scene you will get an error, so you must access the scene by getting a handle through FBSystem.

    myScene = FBSystem().Scene

See also the C++ code sample in toolscene.

Definition at line 281 of file fbscene.h.

#include <fbscene.h>

Inheritance diagram for FBScene:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FBScene (HIObject pObject)
 Constructor.
virtual void FBDelete ()
 Virtual FBDelete function.
void Clear ()
 Clears the elements part of the scene.
bool Evaluate ()
 Evaluate the scene.
bool CandidateEvaluationAndResolve ()
 Resolving the Candidate.
bool EvaluateDeformations ()
 Evaluate the deformations of the scene.
void GetScriptsPaths (FBStringList &pPathList)
 Get paths of all the python scripts object in the scene.
Namespace Management.
int NamespaceGetChildrenList (FBStringList &pNamespaceList, const char *pNamespace=NULL, bool pRecursive=true)
 Get list of children namespaces in the given namespace.
FBFileReferenceNamespaceGetOwnerFileReference (const char *pNamespace)
 Get Owner FileReference object if the namespace is originated from File Reference.
FBNamespaceNamespaceGet (const char *pNamespace)
 Get Namespace object.
bool NamespaceExist (const char *pNamespace)
 Query if namespace exists.
bool NamespaceEmpty (const char *pNamespace)
 Query if namespace is empty.
void NamespaceGetContentList (FBComponentList &pContentList, const char *pNamespace, FBPlugModificationFlag pModificationFlags=kFBPlugAllContent, bool pRecursive=true, int pTypeInfo=FBPlug::TypeInfo, bool pExactTypeMatch=false)
 Get List of the namespace content.
void NamespaceSelectContent (const char *pNamespace, bool pSelect, FBPlugModificationFlag pModificationFlags=kFBPlugAllContent, bool pRecursive=true, int pTypeInfo=FBPlug::TypeInfo, bool pExactTypeMatch=false)
 Select (or de-select) the namespace content.
bool NamespaceRename (const char *pNameSpace, const char *pNewNamespace, bool pRecursive=true, int pTypeInfo=FBPlug::TypeInfo, bool pExactTypeMatch=false)
 Rename the namespace.
bool NamespaceDelete (const char *pNamespace)
 Delete the namespace & all its content.
bool NamespaceCleanup ()
 Remove all empty namespaces.
bool NamespaceDeleteContent (const char *pNamespace, FBPlugModificationFlag pModificationFlags=kFBPlugAllContent, bool pRecursive=true, int pTypeInfo=FBPlug::TypeInfo, bool pExactTypeMatch=false)
 Delete the namespace content.
bool NamespaceImport (const char *pNamespace, const char *pFilePath, bool pAsFileReference=false)
 Import file into Namespace (or as file reference)
bool NamespaceImportToMultiple (const FBStringList &pDstNamespaceList, const char *pFilePath, bool pAsFileReference=false)
 Import file into multiple Namespaces (or as file references)
bool NamespaceExport (const char *pNamespace, const char *pFilePath, bool pASCIIFormat=false)
 Export scene content within namespace to file.

Public Attributes

FBPropertyListTake Takes
 List: Takes for scene.
FBPropertyModel RootModel
 Read Only Property: Scene Root model for that scene
FBPropertyListCamera Cameras
 List: Cameras in scene.
FBPropertyListMaterial Materials
 List: Materials for scene.
FBPropertyListTexture Textures
 List: Textures for scene.
FBPropertyListShader Shaders
 List: Shaders for scene.
FBPropertyListDeformer Deformers
 List: Deformers for scene.
FBPropertyListDevice Devices
 List: Devices for scene.
FBPropertyListConstraint Constraints
 List: Constraints in scene.
FBPropertyListLight Lights
 List: Lights in scene.
FBPropertyListAudioClip AudioClips
 List: Audio clips in scene.
FBPropertyListVideoClip VideoClips
 List: Video clips in scene.
FBPropertyListMotionClip MotionClips
 List: Motion clips in scene.
FBPropertyListFolder Folders
 List: Folders in scene.
FBPropertyListNote Notes
 List: Notes in scene.
FBPropertyListPose Poses
 List: Poses in scene.
FBPropertyListObjectPose ObjectPoses
 List: ObjectPoses in scene.
FBPropertyListActor Actors
 List: Actors in scene.
FBPropertyListActorFace ActorFaces
 List: ActorFaces in scene.
FBPropertyListMarkerSet MarkerSets
 List: Marker sets in scene.
FBPropertyListCharacterMarkerSet CharacterMarkerSets
 List: Character marker sets in scene.
FBPropertyListControlSet ControlSets
 List: Control set rigs in scene.
FBPropertyListCharacter Characters
 List: Characters in scene.
FBPropertyListCharacterFace CharacterFaces
 List: Character faces in scene.
FBPropertyListCharacterPose CharacterPoses
 List: Character poses in scene.
FBPropertyListCharacterExtension CharacterExtensions
 List: Character extensions available in the scene.
FBPropertyListUserObject UserObjects
 List: User objects
FBPropertyProjectSettings ProjectSettings
 Read Only Property: Local project settings
FBPropertyRenderer Renderer
 Read Only Property: Local renderer.
FBPropertyListComponent Components
 List: Generic List of components.
FBPropertyListGroup Groups
 List: Groups available in the scene.
FBPropertyListSet Sets
 List: Sets available in the scene.
FBPropertyListNamespace Namespaces
 List: Namespace (include FileReference) available in the scene
FBPropertyListFileReference FileReferences
 List: FileReference available in the scene.
FBPropertyListHandle Handles
 List: Handles present in the scene.
FBPropertyListHUD HUDs
 Read Only Property: Heads Up Displays in the scene.
FBPropertyListConstraintSolver ConstraintSolvers
 List: Constraint Solvers present in the scene.
FBPropertyListPhysicalProperties PhysicalProperties
 List: PhysicalProperties present in the scene.
FBPropertyString FilePath
 Read Write Property: File path of the scene.
FBPropertyListKeyingGroup KeyingGroups
 Read Write Property: Keying Groups in the scene.
FBPropertyListModelSkeleton ModelSkeletons
 Read Write Property: Bones (Skeletons) in the scene.
FBPropertyListModelOptical ModelOpticals
 Read Write Property: Optical Data in the scene.
FBPropertyEvent OnChange
 Event: Something in the scene has happened.
FBPropertyEvent OnTakeChange
 Event: Something related to a take has happened.

Constructor & Destructor Documentation

FBScene ( HIObject  pObject)

Constructor.

Client code cannot instantiate objects of this class. The FBSystem class provides access to the current scene object.

Parameters:
pObjectInternal parent object.

Member Function Documentation

virtual void FBDelete ( ) [virtual]

Virtual FBDelete function.

Reimplemented from FBComponent.

void Clear ( )

Clears the elements part of the scene.

Not those that belong to all the scenes.

bool Evaluate ( )

Evaluate the scene.

Note:
MoBu's is highly optimized for real-time performance, due to its multi-thread, double buffer and lazy-evaluation architecture, complex scripts are often required to call FBScene::Evaluate() to commit previous scene change commands before execute following operations. Also, certain operations in SDK may require cached data to be reevaluated. In typical large scenes this call may be consider as very costly. That�s why user is responsible to design code in the way that requires as little as possible calls to FBScene::Evaluate. We should consider use FBScene::Evaluate() between scene change commands as "common scripting practice
Returns:
true if successful.
bool CandidateEvaluationAndResolve ( )

Resolving the Candidate.

Returns:
true if successful.
bool EvaluateDeformations ( )

Evaluate the deformations of the scene.

Returns:
true if successful.
void GetScriptsPaths ( FBStringList pPathList)

Get paths of all the python scripts object in the scene.

Parameters:
pPathListOut parameter, to collect the path of python scripts.
int NamespaceGetChildrenList ( FBStringList pNamespaceList,
const char *  pNamespace = NULL,
bool  pRecursive = true 
)

Get list of children namespaces in the given namespace.

Parameters:
pNamespaceListthe list of namespace to return.
pNamespacespecify the parent namespace, NULL for the whole scene.
pRecursiveTrue only work on the direct children level namespace, otherwise will work on the whole children namespace hierarchy recursively.
Returns:
the list of children namespaces.
FBFileReference* NamespaceGetOwnerFileReference ( const char *  pNamespace)

Get Owner FileReference object if the namespace is originated from File Reference.

Parameters:
pNamespacethe namespace to work on, could be nested namespace inside the FileReference's namespace.
Returns:
the FileReference object is the namespace is originated from. NULL otherwise.
FBNamespace* NamespaceGet ( const char *  pNamespace)

Get Namespace object.

Parameters:
pNamespacethe namespace to query
Returns:
Namespace with exact name matching
bool NamespaceExist ( const char *  pNamespace)

Query if namespace exists.

Parameters:
pNamespacethe namespace to query
Returns:
True if the namespace exist, otherwise return False.
bool NamespaceEmpty ( const char *  pNamespace)

Query if namespace is empty.

Parameters:
pNamespacethe namespace to query, NULL for whole scene.
Returns:
True if the namespace (don't include nested children namespace) is empty
void NamespaceGetContentList ( FBComponentList pContentList,
const char *  pNamespace,
FBPlugModificationFlag  pModificationFlags = kFBPlugAllContent,
bool  pRecursive = true,
int  pTypeInfo = FBPlug::TypeInfo,
bool  pExactTypeMatch = false 
)

Get List of the namespace content.

Parameters:
pContentListthe list of content to return.
pNamespacethe namespace to work on, NULL for whole scene.
pModificationFlagsbitwise combination of kFBConnectionSrcObjectModified, kFBConnectionDstObjectModified, kFBConnectionSrcPropertyModified, kFBConnectionDstPropertyModified flags. kFBPlugAllContent means all the content. Modification flags beside kFBPlugAllContent will only work on FileReference Namespace.
pRecursiveTrue only work on the direct children level namespace, otherwise will work on the whole children namespace hierarchy recursively.
pTypeInfothe typeInfo of the type of interested object, 0 for all the objects.
pExactTypeMatchif True, the derived typeInfo won't be considered (For example, FBCamera won't be considered when passing FBModel::TypeInfo).
void NamespaceSelectContent ( const char *  pNamespace,
bool  pSelect,
FBPlugModificationFlag  pModificationFlags = kFBPlugAllContent,
bool  pRecursive = true,
int  pTypeInfo = FBPlug::TypeInfo,
bool  pExactTypeMatch = false 
)

Select (or de-select) the namespace content.

Parameters:
pNamespacethe namespace to work on, NULL for whole scene.
pSelectTrue (or False) indicate to select (or de-select)
pModificationFlagsbitwise combination of kFBConnectionSrcObjectModified, kFBConnectionDstObjectModified, kFBConnectionSrcPropertyModified, kFBConnectionDstPropertyModified flags. kFBPlugAllContent means all the content. Modification flags beside kFBPlugAllContent will only work on FileReference Namespace.
pRecursiveTrue only work on the direct children level namespace, otherwise will work on the children namespace hierarchy recursively.
pTypeInfothe typeInfo of the type of interested object, default for all the objects.
pExactTypeMatchif True, the derived typeInfo won't be considered (For example, FBCamera won't be considered when passing FBModel::TypeInfo).
bool NamespaceRename ( const char *  pNameSpace,
const char *  pNewNamespace,
bool  pRecursive = true,
int  pTypeInfo = FBPlug::TypeInfo,
bool  pExactTypeMatch = false 
)

Rename the namespace.

Parameters:
pNameSpacethe namespace to work on, NULL for whole scene.
pNewNamespacethe new namespace
pRecursiveTrue only work on the direct children level namespace, otherwise will work on the children namespace hierarchy recursively.
pTypeInfothe typeInfo of the type of interested object, default for all the objects.
pExactTypeMatchif True, the derived typeInfo won't be considered (For example, FBCamera won't be considered when passing FBModel::TypeInfo).
Returns:
True if operation successfully, False is this namespace (or pTypeInfo type of objects) doesn't exist, or locked (by FileReferencing or etc.,)
Note:
call with default parameters is considered as renaming of the whole namespace structure, otherwise will be considered as partially renaming individual objects. Renaming permission will be validated accordingly.
bool NamespaceDelete ( const char *  pNamespace)

Delete the namespace & all its content.

Parameters:
pNamespacethe namespace to work on
Returns:
True if operation successfully, False is this namespace doesn't exist, or is locked (by FileReferencing or etc.,)
bool NamespaceCleanup ( )

Remove all empty namespaces.

During some namespace operations, empty namespace may left over, while this is not harmful but could be annoying. Save the scene and load it back those empty namespaces will disappear. And this function also allow user to remove all empty namespaces from the scene easily via SDK.

Returns:
True if operation successfully.
bool NamespaceDeleteContent ( const char *  pNamespace,
FBPlugModificationFlag  pModificationFlags = kFBPlugAllContent,
bool  pRecursive = true,
int  pTypeInfo = FBPlug::TypeInfo,
bool  pExactTypeMatch = false 
)

Delete the namespace content.

Parameters:
pNamespacethe namespace to work on
pModificationFlagsbitwise combination of kFBConnectionSrcObjectModified, kFBConnectionDstObjectModified, kFBConnectionSrcPropertyModified, kFBConnectionDstPropertyModified flags. kFBPlugAllContent means all the content. Modification flags beside kFBPlugAllContent will only work on FileReference Namespace.
pRecursiveTrue only work on the direct children level namespace, otherwise will work on the children namespace hierarchy recursively.
pTypeInfothe typeInfo of the type of interested object, default for all the objects.
pExactTypeMatchif True, the derived typeInfo won't be considered (For example, FBCamera won't be considered when passing FBModel::TypeInfo).
Returns:
False is the given namespace doesn't exist, or is locked (by FileRef or etc.,), True otherwise.
Note:
Not all the objects will be deletable (system objects and etc.,). Deletion of partial FileRef content isn't prevented, however the behavior is undefined.
bool NamespaceImport ( const char *  pNamespace,
const char *  pFilePath,
bool  pAsFileReference = false 
)

Import file into Namespace (or as file reference)

Parameters:
pNamespacethe namespace to import to, must be in editable scope.
pFilePaththe referenced file path to import.
pAsFileReferenceimport the file as file reference. The default value is false.
Returns:
True if successfully.
bool NamespaceImportToMultiple ( const FBStringList pDstNamespaceList,
const char *  pFilePath,
bool  pAsFileReference = false 
)

Import file into multiple Namespaces (or as file references)

Parameters:
pDstNamespaceListthe Dst namespaces list to import, must not exist or be self contained.
pFilePaththe referenced file path to import.
pAsFileReferenceimport the file as file reference. The default value is false.
Returns:
True if successfully.
bool NamespaceExport ( const char *  pNamespace,
const char *  pFilePath,
bool  pASCIIFormat = false 
)

Export scene content within namespace to file.

Parameters:
pNamespacethe namespace to use, must exist
pFilePaththe referenced file path to export.
pASCIIFormatsave the file in ASCII format.
Returns:
True if successfully.

Member Data Documentation

List: Takes for scene.

Definition at line 457 of file fbscene.h.

FBPropertyModel RootModel

Read Only Property: Scene Root model for that scene

Definition at line 458 of file fbscene.h.

List: Cameras in scene.

Definition at line 459 of file fbscene.h.

List: Materials for scene.

Definition at line 460 of file fbscene.h.

List: Textures for scene.

Definition at line 461 of file fbscene.h.

List: Shaders for scene.

Definition at line 462 of file fbscene.h.

List: Deformers for scene.

Definition at line 463 of file fbscene.h.

List: Devices for scene.

Definition at line 464 of file fbscene.h.

List: Constraints in scene.

Definition at line 465 of file fbscene.h.

List: Lights in scene.

Definition at line 467 of file fbscene.h.

List: Audio clips in scene.

Definition at line 469 of file fbscene.h.

List: Video clips in scene.

Definition at line 472 of file fbscene.h.

List: Motion clips in scene.

Definition at line 475 of file fbscene.h.

List: Folders in scene.

Definition at line 478 of file fbscene.h.

List: Notes in scene.

Definition at line 482 of file fbscene.h.

List: Poses in scene.

Definition at line 486 of file fbscene.h.

List: ObjectPoses in scene.

Definition at line 487 of file fbscene.h.

List: Actors in scene.

Definition at line 491 of file fbscene.h.

List: ActorFaces in scene.

Definition at line 492 of file fbscene.h.

List: Marker sets in scene.

Definition at line 496 of file fbscene.h.

List: Character marker sets in scene.

Definition at line 497 of file fbscene.h.

List: Control set rigs in scene.

Definition at line 498 of file fbscene.h.

List: Characters in scene.

Definition at line 499 of file fbscene.h.

List: Character faces in scene.

Definition at line 500 of file fbscene.h.

List: Character poses in scene.

Definition at line 501 of file fbscene.h.

List: Character extensions available in the scene.

Definition at line 502 of file fbscene.h.

List: User objects

Definition at line 506 of file fbscene.h.

FBPropertyProjectSettings ProjectSettings

Read Only Property: Local project settings

Definition at line 510 of file fbscene.h.

FBPropertyRenderer Renderer

Read Only Property: Local renderer.

Definition at line 513 of file fbscene.h.

List: Generic List of components.

Reimplemented from FBComponent.

Definition at line 514 of file fbscene.h.

List: Groups available in the scene.

Definition at line 515 of file fbscene.h.

List: Sets available in the scene.

Definition at line 516 of file fbscene.h.

List: Namespace (include FileReference) available in the scene

Definition at line 517 of file fbscene.h.

List: FileReference available in the scene.

Definition at line 518 of file fbscene.h.

List: Handles present in the scene.

Definition at line 521 of file fbscene.h.

Read Only Property: Heads Up Displays in the scene.

Definition at line 524 of file fbscene.h.

List: Constraint Solvers present in the scene.

Definition at line 527 of file fbscene.h.

List: PhysicalProperties present in the scene.

Definition at line 528 of file fbscene.h.

Read Write Property: File path of the scene.

Definition at line 530 of file fbscene.h.

Read Write Property: Keying Groups in the scene.

Definition at line 532 of file fbscene.h.

Read Write Property: Bones (Skeletons) in the scene.

Definition at line 533 of file fbscene.h.

Read Write Property: Optical Data in the scene.

Definition at line 535 of file fbscene.h.

Event: Something in the scene has happened.

(FBEventSceneChange)

Definition at line 537 of file fbscene.h.

Event: Something related to a take has happened.

(FBEventTakeChange)

Definition at line 538 of file fbscene.h.


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

FBScene FBScene FBScene FBScene FBScene FBScene FBScene FBScene FBScene FBScene
FBScene FBScene FBScene FBScene FBScene FBScene FBScene FBScene FBScene FBScene