FBX Objects
 
 
 

FBX Object Creation and Destruction

An FBX object is an instance of KFbxObject, or any other class derived from KFbxObject. An instance of an object is created by invoking its class' Create() function, along with a reference to the application's KFbxSdkManager singleton, or a reference to a KFbxScene object.

An object can be explicitly destroyed by invoking its Destroy() member function, or by invoking Destroy() on the KFbxSdkManager or KFbxScene object used to create it.

For more information on object creation and destruction, see Managing memory with the FBX SDK manager.

FBX Object Properties

The FBX SDK uses the KFbxProperty class (and any of its derived classes) to ensure the strongly typed nature of KFbxObject properties. For example, the KFbxNode class uses several parametrized KFbxTypedProperty objects to define its geometric transformation data (KFbxNode::LclTranslation(), KFbxNode::LclRotation(), KFbxNode::LclScaling()). For more information on FBX object properties, see FBX Properties.

Copying an FBX Object

An FBX object may be copied by calling its Copy() member function. The assignment operator (operator=) cannot be used to copy FBX objects; it is a private member function. The following code sample illustrates how to copy a mesh object.

// Assume that lScene is a pointer to a valid scene object.
KFbxMesh* lSourceMesh = KFbxMesh::Create (lScene, "");
 
// Define control points, etc. for lSourceMesh.
 
// This mesh will be overwritten
KFbxMesh* lTargetMesh = KFbxMesh::Create (lScene, "");
 
// Copy the data from lSourceMesh into lTargetMesh. Note that
// the source object and the target object must be instances of
// the same class (KFbxMesh in this case).
lTargetMesh->Copy(lSourceMesh);

NoteA copied KFbxObject will have the same properties (KFbxProperty) as the original. However, the parent/child relationships in which the original KFbxObject was participating will not be reflected in its copy. These relationships should be set explicitly for the copy.
NoteThe Clone() member function is under review - we recommend that you do not use it. Its behavior should nonetheless remain consistent with previous versions of the FBX SDK.