FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxManager Class Reference

#include <fbxmanager.h>

Class Description

SDK object manager.

The SDK manager is in charge of:

It is possible to override memory allocation functions throughout the FBX SDK by providing system memory allocation functions using the handler set functions below. It must be done before the first FbxManager creation.

FbxSetMallocHandler(); FbxSetCallocHandler(); FbxSetReallocHandler(); FbxSetFreeHandler();

Upon destruction, all objects allocated by the SDK manager and not explicitly destroyed are destroyed as well. A derived class can be defined to allocate and deallocate specialized scene elements.

Remarks
You could create more than one SDK manager. However, it's better to NOT share the same object among different managers.
Examples:
Animation/main.cxx, Audio/main.cxx, Camera/main.cxx, Common/Common.cxx, Common/Common.h, ConvertScene/main.cxx, ExportDocument/main.cxx, ExportScene01/main.cxx, ExportScene02/main.cxx, ExportScene03/main.cxx, ExportScene04/main.cxx, ExportScene05/main.cxx, ExportShader/main.cxx, FileStream/main.cxx, ImportScene/main.cxx, Instances/main.cxx, Layers/main.cxx, MyOwnWriterReader/MyOwnReader.cxx, MyOwnWriterReader/MyOwnReader.h, MyOwnWriterReader/MyOwnWriter.cxx, MyOwnWriterReader/MyOwnWriter.h, MyOwnWriterReader/MyOwnWriterReader.cxx, MyOwnWriterReader/MyOwnWriterReader.h, Normals/main.cxx, Pivot/main.cxx, ProceduralTexture/main.cxx, StereoCamera/main.cxx, SwitchBinding/main.cxx, Transformations/main.cxx, UserProperties/main.cxx, UVSample/main.cxx, and ViewScene/SceneContext.h.

Definition at line 56 of file fbxmanager.h.

Public Member Functions

int GetDocumentCount ()
 Get the count of document available in this manager. More...
 
FbxDocumentGetDocument (int pIndex)
 Get the document at pIndex in the manager's list. More...
 

Static Public Member Functions

static FbxString PrefixName (const char *pPrefix, const char *pName)
 Add a prefix to a name. More...
 

FBX SDK Manager Creation/Destruction

static FbxManagerCreate ()
 SDK manager allocation method. More...
 
virtual void Destroy ()
 Destructor. More...
 

Versions Queries

static const char * GetVersion (bool pFull=true)
 Get FBX SDK version string. More...
 
static void GetFileFormatVersion (int &pMajor, int &pMinor, int &pRevision)
 Get the current default FBX file format version number for this version of the FBX SDK. More...
 

Object Registration, Definition and Management

template<typename T1 , typename T2 >
FbxClassId RegisterFbxClass (const char *pName, const T1 *, const T2 *, const char *pFbxFileTypeName=0, const char *pFbxFileSubTypeName=0)
 Class registration. More...
 
template<typename T >
FbxClassId RegisterRuntimeFbxClass (const char *pName, const T *, const char *pFbxFileTypeName=0, const char *pFbxFileSubTypeName=0)
 Runtime class registration. More...
 
void UnregisterRuntimeFbxClass (const char *pName)
 Runtime class unregistration. More...
 
template<typename T1 , typename T2 >
FbxClassId OverrideFbxClass (const T1 *pFBX_TYPE_Class, const T2 *pFBX_TYPE_OverridenClass)
 Override class. More...
 
FbxObjectCreateNewObjectFromClassId (FbxClassId pClassId, const char *pName, FbxObject *pContainer=((void *) 0), const FbxObject *pCloneFrom=((void *) 0))
 Create a new object of the specified ClassId. More...
 
FbxClassId FindClass (const char *pClassName) const
 Find class by the specified name. More...
 
FbxClassId FindFbxFileClass (const char *pFbxFileTypeName, const char *pFbxFileSubTypeName) const
 Find file class. More...
 
