KFbxSdkManager Class Reference

#include <kfbxsdkmanager.h>

List of all members.


Detailed Description

SDK object manager The SDK manager is in charge of:

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 a set of specialized scene elements.

Definition at line 142 of file kfbxsdkmanager.h.

Error Management

enum  EError {
  eOBJECT_NOT_FOUND,
  eNAME_ALREADY_IN_USE,
  eERROR_COUNT
}
 Error codes. More...
KError & GetError ()
 Retrieve error object.
EError GetLastErrorID ()
 Get last error code.
char * GetLastErrorString ()
 Get last error string.

Memory Management.

static bool SetMemoryAllocator (KFbxMemoryAllocator *pMemoryAllocator)
 SDK Memory management Use this method to specify custom memory management routines.

FBX SDK Manager creation/destruction.

static KFbxSdkManager * CreateKFbxSdkManager ()
 SDK manager allocation method.
virtual void DestroyKFbxSdkManager ()
 Destructor.

plug and object definition and management

template<typename T1, typename T2>
kFbxClassId RegisterClass (char const *pName, T1 const *pFBX_TYPE_Class, T2 const *pFBX_TYPE_ParentClass, const char *pFbxFileTypeName=0, const char *pFbxFileSubTypeName=0)
 Class registration.
template<typename T>
kFbxClassId RegisterRuntimeClass (char const *pName, T const *pFBX_TYPE_ParentClass, const char *pFbxFileTypeName=0, const char *pFbxFileSubTypeName=0)
 Class registration.
template<typename T1, typename T2>
kFbxClassId OverrideClass (T1 const *pFBX_TYPE_Class, T2 const *pFBX_TYPE_OverridenClass)
 Class registration.
KFbxPlug * CreateClass (kFbxClassId, char const *pName)
 Class registration.
kFbxClassId FindClass (char const *pClassName)
 Class registration.
kFbxClassId FindFbxFileClass (const char *pFbxFileTypeName, const char *pFbxFileSubTypeName)
 Class registration.

General Object Connection and Relationship Management

int GetSrcObjectCount (kFbxClassId pClassId)
 Get the number of objects of class pClassId.
int GetSrcObjectCount ()
 Get the number of objects of class pClassId.
template<class T>
int GetSrcObjectCount (T const *pFBX_TYPE)
 Get the number of objects of class pClassId.
KFbxObject * GetSrcObject (kFbxClassId pClassId, int pIndex=0)
 Get the [i]th object of class pClassId.
KFbxObject * GetSrcObject (int pIndex=0)
 Get the number of objects of class pClassId.
template<class T>
T * GetSrcObject (T const *pFBX_TYPE, int pIndex=0)
 Get the number of objects of class pClassId.
KFbxObject * FindSrcObject (kFbxClassId pClassId, const char *pName, int pStartIndex=0)
 Find the object of class pClassId that has the name pName.
KFbxObject * FindSrcObject (const char *pName, int pStartIndex=0)
 Get the number of objects of class pClassId.
template<class T>
T * FindSrcObject (T const *pFBX_TYPE, const char *pName, int pStartIndex=0)
 Get the number of objects of class pClassId.

datatype management

KFbxDataType CreateFbxDataType (char *pName, EFbxType pType)
 Register a new datatype to the manager.
KFbxDataType const & GetFbxDataTypeFromName (char *pDataType)
 Finds a datatype.

Depricated Object Creation

Create specific object of class X (X must derive from KFbxPlug), These functions are deprecated please use Object::Create instead This section contains creation methods for the different objects of the FBX SDK.

Objects of the FBX SDK can be derived. The derived object can be properly created by overwritting the corresponding virtual allocator routine. See the protected section below.

