This reference page is linked to from the following overview topics: Customizing File Formats with FBX SDK I/O Plug-ins, Customizing the FBX SDK, Customizing File Formats.
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.
ex:
A SDK user should - normally - not use this class, except if a custom writer must be created for plug-in extension, then KFbxWriter must be the base class for the new custom writer in that particular situation.
MyOwnWriterReader/MyOwnWriter.cxx, MyOwnWriterReader/MyOwnWriter.h, MyOwnWriterReader/MyOwnWriterReader.cxx, and MyOwnWriterReader/MyOwnWriterReader.h.
Definition at line 62 of file kfbxwriter.h.
#include <kfbxwriter.h>
Public Types |
|
enum | EError
{ eFILE_CORRUPTED, eFILE_NOT_OPENED, eFILE_NOT_CREATED, eOUT_OF_DISK_SPACE, eINVALID_DOCUMENT_HANDLE, eDOCUMENT_NOT_SUPPORTED, eUNIDENTIFIED_ERROR, eEMBEDDED_OUT_OF_SPACE, eERROR_COUNT } |
Error identifiers. More... |
|
enum | KInfoRequest
{ eInfoExtension, eInfoDescriptions, eInfoVersions, eInfoCompatibleDesc, eInfoUILabel, eReserved1 = 0xFBFB } |
Information type to request. More... |
|
typedef KFbxWriter *(* | CreateFuncType )(KFbxSdkManager &pManager, KFbxExporter &pExporter, int pSubID, int pPluginID) |
Helper typedef for passing KFbxWriter
creator function as argument (used internally). |
|
typedef void(* | IOSettingsFillerFuncType )(KFbxIOSettings &pIOS) |
Helper typedef for passing
KFbxIOSettings creator function as argument (used internally).
|
|
typedef void *(* | GetInfoFuncType )(KInfoRequest pRequest, int pWriterTypeId) |
Helper typedef for passing KInfoRequest
function as argument (used internally). |
|
Public Member Functions |
|
KFbxWriter (KFbxSdkManager &pManager, int pID) | |
Constructor. |
|
virtual | ~KFbxWriter () |
Destructor. |
|
virtual bool | FileCreate (char *pFileName)=0 |
Creates a new file. |
|
virtual bool | FileClose ()=0 |
Closes the file. |
|
virtual bool | IsFileOpen ()=0 |
Test if the file is open. |
|
virtual void | GetWriteOptions ()=0 |
Setup write options. |
|
virtual bool | Write (KFbxDocument *pDocument)=0 |
Writes content to the specified file with
given stream options. |
|
virtual bool | PreprocessScene (KFbxScene &pScene)=0 |
Pre-processes the scene. |
|
virtual bool | PostprocessScene (KFbxScene &pScene)=0 |
Post-processes the scene. |
|
virtual void | PluginWriteParameters (KFbxObject &pParams) |
Writes extension plug-ins name, version and
parameters, so that we can remember if a plug-in was used during
export. |
|
virtual KFbxNode * | FindRootNode (KFbxScene &pScene) |
Finds the selected root node in the
specified scene. |
|
virtual bool | CheckSpaceInNodeNameRecursive (KFbxNode *pNode, KString &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. |
|
bool | SetFileExportVersion (KString pVersion) |
Sets the file export version as specified.
|
|
void | SetRenamingMode (KFbxSceneRenamer::ERenamingMode pRenamingMode) |
Sets the renaming mode as specified.
|
|
void | SetResamplingRate (double pResamplingRate) |
Sets the resampling rate as specified.
|
|
bool | IsGenuine () |
Test if file format is an internal plug-in .
|
|
KError & | GetError () |
Returns error object(s). |
|
EError | GetLastErrorID () const |
Returns the ID of the last error that
occurred when the file was written. |
|
const char * | GetLastErrorString () const |
Returns the error string that describes the
last error that occurred when the file was written. |
|
void | GetMessage (KString &pMessage) const |
Returns a warning message that describes
what occurred when the file was written. |
|
KString & | GetMessage () |
Returns a warning message that describes
what occurred when the file was written. |
|
void | ClearMessage () |
Empties the message string. |
|
virtual KFbxIOSettings * | GetIOSettings () |
Access to a IOSettings object. |
|
virtual void | SetIOSettings (KFbxIOSettings *pIOSettings) |
Set the IOSettings pointer to be used for
this writer instance. |
|
virtual void | SetProgressHandler (KFbxProgress *pProgress) |
Pass a progress handler to the writer.
|
|
Protected Member Functions |
|
void | PluginsWriteBegin (KFbxScene &pScene) |
Function called by FBX before writing out
the scene (KFbxScene).
|
|
void | PluginsWrite (KFbx &pFbx, bool pWriteObjectId) |
Function called by FBX before writing out
any FBX object. |
|
void | PluginsWriteEnd (KFbxScene &pScene) |
Function called by FBX after writing out the
scene (KFbxScene).
|
|
KFbxWriter & | operator= (KFbxWriter const &) |
Protected Attributes |
|
KFbxSdkManager & | mManager |
KString | mFileVersion |
double | mResamplingRate |
Resample rate for animation. |
|
KFbxSceneRenamer::ERenamingMode | mRenamingMode |
The mode describing from which format to
which format when write FBX file. |
|
Friends |
|
struct | KFbxWriterFbx7Impl |
typedef KFbxWriter*(* CreateFuncType)(KFbxSdkManager &pManager, KFbxExporter &pExporter, int pSubID, int pPluginID) |
Helper typedef for passing KFbxWriter creator function as argument (used internally).
Definition at line 101 of file kfbxwriter.h.
typedef void(* IOSettingsFillerFuncType)(KFbxIOSettings &pIOS) |
Helper typedef for passing KFbxIOSettings creator function as argument (used internally).
Definition at line 104 of file kfbxwriter.h.
typedef void*(* GetInfoFuncType)(KInfoRequest pRequest, int pWriterTypeId) |
Helper typedef for passing KInfoRequest function as argument (used internally).
Definition at line 107 of file kfbxwriter.h.
enum EError |
Error identifiers.
eFILE_CORRUPTED | |
eFILE_NOT_OPENED | |
eFILE_NOT_CREATED | |
eOUT_OF_DISK_SPACE | |
eINVALID_DOCUMENT_HANDLE | |
eDOCUMENT_NOT_SUPPORTED | |
eUNIDENTIFIED_ERROR | |
eEMBEDDED_OUT_OF_SPACE | |
eERROR_COUNT |
Definition at line 75 of file kfbxwriter.h.
enum KInfoRequest |
Information type to request.
Definition at line 91 of file kfbxwriter.h.
{ eInfoExtension, eInfoDescriptions, eInfoVersions, eInfoCompatibleDesc, eInfoUILabel, eReserved1 = 0xFBFB, };
KFbxWriter | ( | KFbxSdkManager & | pManager, |
int | pID | ||
) |
Constructor.
pManager | The KFbxSdkManager Object. |
pID | Id for current writer. |
virtual ~KFbxWriter | ( | ) | [virtual] |
Destructor.
virtual bool FileCreate | ( | char * | pFileName | ) | [pure virtual] |
Creates a new file.
pFileName | The name of the newly created file. |
virtual bool FileClose | ( | ) | [pure virtual] |
virtual bool IsFileOpen | ( | ) | [pure virtual] |
virtual void GetWriteOptions | ( | ) | [pure virtual] |
virtual bool Write | ( | KFbxDocument * | pDocument | ) | [pure virtual] |
Writes content to the specified file with given stream options.
pDocument | KFbxDocument to write file data to. |
virtual bool PreprocessScene | ( | KFbxScene & | pScene | ) | [pure virtual] |
Pre-processes the scene.
pScene | The scene needs to be pre-processed. |
virtual bool PostprocessScene | ( | KFbxScene & | pScene | ) | [pure virtual] |
Post-processes the scene.
pScene | The scene needs to be post-processed. |
virtual void PluginWriteParameters | ( | KFbxObject & | 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.
pParams | The parameters of the extension plug-in. The properties of the objects are used as the parameters of the extension plug-in. |
Finds the selected root node in the specified scene.
pScene | The scene in which the selected root node is found. |
NULL
if the selected root
node cannot be found.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.
pNode | Specifies the node to check. |
pNodeNameList | Specifies the string list where the node name that has spaces in it is recorded. |
true
If there are no spaces in the name of
specified node (and its children nodes), false
If
spaces are found.bool SetFileExportVersion | ( | KString | pVersion | ) |
Sets the file export version as specified.
pVersion | The specified file export version. |
void SetRenamingMode | ( | KFbxSceneRenamer::ERenamingMode | pRenamingMode | ) | [inline] |
Sets the renaming mode as specified.
pRenamingMode | The specified renaming mode. |
Definition at line 174 of file kfbxwriter.h.
{mRenamingMode = pRenamingMode;}
void SetResamplingRate | ( | double | pResamplingRate | ) | [inline] |
Sets the resampling rate as specified.
pResamplingRate | The specified resampling rate. |
Definition at line 179 of file kfbxwriter.h.
{mResamplingRate = pResamplingRate;}
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.
true
If the file format is an internal plug-in
,false
Otherwise .KError& GetError | ( | ) |
EError GetLastErrorID | ( | ) | const |
Returns the ID of the last error that occurred when the file was written.
const char* GetLastErrorString | ( | ) | const |
Returns the error string that describes the last error that occurred when the file was written.
void GetMessage | ( | KString & | pMessage | ) | const |
Returns a warning message that describes what occurred when the file was written.
pMessage | The returned warning message. |
KString& GetMessage | ( | ) |
Returns a warning message that describes what occurred when the file was written.
void ClearMessage | ( | ) |
Empties the message string.
virtual KFbxIOSettings* GetIOSettings | ( | ) | [virtual] |
Access to a IOSettings object.
NULL
if
the object has not been allocated.virtual void SetIOSettings | ( | KFbxIOSettings * | pIOSettings | ) | [virtual] |
Set the IOSettings pointer to be used for this writer instance.
pIOSettings |
virtual void SetProgressHandler | ( | KFbxProgress * | pProgress | ) | [inline, virtual] |
Pass a progress handler to the writer.
pProgress | KFbxProgress to store the progress information. |
Definition at line 230 of file kfbxwriter.h.
{}
void PluginsWriteBegin | ( | KFbxScene & | pScene | ) | [protected] |
Function called by FBX before writing out the scene (KFbxScene).
void PluginsWrite | ( | KFbx & | pFbx, |
bool | pWriteObjectId | ||
) | [protected] |
Function called by FBX before writing out any FBX object.
pFbx | File object. |
pWriteObjectId | Flag to write out object id. |
void PluginsWriteEnd | ( | KFbxScene & | pScene | ) | [protected] |
Function called by FBX after writing out the scene (KFbxScene).
KFbxWriter& operator= | ( | KFbxWriter const & | ) | [inline, protected] |
Definition at line 244 of file kfbxwriter.h.
{ return *this; }
friend struct KFbxWriterFbx7Impl
[friend] |
Definition at line 259 of file kfbxwriter.h.
KFbxSdkManager& mManager
[protected] |
Definition at line 246 of file kfbxwriter.h.
KString mFileVersion
[protected] |
Definition at line 247 of file kfbxwriter.h.
double mResamplingRate
[protected] |
Resample rate for animation.
Definition at line 249 of file kfbxwriter.h.
KFbxSceneRenamer::ERenamingMode
mRenamingMode
[protected] |
The mode describing from which format to which format when write FBX file.
Definition at line 251 of file kfbxwriter.h.