template<typename T >
void UnregisterFbxClass (const T *pFBX_TYPE_Class)
 Class unregistration. More...
 

Data Type Management

FbxDataType CreateDataType (const char *pName, const EFbxType pType)
 Register a new data type to the manager. More...
 
int GetDataTypeCount () const
 List the data types. More...
 
FbxDataTypeGetDataType (const int pIndex) const
 Find a data types at pIndex. More...
 
FbxDataTypeGetDataTypeFromName (const char *pDataType) const
 Find a data type from the type name. More...
 

User Notification Object

FbxUserNotificationGetUserNotification () const
 Access to the unique UserNotification object. More...
 
void SetUserNotification (FbxUserNotification *pUN)
 Set the user notification. More...
 

IOSettings Object

virtual FbxIOSettingsGetIOSettings () const
 Access to a IOSettings object. More...
 
virtual void SetIOSettings (FbxIOSettings *pIOSettings)
 Set the IOSettings pointer. More...
 

Message Emitter (for Message Logging)

FbxMessageEmitter & GetMessageEmitter ()
 Access to the unique FbxMessageEmitter object. More...
 
bool SetMessageEmitter (FbxMessageEmitter *pMessageEmitter)
 Sets to the unique FbxMessageEmitter object. More...
 

Localization Hierarchy

void AddLocalization (FbxLocalizationManager *pLocManager)
 Add a localization object to the known localization providers. More...
 
void RemoveLocalization (FbxLocalizationManager *pLocManager)
 Remove a localization object from the known localization providers. More...
 
bool SetLocale (const char *pLocale)
 Select the current locale for localization. More...
 
const char * Localize (const char *pID, const char *pDefault=((void *) 0)) const
 Localization helper function. More...
 

XRef Manager

FbxXRefManagerGetXRefManager ()
 Retrieve the manager responsible for managing object XRef resolution. More...
 

Library Management

FbxLibraryGetRootLibrary () const
 Retrieve the main object Libraries. More...
 
FbxLibraryGetSystemLibraries () const
 
FbxLibraryGetUserLibraries () const
 

Plug-in Registry Object

FbxIOPluginRegistryGetIOPluginRegistry () const
 Access to the unique FbxIOPluginRegistry object. More...
 

Fbx Generic Plugins Management

bool LoadPluginsDirectory (const char *pFilename, const char *pExtensions=((void *) 0))
 Load plug-ins directory. More...
 
bool LoadPlugin (const char *pFilename)
 Load plug-in. More...
 
bool UnloadPlugins ()
 Unload all plug-ins. More...
 
bool EmitPluginsEvent (const FbxEventBase &pEvent)
 Emit plugins event. More...
 
FbxArray< const FbxPlugin * > GetPlugins () const
 Get plugins. More...
 
int GetPluginCount () const
 get plugins count More...
 
FbxPluginFindPlugin (const char *pName, const char *pVersion) const
 Find plug in. More...
 

IO Settings

void FillIOSettingsForReadersRegistered (FbxIOSettings &pIOS)
 Fill IO Settings for registered readers. More...
 
void FillIOSettingsForWritersRegistered (FbxIOSettings &pIOS)
 Fill IO Settings for registered writers. More...
 
void FillCommonIOSettings (FbxIOSettings &pIOS, bool pImport)
 Fill common IO Settings. More...
 

Global Object Management

void RegisterObject (FbxObject *pObject)
 Register object with the manager. More...
 
void UnregisterObject (FbxObject *pObject)
 Unregister object with the manager. More...
 
void RegisterObjects (const FbxArray< FbxObject *> &pArray)
 Register a list of objects with the manager. More...
 
void UnregisterObjects (const FbxArray< FbxObject *> &pArray)
 Unregister a list of objects with the manager. More...
 
void IncreaseDestroyingSceneFlag ()
 Increment the scene destroying counter. More...
 
void DecreaseDestroyingSceneFlag ()
 Shrink the object list and decrements the scene destroying counter. More...
 

Reference Management

