Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

KFbxWriter Class Reference

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.


Search for all occurrences

Detailed 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:
KFbxExporter

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.

Examples:

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

Definition at line 62 of file kfbxwriter.h.

#include <kfbxwriter.h>

List of all members.

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

Member Typedef Documentation

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.


Member Enumeration Documentation

enum EError

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 91 of file kfbxwriter.h.


Constructor & Destructor Documentation

KFbxWriter ( KFbxSdkManager pManager,
int  pID 
)

Constructor.

Parameters:
pManager The KFbxSdkManager Object.
pID Id for current writer.
virtual ~KFbxWriter ( ) [virtual]

Destructor.


Member Function Documentation

virtual bool FileCreate ( char *  pFileName ) [pure virtual]

Creates a new file.

Parameters:
pFileName The name of the newly created file.
Examples:
MyOwnWriterReader/MyOwnWriter.h.
virtual bool FileClose ( ) [pure virtual]
virtual bool IsFileOpen ( ) [pure virtual]

Test if the file is open.

Examples:
MyOwnWriterReader/MyOwnWriter.h.
virtual void GetWriteOptions ( ) [pure virtual]
virtual bool Write ( KFbxDocument pDocument ) [pure virtual]

Writes content to the specified file with given stream options.

Parameters:
pDocument KFbxDocument to write file data to.
Examples:
MyOwnWriterReader/MyOwnWriter.h.
virtual bool PreprocessScene ( KFbxScene pScene ) [pure virtual]

Pre-processes the scene.

Parameters:
pScene The scene needs to be pre-processed.
Examples:
MyOwnWriterReader/MyOwnWriter.h.
virtual bool PostprocessScene ( KFbxScene pScene ) [pure virtual]

Post-processes the scene.

Parameters:
pScene The scene needs to be post-processed.
Examples:
MyOwnWriterReader/MyOwnWriter.h.
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.

Parameters:
pParams The 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.
virtual KFbxNode* FindRootNode ( KFbxScene pScene ) [virtual]

Finds the selected root node in the specified scene.

Parameters:
pScene The scene in which the selected root node is found.
Returns:
The located root node.NULL if the selected root node cannot be found.
virtual bool CheckSpaceInNodeNameRecursive ( KFbxNode pNode,
KString 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:
pNode Specifies the node to check.
pNodeNameList Specifies 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.
bool SetFileExportVersion ( KString  pVersion )

Sets the file export version as specified.

Parameters:
pVersion The specified file export version.
void SetRenamingMode ( KFbxSceneRenamer::ERenamingMode  pRenamingMode ) [inline]

Sets the renaming mode as specified.

Parameters:
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.

Parameters:
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.

Returns:
true If the file format is an internal plug-in ,false Otherwise .
KError& GetError ( )

Returns error object(s).

Returns:
References to the error object(s).
EError GetLastErrorID ( ) const

Returns the ID of the last error that occurred when the file was written.

Returns:
The last error ID.
const char* GetLastErrorString ( ) const

Returns the error string that describes the last error that occurred when the file was written.

Returns:
A textual description of the last error.
void GetMessage ( KString pMessage ) const

Returns a warning message that describes what occurred when the file was written.

Parameters:
pMessage The returned warning message.
KString& GetMessage ( )

Returns a warning message that describes what occurred when the file was written.

Returns:
The returned warning message.
void ClearMessage ( )

Empties the message string.

virtual KFbxIOSettings* GetIOSettings ( ) [virtual]

Access to a IOSettings object.

Returns:
The pointer to IOSettings or 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.

Parameters:
pIOSettings
virtual void SetProgressHandler ( KFbxProgress pProgress ) [inline, virtual]

Pass a progress handler to the writer.

Parameters:
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.

Parameters:
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; }

Friends And Related Function Documentation

friend struct KFbxWriterFbx7Impl [friend]

Definition at line 259 of file kfbxwriter.h.


Member Data Documentation

KFbxSdkManager& mManager [protected]
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.

The mode describing from which format to which format when write FBX file.

Definition at line 251 of file kfbxwriter.h.


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

KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter
KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter