FBX C++ API Reference
FbxWriter Class Referenceabstract

#include <fbxwriter.h>

Class Description

Base class of other writers used internally.

This class provides the interfaces for writing files.

The role of the writer is to effectively "write" specific file data vs the role of the exporter is to select a specific writer and launch the writing of a file through that writer.

See also
FbxExporter

ex:

A SDK user should - normally - not use this class, except if a custom writer must be created for plug-in extension, then FbxWriter must be the base class for the new custom writer in that particular situation.

Examples:
MyOwnWriterReader/MyOwnWriter.cxx, MyOwnWriterReader/MyOwnWriter.h, MyOwnWriterReader/MyOwnWriterReader.cxx, and MyOwnWriterReader/MyOwnWriterReader.h.

Definition at line 58 of file fbxwriter.h.

+ Inheritance diagram for FbxWriter:

Public Types

enum  EInfoRequest {
  eInfoExtension, eInfoDescriptions, eInfoVersions, eInfoCompatibleDesc,
  eInfoUILabel, eReserved1 = 0xFBFB
}
 Information type to request. More...
 
typedef FbxWriter *(* CreateFuncType) (FbxManager &pManager, FbxExporter &pExporter, int pSubID, int pPluginID)
 Helper typedef for passing FbxWriter creator function as argument (used internally). More...
 
typedef void(* IOSettingsFillerFuncType) (FbxIOSettings &pIOS)
 Helper typedef for passing FbxIOSettings creator function as argument (used internally). More...
 
typedef void *(* GetInfoFuncType) (EInfoRequest pRequest, int pWriterTypeId)
 Helper typedef for passing EInfoRequest function as argument (used internally). More...
 

Public Member Functions

 FbxWriter (FbxManager &pManager, int pID, FbxStatus &pStatus)
 Constructor. More...
 
virtual ~FbxWriter ()
 Destructor. More...
 
virtual bool FileCreate (char *pFileName)=0
 Creates a new file. More...
 
virtual bool FileCreate (FbxStream *pStream, void *pStreamData)
 Creates a new file via a stream. More...
 
virtual bool FileClose ()=0
 Closes the file. More...
 
virtual bool IsFileOpen ()=0
 Test if the file is open. More...
 
virtual void GetWriteOptions ()=0
 Setup write options. More...
 
virtual bool Write (FbxDocument *pDocument)=0
 Writes content to the specified file with given stream options. More...
 
virtual bool PreprocessScene (FbxScene &pScene)=0
 Pre-processes the scene. More...
 
virtual bool PostprocessScene (FbxScene &pScene)=0
 Post-processes the scene. More...
 
virtual void PluginWriteParameters (FbxObject &pParams)
 Writes extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export. More...
 
virtual FbxNodeFindRootNode (FbxScene &pScene)
 Finds the selected root node in the specified scene. More...
 
virtual bool CheckSpaceInNodeNameRecursive (FbxNode *pNode, FbxString &pNodeNameList)
 Checks if there are spaces in the names of specified node (and its children nodes), and writes the returned node's name in the specified string list. More...
 
bool SetFileExportVersion (FbxString pVersion)
 Sets the file export version as specified. More...
 
void SetRenamingMode (FbxSceneRenamer::ERenamingMode pRenamingMode)
 Sets the renaming mode as specified. More...
 
void SetResamplingRate (double pResamplingRate)
 Sets the resampling rate as specified. More...
 
bool IsGenuine ()
 Test if file format is an internal plug-in . More...
 
virtual FbxIOSettingsGetIOSettings ()
 Access to a IOSettings object. More...
 
virtual void SetIOSettings (FbxIOSettings *pIOSettings)
 Set the IOSettings pointer to be used for this writer instance. More...
 
virtual void SetProgressHandler (FbxProgress *)
 Pass a progress handler to the writer. More...
 
virtual bool SupportsStreams () const
 Returns true if this writer supports FbxStream I/O. More...
 

Protected Member Functions

void PluginsWriteBegin (FbxScene &pScene)
 Function called by FBX before writing out the scene (FbxScene). More...
 
void PluginsWrite (FbxIO &pFbx, bool pWriteObjectId)
 Function called by FBX before writing out any FBX object. More...
 
void PluginsWriteEnd (FbxScene &pScene)
 Function called by FBX after writing out the scene (FbxScene). More...
 

Member Typedef Documentation

◆ CreateFuncType