int GetReferenceCount () const
 Get number of references. More...
 
FbxSceneReferenceGetReference (int pIndex) const
 Get reference at given index. More...
 
int AddReference (FbxSceneReference *pReference)
 Add a reference. More...
 
bool RemoveReference (FbxSceneReference *pReference)
 Remove the specified reference from reference list. More...
 
bool ClearReference (FbxSceneReference *pReference)
 Clear the specified reference from the SDK manager. More...
 

Member Function Documentation

◆ Create()

static FbxManager* Create ( )
static

SDK manager allocation method.

Returns
A pointer to the SDK manager or NULL if this is an evaluation copy of the FBX SDK and it is expired.
Examples:
Common/Common.cxx, ExportDocument/main.cxx, and FileStream/main.cxx.

◆ Destroy()

virtual void Destroy ( )
virtual

Destructor.

Deallocates all object previously created by the SDK manager.

Examples:
Common/Common.cxx, and ExportDocument/main.cxx.

◆ GetVersion()

static const char* GetVersion ( bool  pFull = true)
static

Get FBX SDK version string.

Parameters
pFullIf true, the complete version string including revision number and release date will be returned, otherwise only the version numbering is returned.
Examples:
Common/Common.cxx, and ExportDocument/main.cxx.

◆ GetFileFormatVersion()

static void GetFileFormatVersion ( int &  pMajor,
int &  pMinor,
int &  pRevision 
)
static

Get the current default FBX file format version number for this version of the FBX SDK.

Parameters
pMajorVersion major number.
pMinorVersion minor number.
pRevisionVersion revision number.
Examples:
Common/Common.cxx, and ExportDocument/main.cxx.

◆ RegisterFbxClass()

FbxClassId RegisterFbxClass ( const char *  pName,
const T1 *  ,
const T2 *  ,
const char *  pFbxFileTypeName = 0,
const char *  pFbxFileSubTypeName = 0 
)
inline

Class registration.

Parameters
pNameThe class name. For example, "FbxMesh" for FbxMesh class.
T1FBX type of the specified class.
T2FBX type of parent class.
pFbxFileTypeNameThe type name of the class in FBX file.
pFbxFileSubTypeNameThe sub type name of the class in FBX file.
Returns
The class Id of the newly register class. Such as:
Examples:
ExportScene03/main.cxx.

Definition at line 108 of file fbxmanager.h.

109  {
110  T1::ClassId = Internal_RegisterFbxClass(pName, T2::ClassId, (FbxObjectCreateProc)T1::Allocate, pFbxFileTypeName, pFbxFileSubTypeName);
111  return T1::ClassId;
112  }
FbxObject *(* FbxObjectCreateProc)(FbxManager &pManager, const char *pName, const FbxObject *pFrom)
The function pointer type for object constructor functions.
Definition: fbxclassid.h:26

◆ RegisterRuntimeFbxClass()

FbxClassId RegisterRuntimeFbxClass ( const char *  pName,
const T *  ,
const char *  pFbxFileTypeName = 0,
const char *  pFbxFileSubTypeName = 0 
)
inline

Runtime class registration.

Parameters
pNameThe class name. For example, "FbxUIWidgetBoolean".
TFBX type of parent class.
pFbxFileTypeNameThe type name of the class in FBX file.
pFbxFileSubTypeNameThe sub type name of the class in FBX file.
Returns
The class Id of the newly register class. Such as:
RegisterRuntimeFbxClass( "FbxUIWidgetBoolean", FBX_TYPE(FbxUIWidgetDefinition), NULL, "FbxUIWidgetBoolean");

Definition at line 123 of file fbxmanager.h.

124  {
125  return Internal_RegisterFbxClass(pName, T::ClassId, (FbxObjectCreateProc)T::Allocate, pFbxFileTypeName, pFbxFileSubTypeName);
126  }
FbxObject *(* FbxObjectCreateProc)(FbxManager &pManager, const char *pName, const FbxObject *pFrom)
The function pointer type for object constructor functions.
Definition: fbxclassid.h:26

