This reference page is linked to from the following overview topics: Importing and Exporting a Scene, I/O Settings, Exporting a Scene, Customizing File Formats with FBX SDK I/O Plug-ins, FBX SDK Object Model, List of Python FBX classes.
Class to export SDK objects into an FBX file.
Normally this class is used as is. But for very special needs a user can override Initialize() for special purpose.
An exporter will select the appropriate writer to a particular file. Ex: When an exporter must export an FBX 7 file, the exporter will ask for all registered writers if an FBX 7 file writer is available, then if a writer is found, the exporter will create the specialized FBX 7 writer and write the file. This way, an exporter can "write" many different type of files like FBX 5/6/7, 3DS, Obj, Dxf, Collada, etc.
Typical workflow for using the KFbxExporter class:
// ex: // create a SdkManager KFbxSdkManager *lSdkManager = KFbxSdkManager::Create(); // create an IOSettings object KFbxIOSettings * ios = KFbxIOSettings::Create(lSdkManager, IOSROOT ); // set some IOSettings options ios->SetBoolProp(EXP_FBX_MATERIAL, true); ios->SetBoolProp(EXP_FBX_TEXTURE, true); // create an empty scene KFbxScene* lScene = KFbxScene::Create(lSdkManager,""); // create an exporter. KFbxExporter* lExporter = KFbxExporter::Create(lSdkManager, ""); // initialize the exporter by providing a filename and the IOSettings to use lExporter->Initialize("C:\\myfile.fbx", -1, ios); // export the scene. lExporter->Export(lScene); // destroy the exporter lExporter->Destroy();
Common/Common.cxx, ConvertScene/main.cxx, ExportDocument/main.cxx, ExportScene05/main.cxx, MyOwnWriterReader/MyOwnWriterReader.cxx, MyOwnWriterReader/MyOwnWriterReader.h, UIExamples/Common/ImportExport.cxx, and UIExamples/CubeCreator/SDK_Utility.cxx.
Definition at line 136 of file kfbxexporter.h.
#include <kfbxexporter.h>
Public Member Functions |
|
bool | GetExportOptions (KFbx *pFbxObject) |
Get file export option settings. |
|
bool | Export (KFbxDocument *pDocument, KFbx *pFbxObject) |
Protected Member Functions |
|
KFbxExporter (KFbxSdkManager &pManager, char const *pName) | |
virtual void | Destruct (bool pRecursive, bool pDependents) |
void | Reset () |
bool | FileCreate () |
void | FileClose () |
Protected Attributes |
|
KFbxExporterImp * | mImp |
KString | mStrFileVersion |
double | mResamplingRate |
KFbxSceneRenamer::ERenamingMode | mRenamingMode |
KFbxFileHeaderInfo * | mHeaderInfo |
KFbxIOSettings * | mIOSettings |
bool | mClientIOSettings |
Friends |
|
void | ExportThread (void *) |
Export Functions |
|
virtual bool | Initialize (const char *pFileName, int pFileFormat=-1, KFbxIOSettings *pIOSettings=NULL) |
Initialize object. |
|
bool | GetExportOptions () |
Setup file export options settings. |
|
KFbxIOSettings * | GetIOSettings () |
Access to a IOSettings object. |
|
void | SetIOSettings (KFbxIOSettings *pIOSettings) |
Set the IOSettings pointer. |
|
bool | Export (KFbxDocument *pDocument, bool pNonBlocking=false) |
Export the document to the currently created
file. |
|
bool | IsExporting (bool &pExportResult) |
Check if the exporter is currently
exporting. |
|
float | GetProgress (KString &pStatus) |
Get the progress status in non-blocking
mode. |
|
void | SetProgressCallback (KFbxProgressCallback pHandler) |
Register a callback function for progress
reporting in single thread mode. |
|
File Format |
|
int | GetFileFormat () |
Get the format of the exported file.
|
|
bool | IsFBX () |
Return true if the file format
is a recognized FBX format. |
|
char const *const | GetCurrentWritableVersions () |
Get writable version for the current file
format. |
|
bool | SetFileExportVersion (KString pVersion, KFbxSceneRenamer::ERenamingMode pRenamingMode) |
Set file version for a given file format.
|
|
void | SetResamplingRate (double pResamplingRate) |
Set the resampling rate (only used when
exporting to FBX 5.3 and lower) |
|
void | SetDefaultRenderResolution (KString pCamName, KString pResolutionMode, double pW, double pH) |
Set the default rendering resolution.
|
|
KFbxFileHeaderInfo * | GetFileHeaderInfo () |
Get the complete file header information.
|
KFbxExporter | ( | KFbxSdkManager & | pManager, |
char const * | pName | ||
) | [protected] |
virtual bool Initialize | ( | const char * | pFileName, |
int | pFileFormat = -1 , |
||
KFbxIOSettings * | 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.bool GetExportOptions | ( | ) |
Setup file export options settings.
true
on success, false
otherwise.KFbxIOSettings* GetIOSettings | ( | ) |
Access to a IOSettings object.
NULL
if
the object has not been allocated.void SetIOSettings | ( | KFbxIOSettings * | pIOSettings | ) |
Set the IOSettings pointer.
pIOSettings | Pointer on a KFbxIOSettings object. |
bool Export | ( | KFbxDocument * | pDocument, |
bool | pNonBlocking =
false |
||
) |
Export the document to the currently created file.
pDocument | Document to export. |
pNonBlocking | If true, the export process will be executed in a new thread, allowing it to be non-blocking. To determine if the export finished, refer to the function IsExporting(). |
true
on success, false
otherwise.bool IsExporting | ( | bool & | pExportResult | ) |
Check if the exporter is currently exporting.
pExportResult | This parameter, after the export finished, will contain the result of the export success or failure. |
float GetProgress | ( | KString & | pStatus | ) |
Get the progress status in non-blocking mode.
pStatus | KString reference to retrieve current status |
void SetProgressCallback | ( | KFbxProgressCallback | pHandler | ) |
Register a callback function for progress reporting in single thread mode.
pHandler | Pointer of the callback function. |
int GetFileFormat | ( | ) |
bool IsFBX | ( | ) |
Return true
if the file format is a recognized FBX
format.
char const* const GetCurrentWritableVersions | ( | ) |
Get writable version for the current file format.
char**
string array of writable versionsbool SetFileExportVersion | ( | KString | pVersion, |
KFbxSceneRenamer::ERenamingMode | pRenamingMode | ||
) |
Set file version for a given file format.
pVersion | String description of the file format. |
pRenamingMode | Renaming mode. |
true
if mode is set correctlyvoid SetResamplingRate | ( | double | pResamplingRate | ) | [inline] |
Set the resampling rate (only used when exporting to FBX 5.3 and lower)
pResamplingRate | resampling rate |
Definition at line 236 of file kfbxexporter.h.
{mResamplingRate = pResamplingRate;}
Set the default rendering resolution.
pCamName | name of the camera. |
pResolutionMode | resolution mode. |
pW | width. |
pH | height. |
KFbxFileHeaderInfo* GetFileHeaderInfo | ( | ) |
Get the complete file header information.
bool GetExportOptions | ( | KFbx * | pFbxObject | ) |
Get file export option settings.
pFbxObject | Target FBX file. |
true
on success, false
otherwise.bool Export | ( | KFbxDocument * | pDocument, |
KFbx * | pFbxObject | ||
) |
virtual void Destruct | ( | bool | pRecursive, |
bool | pDependents | ||
) | [protected, virtual] |
Reimplemented from KFbxObject.
void Reset | ( | ) | [protected] |
bool FileCreate | ( | ) | [protected] |
void FileClose | ( | ) | [protected] |
void ExportThread | ( | void * | ) | [friend] |
KFbxExporterImp* mImp
[protected] |
Definition at line 286 of file kfbxexporter.h.
KString mStrFileVersion
[protected] |
Definition at line 288 of file kfbxexporter.h.
double mResamplingRate
[protected] |
Definition at line 289 of file kfbxexporter.h.
KFbxSceneRenamer::ERenamingMode
mRenamingMode
[protected] |
Definition at line 290 of file kfbxexporter.h.
KFbxFileHeaderInfo*
mHeaderInfo
[protected] |
Definition at line 291 of file kfbxexporter.h.
KFbxIOSettings* mIOSettings
[protected] |
Definition at line 292 of file kfbxexporter.h.
bool mClientIOSettings
[protected] |
Definition at line 293 of file kfbxexporter.h.