typedef FbxWriter*(* CreateFuncType) (FbxManager &pManager, FbxExporter &pExporter, int pSubID, int pPluginID)

Helper typedef for passing FbxWriter creator function as argument (used internally).

Definition at line 85 of file fbxwriter.h.

◆ IOSettingsFillerFuncType

typedef void(* IOSettingsFillerFuncType) (FbxIOSettings &pIOS)

Helper typedef for passing FbxIOSettings creator function as argument (used internally).

Definition at line 88 of file fbxwriter.h.

◆ GetInfoFuncType

typedef void*(* GetInfoFuncType) (EInfoRequest pRequest, int pWriterTypeId)

Helper typedef for passing EInfoRequest function as argument (used internally).

Definition at line 91 of file fbxwriter.h.

Member Enumeration Documentation

◆ EInfoRequest

Information type to request.

Remarks
Used internally to get writer file information.
Enumerator
eInfoExtension 

To get the file ext for a writer ex: "FBX".

eInfoDescriptions 

To get the file description for a writer ex:"Autodesk FBX (*.fbx)".

eInfoVersions 

To get the file version for a writer ex: 7100.

eInfoCompatibleDesc 

To get the file compatible description for a writer.

eInfoUILabel 

To get the file UI label to show for a writer ex: file labels shown in "Open file dialog".

eReserved1 

Definition at line 74 of file fbxwriter.h.

75  {
80  eInfoUILabel,
81  eReserved1 = 0xFBFB,
82  };
To get the file version for a writer ex: 7100.
Definition: fbxwriter.h:78
To get the file description for a writer ex:"Autodesk FBX (*.fbx)".
Definition: fbxwriter.h:77
To get the file compatible description for a writer.
Definition: fbxwriter.h:79
To get the file ext for a writer ex: "FBX".
Definition: fbxwriter.h:76
To get the file UI label to show for a writer ex: file labels shown in "Open file dialog"...
Definition: fbxwriter.h:80

Constructor & Destructor Documentation

◆ FbxWriter()

FbxWriter ( FbxManager pManager,
int  pID,
FbxStatus pStatus 
)

Constructor.

Parameters
pManagerThe FbxManager Object.
pIDId for current writer.
pStatusThe FbxStatus object to hold error codes.

◆ ~FbxWriter()

virtual ~FbxWriter ( )
virtual

Destructor.

Member Function Documentation

◆ FileCreate() [1/2]

virtual bool FileCreate ( char *  pFileName)
pure virtual

Creates a new file.

Parameters
pFileNameThe name of the newly created file.

Implemented in FbxWriterCollada, FbxWriterFbx7, FbxWriterFbx6, and FbxWriterFbx5.

Examples:
MyOwnWriterReader/MyOwnWriter.h.

◆ FileCreate() [2/2]

virtual bool FileCreate ( FbxStream pStream,
void *  pStreamData 
)
virtual

Creates a new file via a stream.

Parameters
pStreamThe stream to write to.
pStreamDatathe user-defined stream data to be written.

Reimplemented in FbxWriterFbx7, FbxWriterFbx6, and FbxWriterFbx5.

◆ FileClose()

virtual bool FileClose ( )
pure virtual

◆ IsFileOpen()

virtual bool IsFileOpen ( )
pure virtual

Test if the file is open.

Implemented in FbxWriterCollada, FbxWriterFbx7, FbxWriterFbx6, and FbxWriterFbx5.

Examples:
MyOwnWriterReader/MyOwnWriter.h.

◆ GetWriteOptions()

virtual void GetWriteOptions ( )
pure virtual

Setup write options.

Implemented in FbxWriterCollada, FbxWriterFbx5, FbxWriterFbx6, and FbxWriterFbx7.

Examples:
MyOwnWriterReader/MyOwnWriter.h.

◆ Write()

virtual bool Write ( FbxDocument pDocument)
pure virtual

Writes content to the specified file with given stream options.

Parameters
pDocumentFbxDocument to write file data to.

Implemented in FbxWriterCollada, FbxWriterFbx5, FbxWriterFbx6, and FbxWriterFbx7.

Examples:
MyOwnWriterReader/MyOwnWriter.h.

◆ PreprocessScene()

virtual bool PreprocessScene ( FbxScene pScene)
pure virtual

Pre-processes the scene.

Parameters
pSceneThe scene needs to be pre-processed.

Implemented in FbxWriterCollada, FbxWriterFbx5, FbxWriterFbx6, and FbxWriterFbx7.

