FBX SDK Programmer's Guide > FBX SDK Object Model >

# FBX Objects

## FBX Object Creation and Destruction

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

An object can be explicitly destroyed by invoking its Destroy() member function, or by invoking Destroy() on the FbxManager or FbxScene object used to create it. The FbxManager used to instantiate a FbxObject can be retrieved by calling FbxObject::GetFbxManager(). Observe that in the following code sample, FbxImporter inherits from FbxIO, which inherits from FbxObject.

    // Assume pImporter is an instance of FbxImporter.
    FbxManager* lSdkManager = pImporter->GetFbxManager();

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

## Properties

The FBX SDK uses the FbxProperty class to enforce strongly typed, static and/or dynamic associations of properties to instances of FbxObject. The FBX SDK property model is described in the next topic, FBX Properties.

## Collections

Container classes such as FbxAnimLayer, FbxAnimStack, and FbxScene inherit from the FbxCollection class. This class provides an interface to:

- Add members - FbxCollection::AddMember()
- Remove members - FbxCollection::RemoveMember()
- Count members - FbxCollection::GetMemberCount()
- Get a member - FbxCollection::GetMember()
- Search its members - FbxCollection::FindMember()

The FbxCollection::GetMemberCount() and FbxCollection::GetMember() functions are overloaded to accept a FbxCriteria. Consult the FbxCriteria class reference page for more information.

NoteThe Connections topic provides more information on how to navigate between objects and property hierarchies.

## 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.
    FbxMesh* lSourceMesh = FbxMesh::Create (lScene, "");

    // Define control points, etc. for lSourceMesh.

    // This mesh will be overwritten
    FbxMesh* lTargetMesh = FbxMesh::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 (FbxMesh in this case).
    lTargetMesh->Copy(lSourceMesh);

NoteCopying a FbxObject will also copy all of its associated FbxProperty instances, and their values.
NoteCopying a FbxObject does not copy any of its inter-object connections (for example, parent-child relationships). These connections must be set explicitly on the copy. For more information, see Connections.
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.