This reference page is linked to from the following overview topics: Your First FBX SDK Program, Importing and Exporting a Scene, I/O Settings, Importing a Scene, FBX SDK Object Model, FBX Objects, List of Python Fbx classes.
Class to import an FBX file into SDK objects.
Normally this class is used as is. But for very special needs a user can override Initialize() for special purpose.
An importer will select the appropriate reader to a particular file. Ex: When an importer must import an FBX 7 file, the importer will ask for all registered readers if an FBX 7 file reader is available, then if a reader is found, the importer will create the specialized FBX 7 reader and read the file. This way, an importer can "read" many different type of files like FBX 5/6/7, 3DS, Obj, Dxf, Collada, etc.
Typical workflow for using the FbxImporter class:
ex: // create a SdkManager FbxManager *lSdkManager = FbxManager::Create(); // create an IOSettings object FbxIOSettings * ios = FbxIOSettings::Create(lSdkManager, IOSROOT ); // set some IOSettings options ios->SetBoolProp(IMP_FBX_MATERIAL, true); ios->SetBoolProp(IMP_FBX_TEXTURE, true); // create an empty scene FbxScene* lScene = FbxScene::Create(lSdkManager,""); // Create an importer. FbxImporter* lImporter = FbxImporter::Create(lSdkManager, ""); // Initialize the importer by providing a filename and the IOSettings to use lImporter->Initialize("C:\\myfile.fbx", -1, ios); // Import the scene. lImporter->Import(lScene); // Destroy the importer. lImporter->Destroy();
Definition at line 90 of file fbximporter.h.
#include <fbximporter.h>