Examples:
MyOwnWriterReader/MyOwnWriter.h.

◆ PostprocessScene()

virtual bool PostprocessScene ( FbxScene pScene)
pure virtual

Post-processes the scene.

Parameters
pSceneThe scene needs to be post-processed.

Implemented in FbxWriterCollada, FbxWriterFbx5, FbxWriterFbx6, and FbxWriterFbx7.

Examples:
MyOwnWriterReader/MyOwnWriter.h.

◆ PluginWriteParameters()

virtual void PluginWriteParameters ( FbxObject pParams)
virtual

Writes extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export.

This is especially useful for extension plug-ins that modify the scene and also to warn users during import if an extension plug-in was used that could be missing.

Parameters
pParamsThe parameters of the extension plug-in. The properties of the objects are used as the parameters of the extension plug-in.
Remarks
This function has no implementation in this class. Only sub-class should implement it as needed. For example, FBX 6 and FBX 7 does implement it.

Reimplemented in FbxWriterFbx7, and FbxWriterFbx6.

◆ FindRootNode()

virtual FbxNode* FindRootNode ( FbxScene pScene)
virtual

Finds the selected root node in the specified scene.

Parameters
pSceneThe scene in which the selected root node is found.
Returns
The located root node.NULL if the selected root node cannot be found.

◆ CheckSpaceInNodeNameRecursive()

virtual bool CheckSpaceInNodeNameRecursive ( FbxNode pNode,
FbxString pNodeNameList 
)
virtual

Checks if there are spaces in the names of specified node (and its children nodes), and writes the returned node's name in the specified string list.

Parameters
pNodeSpecifies the node to check.
pNodeNameListSpecifies the string list where the node name that has spaces in it is recorded.
Returns
true If there are no spaces in the name of specified node (and its children nodes), false If spaces are found.

◆ SetFileExportVersion()

bool SetFileExportVersion ( FbxString  pVersion)

Sets the file export version as specified.

Parameters
pVersionThe specified file export version.

◆ SetRenamingMode()

void SetRenamingMode ( FbxSceneRenamer::ERenamingMode  pRenamingMode)
inline

Sets the renaming mode as specified.

Parameters
pRenamingModeThe specified renaming mode.

Definition at line 166 of file fbxwriter.h.

166 {mRenamingMode = pRenamingMode;}

◆ SetResamplingRate()

void SetResamplingRate ( double  pResamplingRate)
inline

Sets the resampling rate as specified.

Parameters
pResamplingRateThe specified resampling rate.

Definition at line 171 of file fbxwriter.h.

171 {mResamplingRate = pResamplingRate;}

◆ IsGenuine()

bool IsGenuine ( )

Test if file format is an internal plug-in .

A non genuine plug-in is a plug-in made by someone external to Autodesk FBX SDK group.

Returns
true If the file format is an internal plug-in ,false Otherwise .

◆ GetIOSettings()

virtual FbxIOSettings* GetIOSettings ( )
virtual

Access to a IOSettings object.

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

◆ SetIOSettings()

virtual void SetIOSettings ( FbxIOSettings pIOSettings)
virtual

Set the IOSettings pointer to be used for this writer instance.

Parameters
pIOSettings

◆ SetProgressHandler()

virtual void SetProgressHandler ( FbxProgress )
inlinevirtual

Pass a progress handler to the writer.

Parameters
pProgressFbxProgress to store the progress information.

Reimplemented in FbxWriterFbx6, and FbxWriterFbx7.

Definition at line 193 of file fbxwriter.h.

193 {}

◆ SupportsStreams()

virtual bool SupportsStreams ( ) const
virtual

Returns true if this writer supports FbxStream I/O.

Default value is false.

Reimplemented in FbxWriterFbx7, FbxWriterFbx5, and FbxWriterFbx6.

◆ PluginsWriteBegin()

void PluginsWriteBegin ( FbxScene pScene)
protected

Function called by FBX before writing out the scene (FbxScene).

◆ PluginsWrite()

void PluginsWrite ( FbxIO pFbx,
bool  pWriteObjectId 
)
protected

Function called by FBX before writing out any FBX object.

Parameters
pFbxFile object.
pWriteObjectIdFlag to write out object id.

◆ PluginsWriteEnd()

void PluginsWriteEnd ( FbxScene pScene)
protected

Function called by FBX after writing out the scene (FbxScene).


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