◆ UnregisterRuntimeFbxClass()

void UnregisterRuntimeFbxClass ( const char *  pName)
inline

Runtime class unregistration.

Parameters
pNameThe class name.

Definition at line 131 of file fbxmanager.h.

132  {
133  FbxClassId lClassId = FindClass(pName);
134  if( !(lClassId == FbxClassId()) )
135  {
136  Internal_UnregisterFbxClass(lClassId);
137  }
138  }
FbxClassId FindClass(const char *pClassName) const
Find class by the specified name.
Internal class used to differentiate objects during run-time.
Definition: fbxclassid.h:39

◆ OverrideFbxClass()

FbxClassId OverrideFbxClass ( const T1 *  pFBX_TYPE_Class,
const T2 *  pFBX_TYPE_OverridenClass 
)
inline

Override class.

Parameters
pFBX_TYPE_ClassFBX type of class.
pFBX_TYPE_OverridenClassFBX type of overridden class.
Returns
The class Id

Definition at line 145 of file fbxmanager.h.

146  {
147  T1::ClassId = Internal_OverrideFbxClass(T2::ClassId,(FbxObjectCreateProc)T1::Allocate );
148  return T1::ClassId;
149  }
FbxObject *(* FbxObjectCreateProc)(FbxManager &pManager, const char *pName, const FbxObject *pFrom)
The function pointer type for object constructor functions.
Definition: fbxclassid.h:26

◆ CreateNewObjectFromClassId()

FbxObject* CreateNewObjectFromClassId ( FbxClassId  pClassId,
const char *  pName,
FbxObject pContainer = ((void *) 0),
const FbxObject pCloneFrom = ((void *) 0) 
)

Create a new object of the specified ClassId.

Parameters
pClassIdThe ClassId of the object to be created.
pNameThe name given to the newly created object.
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.
pCloneFromA valid object pointer to use as the reference for cloning the object upon construction.
Returns
If not null, a new instance of the specified class.
Remarks
This function will return NULL if the ClassId used is invalid. New ClassId can be registered using the function RegisterFbxClass().

◆ FindClass()

FbxClassId FindClass ( const char *  pClassName) const

Find class by the specified name.

Parameters
pClassNameClass Name to find.

◆ FindFbxFileClass()

FbxClassId FindFbxFileClass ( const char *  pFbxFileTypeName,
const char *  pFbxFileSubTypeName 
) const

Find file class.

Parameters
pFbxFileTypeNameSpecify the type name in FBX file to find.
pFbxFileSubTypeNameSpecify by The sub type name in FBX file to find.

◆ UnregisterFbxClass()

void UnregisterFbxClass ( const T *  pFBX_TYPE_Class)
inline

Class unregistration.

Parameters
pFBX_TYPE_ClassFBX type of unregistered class.

Definition at line 177 of file fbxmanager.h.

178  {
179  Internal_UnregisterFbxClass(T::ClassId);
180  T::ClassId = FbxClassId();
181  }
Internal class used to differentiate objects during run-time.
Definition: fbxclassid.h:39

◆ CreateDataType()

FbxDataType CreateDataType ( const char *  pName,
const EFbxType  pType 
)

Register a new data type to the manager.

Parameters
pNameThe type name.
pTypeThe data type.
Returns
The newly created FbxDataType

◆ GetDataTypeCount()

int GetDataTypeCount ( ) const

List the data types.

Returns
the number of registered datatypes

◆ GetDataType()

FbxDataType& GetDataType ( const int  pIndex) const

Find a data types at pIndex.

Parameters
pIndexThe data type index.
Returns
the found datatype. return null if not found

◆ GetDataTypeFromName()

FbxDataType& GetDataTypeFromName ( const char *  pDataType) const

Find a data type from the type name.

Parameters
pDataTypeThe type name.
Returns
the found datatype. return null if not found

◆ GetUserNotification()

FbxUserNotification* GetUserNotification ( ) const

Access to the unique UserNotification object.

Returns
The pointer to the user notification or NULL if the object has not been allocated.

◆ SetUserNotification()

void SetUserNotification ( FbxUserNotification pUN)

Set the user notification.

Parameters
pUN

◆ GetIOSettings()

virtual FbxIOSettings* GetIOSettings ( ) const
virtual

Access to a IOSettings object.

Returns
The pointer to IOSettings or NULL if the object has not been allocated.
Examples:
Common/Common.cxx, ConvertScene/main.cxx, ExportDocument/main.cxx, and ExportScene05/main.cxx.

◆ SetIOSettings()

virtual void SetIOSettings ( FbxIOSettings pIOSettings)
virtual

Set the IOSettings pointer.

Parameters
pIOSettings
Examples:
Common/Common.cxx, and ExportDocument/main.cxx.

◆ GetMessageEmitter()

FbxMessageEmitter& GetMessageEmitter ( )

Access to the unique FbxMessageEmitter object.

Returns
The pointer to the message emitter.

◆ SetMessageEmitter()

bool SetMessageEmitter ( FbxMessageEmitter *  pMessageEmitter)

Sets to the unique FbxMessageEmitter object.

Parameters
pMessageEmitterthe emitter to use, passing NULL will reset to the default emitter. The object will be deleted when the SDK manager is destroyed, thus ownership is transfered.

◆ AddLocalization()

void AddLocalization ( FbxLocalizationManager *  pLocManager)

Add a localization object to the known localization providers.

Parameters
pLocManagerthe localization object to register.

◆ RemoveLocalization()

void RemoveLocalization ( FbxLocalizationManager *  pLocManager)

Remove a localization object from the known localization providers.

Parameters
pLocManagerthe localization object to remove.

◆ SetLocale()

bool SetLocale ( const char *  pLocale)

Select the current locale for localization.

Parameters
pLocalethe locale name, for example "fr" or "en-US".

◆ Localize()

const char* Localize ( const char *  pID,
const char *  pDefault = ((void *) 0) 
) const

Localization helper function.

Calls each registered localization manager until one can localizes the text.

Parameters
pIDthe identifier for the text to localize.
pDefaultthe default text. Uses pID if NULL.
Returns
the potentially localized text. May return the parameter passed in.

◆ GetXRefManager()

FbxXRefManager& GetXRefManager ( )

Retrieve the manager responsible for managing object XRef resolution.

Returns
The XRef manager for this SDK manager.

◆ GetRootLibrary()

FbxLibrary* GetRootLibrary ( ) const

Retrieve the main object Libraries.

Returns
The Root library

◆ GetSystemLibraries()

FbxLibrary* GetSystemLibraries ( ) const

◆ GetUserLibraries()

FbxLibrary* GetUserLibraries ( ) const

◆ GetIOPluginRegistry()

◆ LoadPluginsDirectory()

bool LoadPluginsDirectory ( const char *  pFilename,
const char *  pExtensions = ((void *) 0) 
)

Load plug-ins directory.

Parameters
pFilenameThe directory path.
pExtensionsThe plug in extension.
Returns
True
Examples:
Common/Common.cxx.

◆ LoadPlugin()

bool LoadPlugin ( const char *  pFilename)

Load plug-in.

Parameters
pFilenameThe file name
Returns
True

◆ UnloadPlugins()

bool UnloadPlugins ( )

Unload all plug-ins.

◆ EmitPluginsEvent()

bool EmitPluginsEvent ( const FbxEventBase pEvent)

Emit plugins event.

Parameters
pEventThe event to be emitted.

◆ GetPlugins()

FbxArray<const FbxPlugin*> GetPlugins ( ) const

Get plugins.

◆ GetPluginCount()

int GetPluginCount ( ) const

get plugins count

Returns
The number of plugins.

◆ FindPlugin()

FbxPlugin* FindPlugin ( const char *  pName,
const char *  pVersion 
) const

Find plug in.

Parameters
pNameThe plug in name.
pVersionThe plug in version.
Returns
The plugin, null if not found.

◆ FillIOSettingsForReadersRegistered()

void FillIOSettingsForReadersRegistered ( FbxIOSettings pIOS)

Fill IO Settings for registered readers.

Parameters
pIOSThe properties hierarchies to fill.

◆ FillIOSettingsForWritersRegistered()

void FillIOSettingsForWritersRegistered ( FbxIOSettings pIOS)

Fill IO Settings for registered writers.

Parameters
pIOSThe properties hierarchies to fill.

◆ FillCommonIOSettings()

void FillCommonIOSettings ( FbxIOSettings pIOS,
bool  pImport 
)

Fill common IO Settings.

Parameters
pIOSThe properties hierarchies to fill.
pImportIf true, import properties are set, otherwise export properties are set.

◆ RegisterObject()

void RegisterObject ( FbxObject pObject)

Register object with the manager.

Parameters
pObjectThe object to be registered.

◆ UnregisterObject()

void UnregisterObject ( FbxObject pObject)

Unregister object with the manager.

Parameters
pObjectThe object to be unregistered.

◆ RegisterObjects()

void RegisterObjects ( const FbxArray< FbxObject *> &  pArray)

Register a list of objects with the manager.

Parameters
pArrayThe list of object to be registered.

◆ UnregisterObjects()

void UnregisterObjects ( const FbxArray< FbxObject *> &  pArray)

Unregister a list of objects with the manager.

Parameters
pArrayThe list of object to be unregistered.

◆ IncreaseDestroyingSceneFlag()

void IncreaseDestroyingSceneFlag ( )

Increment the scene destroying counter.

Remarks
Call this function before the destroying list is changed.

◆ DecreaseDestroyingSceneFlag()

void DecreaseDestroyingSceneFlag ( )

Shrink the object list and decrements the scene destroying counter.

Remarks
Call this function after the destroying is changed. Use IncreasDestroyingSceneFlag() and DecreaseDestroyingSceneFlag() in pairs.

◆ GetReferenceCount()

int GetReferenceCount ( ) const

Get number of references.

Returns
Number of references.

◆ GetReference()

FbxSceneReference* GetReference ( int  pIndex) const

Get reference at given index.

Parameters
pIndexPosition in the list of references.
Returns
Pointer to the reference or NULL if index is out of bounds.

◆ AddReference()

int AddReference ( FbxSceneReference pReference)

Add a reference.

Parameters
pReferenceThe reference to be added.
Returns
If the reference is correctly added to the scene, return true otherwise, if the reference is already there, returns false.

◆ RemoveReference()

bool RemoveReference ( FbxSceneReference pReference)

Remove the specified reference from reference list.

Parameters
pReferenceThe reference to be removed.
Returns
If the reference was successfully removed, return true otherwise, if the reference could not be found returns false.

◆ ClearReference()

bool ClearReference ( FbxSceneReference pReference)

Clear the specified reference from the SDK manager.

Parameters
pReferenceThe reference to be removed.
Returns
If the reference was successfully cleared from the SDK manager, return true otherwise, if the reference could not be found returns false.

◆ PrefixName()

static FbxString PrefixName ( const char *  pPrefix,
const char *  pName 
)
static

Add a prefix to a name.

Parameters
pPrefixThe prefix to be added to the pName. This string must contain the "::" characters in order to be considered as a prefix.
pNameThe name to be prefix.
Returns
The prefixed string
Remarks
If a prefix already exists, it is removed before adding pPrefix.

◆ GetDocumentCount()

int GetDocumentCount ( )

Get the count of document available in this manager.

Returns
The count of document owned by this manager.

◆ GetDocument()

FbxDocument* GetDocument ( int  pIndex)

Get the document at pIndex in the manager's list.

Parameters
pIndexThe index of the document to retrieve.
Returns
The document at the specified index. Will return NULL if index is invalid.

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