Public Member Functions | |
| FbxFile * | GetFile () |
| FbxStream * | GetStream () |
| void * | GetStreamData () |
| void | ParseForGlobalSettings (bool pState) |
| void | ParseForStatistics (bool pState) |
| bool | GetAxisInfo (FbxAxisSystem *pAxisSystem, FbxSystemUnit *pSystemUnits) |
| bool | GetStatistics (FbxStatistics *pStatistics) |
| bool | GetFrameRate (FbxTime::EMode &pTimeMode) |
Protected Member Functions | |
| virtual void | Construct (const FbxImporter *pFrom) |
| virtual void | Destruct (bool pRecursive) |
| Optional destructor override, automatically called by default destructor. | |
| void | Reset () |
| bool | FileOpen (FbxFile *pFile=NULL) |
| bool | FileOpen (FbxStream *pStream, void *pStreamData) |
| void | FileClose () |
| void | GetImportOptionsInfo () |
| bool | IsNativeExtension () |
| bool | Initialize (FbxFile *pFile, const int pFileFormat=-1, FbxIOSettings *pIOSettings=NULL) |
| bool | Import (FbxDocument *pDocument, FbxIO *pFbxObject) |
Friends | |
| class | FbxReaderFbx5 |
| class | FbxReaderFbx6 |
| struct | FbxReaderFbx7_Impl |
| void | ImportThread (void *) |
Import Functions | |
| enum | EStreamOptionsGeneration { eParseFile, eDoNotParseFile } |
Stream options identifiers. More... | |
| virtual bool | Initialize (const char *pFileName, const int pFileFormat=-1, FbxIOSettings *pIOSettings=NULL) |
| Initialize object. | |
| virtual bool | Initialize (FbxStream *pStream, void *pStreamData=NULL, const int pFileFormat=-1, FbxIOSettings *pIOSettings=NULL) |
| Initialize object. | |
| void | GetFileVersion (int &pMajor, int &pMinor, int &pRevision) |
| Get the FBX version number of the FBX file. | |
| bool | GetDefaultRenderResolution (FbxString &pCamName, FbxString &pResolutionMode, double &pW, double &pH) |
| Get the default rendering resolution if present in the file header. | |
| FbxIOFileHeaderInfo * | GetFileHeaderInfo () |
| Get the complete file header information. | |
| bool | GetImportOptions (EStreamOptionsGeneration pStreamOptionsGeneration=eParseFile) |
| Read the currently opened file header to retrieve information related to takes. | |
| bool | GetImportOptions (FbxIO *pFbxObject) |
| Read the currently opened file header to retrieve information related to takes. | |
| bool | Import (FbxDocument *pDocument, bool pNonBlocking=false) |
| Import the currently opened file into a scene. | |
| bool | IsImporting (bool &pImportResult) |
| Check if the importer is currently importing. | |
| float | GetProgress (FbxString *pStatus=NULL) |
| Get the progress status in non-blocking mode. | |
| void | SetProgressCallback (FbxProgressCallback pCallback, void *pArgs=NULL) |
| Register a callback function for progress reporting in single thread mode. | |
| void | SetEmbeddingExtractionFolder (const char *pExtractFolder) |
| Explicitly set the embedding extraction folder. | |
| const char * | GetEmbeddingExtractionFolder () |
| Retrieve the current folder destination where the embedded files will be extracted. | |
| FbxIOSettings * | GetIOSettings () |
| Access to a IOSettings object. | |
| void | SetIOSettings (FbxIOSettings *pIOSettings) |
| Set the IOSettings pointer. | |
| void | SetPassword (char *pPassword) |
| Set the password. | |
Animation Stack Description Access | |
| |
| int | GetAnimStackCount () |
| Get the number of available animation stacks in the file. | |
| FbxTakeInfo * | GetTakeInfo (int pIndex) |
| Get the take information about an available take. | |
| FbxString | GetActiveAnimStackName () |
| Return the active animation stack name. | |
Scene Description Access | |
| FbxDocumentInfo * | GetSceneInfo () |
| Get the scene info. | |
File Format | |
| int | GetFileFormat () |
| Returns the index of the reader (FbxReader) associated with the file format. | |
| bool | IsFBX () |
Stream options identifiers.
Definition at line 153 of file fbximporter.h.
{
eParseFile, // Parse the file
eDoNotParseFile // Do not parse the file (fast)
};
| virtual bool Initialize | ( | const char * | pFileName, |
| const int | pFileFormat = -1, |
||
| FbxIOSettings * | pIOSettings = NULL |
||
| ) | [virtual] |
Initialize object.
| pFileName | Name of file to access. |
| pFileFormat | file format identifier User does not need to specify it by default. if not specified, plugin will detect the file format according to file suffix automatically. |
| pIOSettings | client IOSettings, if not specified, a default IOSettings will be created |
true on success, false otherwise. | virtual bool Initialize | ( | FbxStream * | pStream, |
| void * | pStreamData = NULL, |
||
| const int | pFileFormat = -1, |
||
| FbxIOSettings * | pIOSettings = NULL |
||
| ) | [virtual] |
Initialize object.
| pStream | stream to access. |
| pStreamData | user-defined stream data. |
| pFileFormat | file format identifier User does not need to specify it by default. if not specified, plugin will request the file format from the stream automatically. |
| pIOSettings | client IOSettings, if not specified, a default IOSettings will be created |
true on success, false otherwise. | void GetFileVersion | ( | int & | pMajor, |
| int & | pMinor, | ||
| int & | pRevision | ||
| ) |
Get the FBX version number of the FBX file.
FBX version numbers start at 5.0.0.
| pMajor | Version major number. |
| pMinor | Version minor number. |
| pRevision | Version revision number. |
| bool GetDefaultRenderResolution | ( | FbxString & | pCamName, |
| FbxString & | pResolutionMode, | ||
| double & | pW, | ||
| double & | pH | ||
| ) |
Get the default rendering resolution if present in the file header.
| pCamName | Returned name of the camera. |
| pResolutionMode | Returned resolution mode. |
| pW | Returned width. |
| pH | Returned height. |
true if the default rendering settings are defined in the file, otherwise returns false with empty parameters. | FbxIOFileHeaderInfo* GetFileHeaderInfo | ( | ) |
Get the complete file header information.
| bool GetImportOptions | ( | EStreamOptionsGeneration | pStreamOptionsGeneration = eParseFile | ) |
Read the currently opened file header to retrieve information related to takes.
| pStreamOptionsGeneration | Stream options identifier. |
true on success, false otherwise. | bool GetImportOptions | ( | FbxIO * | pFbxObject | ) |
Read the currently opened file header to retrieve information related to takes.
| pFbxObject | Target FBX file. |
true on success, false otherwise. | bool Import | ( | FbxDocument * | pDocument, |
| bool | pNonBlocking = false |
||
| ) |
Import the currently opened file into a scene.
| pDocument | Document to fill with file content. |
| pNonBlocking | If true, the import process will be executed in a new thread, allowing it to be non-blocking. To determine if the import finished, refer to the function IsImporting(). |
true on success, false otherwise. | bool IsImporting | ( | bool & | pImportResult | ) |
Check if the importer is currently importing.
| pImportResult | This parameter, after the import finished, will contain the result of the import success or failure. |
| float GetProgress | ( | FbxString * | pStatus = NULL | ) |
Get the progress status in non-blocking mode.
| pStatus | Optional current status string. |
| void SetProgressCallback | ( | FbxProgressCallback | pCallback, |
| void * | pArgs = NULL |
||
| ) |
Register a callback function for progress reporting in single thread mode.
| pCallback | Pointer of the callback function. |
| pArgs | pointer to the arguments passed to the callback function. |
| void SetEmbeddingExtractionFolder | ( | const char * | pExtractFolder | ) |
Explicitly set the embedding extraction folder.
If this is never called, the FBX SDK will determine the best folder to extract embedded files.
| pExtractionFolder | The file path name where the embedded files should be extracted. |
| const char* GetEmbeddingExtractionFolder | ( | ) |
Retrieve the current folder destination where the embedded files will be extracted.
This might not be initialized until file I/O is performed.
| FbxIOSettings* GetIOSettings | ( | ) |
Access to a IOSettings object.
NULL if the object has not been allocated. | void SetIOSettings | ( | FbxIOSettings * | pIOSettings | ) |
Set the IOSettings pointer.
| pIOSettings | Point to a FbxIOSettings object. |
| void SetPassword | ( | char * | pPassword | ) |
Set the password.
All subsequently imported files are opened with the given password.
| pPassword | Password string. |
| int GetAnimStackCount | ( | ) |
Get the number of available animation stacks in the file.
| FbxTakeInfo* GetTakeInfo | ( | int | pIndex | ) |
Get the take information about an available take.
Use the returned reference to a FbxTakeInfo object to set whether the indexed take is imported.
| pIndex | Index of the requested take. |
NULL if function failed. | FbxString GetActiveAnimStackName | ( | ) |
Return the active animation stack name.
| FbxDocumentInfo* GetSceneInfo | ( | ) |
Get the scene info.
NULL if no scene information is available in the file. | int GetFileFormat | ( | ) |
Returns the index of the reader (FbxReader) associated with the file format.
This index is considered the identifier of the file format. The array of registered readers can't be retrieved.
| bool IsFBX | ( | ) |
true if the file format is a recognized FBX format. | FbxFile* GetFile | ( | ) |
| FbxStream* GetStream | ( | ) |
| void* GetStreamData | ( | ) |
| void ParseForGlobalSettings | ( | bool | pState | ) |
| void ParseForStatistics | ( | bool | pState | ) |
| bool GetAxisInfo | ( | FbxAxisSystem * | pAxisSystem, |
| FbxSystemUnit * | pSystemUnits | ||
| ) |
| bool GetStatistics | ( | FbxStatistics * | pStatistics | ) |
| bool GetFrameRate | ( | FbxTime::EMode & | pTimeMode | ) |
| virtual void Construct | ( | const FbxImporter * | pFrom | ) | [protected, virtual] |
| virtual void Destruct | ( | bool | pRecursive | ) | [protected, virtual] |
Optional destructor override, automatically called by default destructor.
| pRecursive | If true, children objects should be destroyed as well. |
Reimplemented from FbxObject.
| void Reset | ( | ) | [protected] |
| bool FileOpen | ( | FbxFile * | pFile = NULL | ) | [protected] |
| bool FileOpen | ( | FbxStream * | pStream, |
| void * | pStreamData | ||
| ) | [protected] |
| void FileClose | ( | ) | [protected] |
| void GetImportOptionsInfo | ( | ) | [protected] |
| bool IsNativeExtension | ( | ) | [protected] |
| bool Initialize | ( | FbxFile * | pFile, |
| const int | pFileFormat = -1, |
||
| FbxIOSettings * | pIOSettings = NULL |
||
| ) | [protected] |
| bool Import | ( | FbxDocument * | pDocument, |
| FbxIO * | pFbxObject | ||
| ) | [protected] |
friend class FbxReaderFbx5 [friend] |
Definition at line 359 of file fbximporter.h.
friend class FbxReaderFbx6 [friend] |
Definition at line 360 of file fbximporter.h.
friend struct FbxReaderFbx7_Impl [friend] |
Definition at line 361 of file fbximporter.h.
| void ImportThread | ( | void * | ) | [friend] |