K_DEPRECATED KFbxScene * CreateKFbxScene ()
K_DEPRECATED KFbxNode * CreateKFbxNode (char const *pName)
K_DEPRECATED KFbxNull * CreateKFbxNull ()
K_DEPRECATED KFbxMarker * CreateKFbxMarker ()
K_DEPRECATED KFbxCamera * CreateKFbxCamera ()
K_DEPRECATED KFbxLight * CreateKFbxLight ()
K_DEPRECATED KFbxSkeleton * CreateKFbxSkeleton ()
K_DEPRECATED KFbxMesh * CreateKFbxMesh (char const *pName="")
K_DEPRECATED KFbxPatch * CreateKFbxPatch (char const *pName="")
K_DEPRECATED KFbxNurb * CreateKFbxNurb (char const *pName="")
K_DEPRECATED KFbxNurbsSurface * CreateKFbxNurbsSurface (char const *pName="")
K_DEPRECATED KFbxNurbsCurve * CreateKFbxNurbsCurve (char const *pName="")
K_DEPRECATED KFbxTrimNurbsSurface * CreateKFbxTrimNurbsSurface (char const *pName="")
K_DEPRECATED KFbxBoundary * CreateKFbxBoundary (char const *pName="")
K_DEPRECATED KFbxGeometryWeightedMap * CreateKFbxGeometryWeightedMap (char const *pName="")
K_DEPRECATED KFbxOpticalReference * CreateKFbxOpticalReference ()
K_DEPRECATED KFbxLink * CreateKFbxLink ()
K_DEPRECATED KFbxSurfaceMaterial * CreateKFbxSurfaceMaterial (char const *pName)
K_DEPRECATED KFbxShape * CreateKFbxShape ()
K_DEPRECATED KFbxTexture * CreateKFbxTexture (char const *pName)
K_DEPRECATED KFbxVideo * CreateKFbxVideo (char const *pName)
K_DEPRECATED KFbxPose * CreateKFbxPose (char const *pName, bool pIsBindPose)
K_DEPRECATED KFbxGenericNode * CreateKFbxGenericNode (char const *pName)
K_DEPRECATED KFbxSkin * CreateKFbxSkin (char const *pName)
K_DEPRECATED KFbxCluster * CreateKFbxCluster (char const *pName)
K_DEPRECATED KFbxThumbnail * CreateKFbxThumbnail ()
K_DEPRECATED KFbxSceneInfo * CreateKFbxSceneInfo ()
K_DEPRECATED KFbxGeometryConverter * CreateKFbxGeometryConverter ()
K_DEPRECATED KFbxImageConverter * CreateKFbxImageConverter ()
K_DEPRECATED KFbxExporter * CreateKFbxExporter ()
K_DEPRECATED KFbxImporter * CreateKFbxImporter ()
K_DEPRECATED KFbxConstraint * CreateKFbxConstraint (char const *pName, int pType)
K_DEPRECATED KFbxCharacter * CreateKFbxCharacter (char const *pName)
K_DEPRECATED KFbxCharacterPose * CreateKFbxCharacterPose (char const *pName)
K_DEPRECATED KFbxControlSetPlug * CreateKFbxControlSetPlug (char const *pName)
virtual KFbxUserNotification * AllocateKFbxUserNotification (const KString &pLogFileName, const KString &pSessionDescription)
KFbxUserNotification * CreateKFbxUserNotification (const KString &pLogFileName, const KString &pSessionDescription)

Deprecated Object Destruction

Destroy and deallocate specific object of class X (X must derive from KFbxPlug), These functions are deprecated please use Object->Destroy() instead

virtual K_DEPRECATED bool DestroyKFbxScene (KFbxScene *pScene, bool pDestroyContent=true)
virtual K_DEPRECATED bool DestroyKFbxNode (KFbxNode *pNode, bool pDestroyContent=true)
virtual K_DEPRECATED bool DestroyKFbxNodeAttribute (KFbxNodeAttribute *pNodeAttribute)
virtual K_DEPRECATED bool DestroyKFbxGeometryWeightedMap (KFbxGeometryWeightedMap *pGeometryWeightedMap)
virtual K_DEPRECATED bool DestroyKFbxLink (KFbxLink *pLink)
virtual K_DEPRECATED bool DestroyKFbxSurfaceMaterial (KFbxSurfaceMaterial *pMaterial)
virtual K_DEPRECATED bool DestroyKFbxShape (KFbxShape *pShape)
virtual K_DEPRECATED bool DestroyKFbxTexture (KFbxTexture *pTexture)
virtual K_DEPRECATED bool DestroyKFbxVideo (KFbxVideo *pVideo)
virtual K_DEPRECATED bool DestroyKFbxPose (KFbxPose *pPose)
virtual K_DEPRECATED bool DestroyKFbxGenericNode (KFbxGenericNode *pGenericNode)
virtual K_DEPRECATED bool DestroyKFbxDeformer (KFbxDeformer *pDeformer)
virtual K_DEPRECATED bool DestroyKFbxSubDeformer (KFbxSubDeformer *pSubDeformer)
virtual K_DEPRECATED bool DestroyKFbxThumbnail (KFbxThumbnail *pThumbnail)
virtual K_DEPRECATED bool DestroyKFbxSceneInfo (KFbxSceneInfo *pSceneInfo)
K_DEPRECATED bool DestroyKFbxGeometryConverter (KFbxGeometryConverter *pConverter)
K_DEPRECATED bool DestroyKFbxImageConverter (KFbxImageConverter *pConverter)
K_DEPRECATED bool DestroyKFbxExporter (KFbxExporter *pExporter)
K_DEPRECATED bool DestroyKFbxImporter (KFbxImporter *pImporter)
K_DEPRECATED bool DestroyKFbxConstraint (KFbxConstraint *pConstraint)
K_DEPRECATED bool DestroyKFbxCharacter (KFbxCharacter *pCharacter)
K_DEPRECATED bool DestroyKFbxCharacterPose (KFbxCharacterPose *pCharacterPose)
K_DEPRECATED bool DestroyKFbxControlSetPlug (KFbxControlSetPlug *pControlSetPlug)
virtual bool DestroyKFbxUserNotification ()

Deprecated Object Search

Replaced by FindObjectSrc

virtual K_DEPRECATED KFbxNode * FindKFbxNode (char const *pName, int pIndex=0)
virtual K_DEPRECATED KFbxSurfaceMaterial * FindKFbxSurfaceMaterial (char const *pName, int pIndex=0)
virtual K_DEPRECATED KFbxTexture * FindKFbxTexture (char const *pName, int pIndex=0)
virtual K_DEPRECATED KFbxVideo * FindKFbxVideo (char const *pName, int pIndex=0)
virtual K_DEPRECATED KFbxPose * FindKFbxPose (char const *pName, int pIndex=0)
virtual K_DEPRECATED KFbxGenericNode * FindKFbxGenericNode (char const *pName, int pIndex=0)

Deprecated Access to object Object Count

Replaced by GetObjectSrcCount and GetObjectSrc

K_DEPRECATED int GetKFbxNodeCount ()
K_DEPRECATED KFbxNode * GetKFbxNode (int pIndex)
K_DEPRECATED int GetKFbxGenericNodeCount ()
K_DEPRECATED KFbxGenericNode * GetKFbxGenericNode (int pIndex)
K_DEPRECATED int GetKFbxSurfaceMaterialCount ()
K_DEPRECATED KFbxSurfaceMaterial * GetKFbxSurfaceMaterial (int pIndex)
K_DEPRECATED int GetKFbxTextureCount ()
K_DEPRECATED KFbxTexture * GetKFbxTexture (int pIndex)
K_DEPRECATED int GetKFbxVideoCount ()
K_DEPRECATED KFbxVideo * GetKFbxVideo (int pIndex)
K_DEPRECATED int GetKFbxPoseCount ()
K_DEPRECATED KFbxPose * GetKFbxPose (int pIndex)
K_DEPRECATED int GetKFbxLinkCount ()
K_DEPRECATED KFbxLink * GetKFbxLink (int pIndex)
K_DEPRECATED int GetKFbxConstraintCount ()
K_DEPRECATED int GetKFbxConstraintCount (int pType)
K_DEPRECATED KFbxConstraint * GetKFbxConstraint (int pIndex, int pType)
K_DEPRECATED int GetKFbxCharacterCount ()
K_DEPRECATED KFbxCharacter * GetKFbxCharacter (int pIndex)
K_DEPRECATED int GetKFbxCharacterPoseCount ()
K_DEPRECATED KFbxCharacterPose * GetKFbxCharacterPose (int pIndex)
K_DEPRECATED int GetKFbxControlSetPlugCount ()
K_DEPRECATED KFbxControlSetPlug * GetKFbxControlSetPlug (int pIndex)
K_DEPRECATED int GetKFbxGeometryWeightedMapCount ()
K_DEPRECATED KFbxGeometryWeightedMap * GetKFbxGeometryWeightedMap (int pIndex)
K_DEPRECATED int GetKFbxSceneCount ()
K_DEPRECATED KFbxScene * GetKFbxScene (int pIndex)
KFbxUserNotification * GetUserNotification ()
 Access to the unique UserNotification object.

Static Public Member Functions

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


Member Enumeration Documentation

enum EError

Error codes.

Enumerator:
eOBJECT_NOT_FOUND  The requested object was not found in the Manager's database.

eNAME_ALREADY_IN_USE  A name clash occurred.

eERROR_COUNT  Mark the end of the error enum.

Definition at line 258 of file kfbxsdkmanager.h.


Member Function Documentation

static bool SetMemoryAllocator ( KFbxMemoryAllocator *  pMemoryAllocator  )  [static]

SDK Memory management Use this method to specify custom memory management routines.

The FBX SDK will use the provided routines to allocate and deallocate memory.

Remarks:
Important: If you plan to specify custom memory management routines, you must do so BEFORE creating the first SDK manager. Those routines are global and thus shared between different instances of SDK managers.

static KFbxSdkManager* CreateKFbxSdkManager (  )  [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.

virtual void DestroyKFbxSdkManager (  )  [virtual]

Destructor.

Deallocates all object previously created by the SDK manager.

kFbxClassId RegisterClass ( char const *  pName,
T1 const *  pFBX_TYPE_Class,
T2 const *  pFBX_TYPE_ParentClass,
const char *  pFbxFileTypeName = 0,
const char *  pFbxFileSubTypeName = 0 
) [inline]

Class registration.

Parameters:
pFBX_TYPE_Class 
pFBX_TYPE_ParentClass 
pName 
pFbxFileTypeName 
pFbxFileSubTypeName 
Returns:
The class Id of the newly register class

Definition at line 194 of file kfbxsdkmanager.h.

kFbxClassId RegisterRuntimeClass ( char const *  pName,
T const *  pFBX_TYPE_ParentClass,
const char *  pFbxFileTypeName = 0,
const char *  pFbxFileSubTypeName = 0 
) [inline]

Class registration.

Parameters:
pFBX_TYPE_Class 
pFBX_TYPE_ParentClass 
pName 
pFbxFileTypeName 
pFbxFileSubTypeName 
Returns:
The class Id of the newly register class

Definition at line 201 of file kfbxsdkmanager.h.

kFbxClassId OverrideClass ( T1 const *  pFBX_TYPE_Class,
T2 const *  pFBX_TYPE_OverridenClass 
) [inline]

Class registration.

Parameters:
pFBX_TYPE_Class 
pFBX_TYPE_ParentClass 
pName 
pFbxFileTypeName 
pFbxFileSubTypeName 
Returns:
The class Id of the newly register class

Definition at line 205 of file kfbxsdkmanager.h.

KFbxPlug* CreateClass ( kFbxClassId  ,
char const *  pName 
)

Class registration.

Parameters:
pFBX_TYPE_Class 
pFBX_TYPE_ParentClass 
pName 
pFbxFileTypeName 
pFbxFileSubTypeName 
Returns:
The class Id of the newly register class

kFbxClassId FindClass ( char const *  pClassName  ) 

Class registration.

Parameters:
pFBX_TYPE_Class 
pFBX_TYPE_ParentClass 
pName 
pFbxFileTypeName 
pFbxFileSubTypeName 
Returns:
The class Id of the newly register class

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

Class registration.

Parameters:
pFBX_TYPE_Class 
pFBX_TYPE_ParentClass 
pName 
pFbxFileTypeName 
pFbxFileSubTypeName 
Returns:
The class Id of the newly register class

int GetSrcObjectCount ( kFbxClassId  pClassId  ) 

Get the number of objects of class pClassId.

Returns:
Return the number of pClassId objects owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Referenced by KFbxGetSrcCount().

int GetSrcObjectCount (  )  [inline]

Get the number of objects of class pClassId.

Returns:
Return the number of pClassId objects owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Definition at line 226 of file kfbxsdkmanager.h.

int GetSrcObjectCount ( T const *  pFBX_TYPE  )  [inline]

Get the number of objects of class pClassId.

Returns:
Return the number of pClassId objects owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Definition at line 227 of file kfbxsdkmanager.h.

KFbxObject* GetSrcObject ( kFbxClassId  pClassId,
int  pIndex = 0 
)

Get the [i]th object of class pClassId.

Returns:
Return the pointer to the object owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Referenced by KFbxGetSrc().

KFbxObject* GetSrcObject ( int  pIndex = 0  )  [inline]

Get the number of objects of class pClassId.

Returns:
Return the number of pClassId objects owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Definition at line 233 of file kfbxsdkmanager.h.

T* GetSrcObject ( T const *  pFBX_TYPE,
int  pIndex = 0 
) [inline]

Get the number of objects of class pClassId.

Returns:
Return the number of pClassId objects owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Definition at line 234 of file kfbxsdkmanager.h.

KFbxObject* FindSrcObject ( kFbxClassId  pClassId,
const char *  pName,
int  pStartIndex = 0 
)

Find the object of class pClassId that has the name pName.

Parameters:
pName Name of the node.
pStartIndex Zero based index specifiyng where the search begins
Returns:
Return the pointer to the object owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Referenced by KFbxFindSrc().

KFbxObject* FindSrcObject ( const char *  pName,
int  pStartIndex = 0 
) [inline]

Get the number of objects of class pClassId.

Returns:
Return the number of pClassId objects owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Definition at line 242 of file kfbxsdkmanager.h.

T* FindSrcObject ( T const *  pFBX_TYPE,
const char *  pName,
int  pStartIndex = 0 
) [inline]

Get the number of objects of class pClassId.

Returns:
Return the number of pClassId objects owned by the manager.
Remarks:
the class id can be optained by calling <Class>Classid

Definition at line 243 of file kfbxsdkmanager.h.

KError& GetError (  ) 

Retrieve error object.

Returns:
Reference to the Manager's error object.

EError GetLastErrorID (  ) 

Get last error code.

Returns:
Last error code.

char* GetLastErrorString (  ) 

Get last error string.

Returns:
Textual description of the last error.

static KString PrefixName ( char const *  pPrefix,
char const *  pName 
) [static]

Add a prefix to a name.

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

KFbxDataType CreateFbxDataType ( char *  pName,
EFbxType  pType 
)

Register a new datatype to the manager.

Returns:
true if it success

KFbxDataType const& GetFbxDataTypeFromName ( char *  pDataType  ) 

Finds a datatype.

Returns:
the found datatype. return null if not found

KFbxUserNotification* GetUserNotification (  ) 

Access to the unique UserNotification object.

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