FBX C++ API Reference
fbxwriter.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2019 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_FILEIO_WRITER_H_
14 #define _FBXSDK_FILEIO_WRITER_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
23 class FbxStatus;
24 class FbxManager;
25 class FbxFile;
26 class FbxStream;
27 class FbxObject;
28 class FbxDocument;
29 class FbxScene;
30 class FbxExporter;
31 class FbxIO;
32 class FbxIOSettings;
33 class FbxProgress;
34 
35 #define IOSP GetIOSettings()
36 
60 {
61 public:
67  FbxWriter(FbxManager& pManager, int pID, FbxStatus& pStatus);
68 
70  virtual ~FbxWriter();
71 
76  {
82  eReserved1 = 0xFBFB,
83  };
84 
86  typedef FbxWriter* (*CreateFuncType)(FbxManager& pManager, FbxExporter& pExporter, int pSubID, int pPluginID);
87 
89  typedef void (*IOSettingsFillerFuncType)(FbxIOSettings& pIOS);
90 
92  typedef void* (*GetInfoFuncType)(EInfoRequest pRequest, int pWriterTypeId);
93 
97  virtual bool FileCreate(char* pFileName) = 0;
98 
103  virtual bool FileCreate(FbxStream* pStream, void* pStreamData);
104 
107  virtual bool FileClose() = 0;
108 
111  virtual bool IsFileOpen() = 0;
112 
115  virtual void GetWriteOptions() = 0;
116 
120  virtual bool Write(FbxDocument* pDocument) = 0;
121 
125  virtual bool PreprocessScene(FbxScene &pScene) = 0;
126 
130  virtual bool PostprocessScene(FbxScene &pScene) = 0;
131 
132 #ifndef FBXSDK_ENV_WINSTORE
133 
141  virtual void PluginWriteParameters(FbxObject& pParams);
142 #endif /* !FBXSDK_ENV_WINSTORE */
143 
148  virtual FbxNode* FindRootNode(FbxScene& pScene);
149 
157  virtual bool CheckSpaceInNodeNameRecursive(FbxNode* pNode, FbxString& pNodeNameList);
158 
162  bool SetFileExportVersion(FbxString pVersion);
163 
167  void SetRenamingMode(FbxSceneRenamer::ERenamingMode pRenamingMode){mRenamingMode = pRenamingMode;}
168 
172  inline void SetResamplingRate(double pResamplingRate){mResamplingRate = pResamplingRate;}
173 
178  bool IsGenuine();
179 
184  virtual FbxIOSettings * GetIOSettings();
185 
189  virtual void SetIOSettings(FbxIOSettings * pIOSettings);
190 
194  virtual void SetProgressHandler(FbxProgress* /*pProgress*/){}
195 
196  virtual void SetEmbeddedFileCallback(FbxEmbeddedFileCallback* /*pCallback*/) {}
197 
199  virtual bool SupportsStreams() const;
200 
201 protected:
202 #ifndef FBXSDK_ENV_WINSTORE
203  void PluginsWriteBegin(FbxScene& pScene);
210  void PluginsWrite(FbxIO& pFbx, bool pWriteObjectId);
212  void PluginsWriteEnd(FbxScene& pScene);
213 #endif /* !FBXSDK_ENV_WINSTORE */
214 
215 /*****************************************************************************************************************************
216 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
217 *****************************************************************************************************************************/
218 public:
219 #ifndef DOXYGEN_SHOULD_SKIP_THIS
220  FbxStatus& GetStatus() { return mStatus; }
221 
222 protected:
223 
224  FbxWriter& operator=(FbxWriter const&) { return *this; }
225 
226  FbxStatus& mStatus;
227  FbxManager& mManager;
228  FbxString mFileVersion;
230  double mResamplingRate;
232  FbxSceneRenamer::ERenamingMode mRenamingMode;
233 
234 private:
235  int mInternalID;
236  FbxIOSettings * mIOSettings;
237 
238  friend struct FbxWriterFbx7_Impl;
239 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
240 };
241 
243 #define IOS_REF (*GetIOSettings())
244 
245 #include <fbxsdk/fbxsdk_nsend.h>
246 
247 #endif /* _FBXSDK_FILEIO_WRITER_H_ */
Callback to operate on the embedded data while it is processed.
Definition: fbxcallbacks.h:166
FBX SDK environment definition.
SDK object manager.
Definition: fbxmanager.h:56
EInfoRequest
Information type to request.
Definition: fbxwriter.h:75
Abstract class for implementing I/O operations through a stream of data.
Definition: fbxstream.h:26
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxDocument is a base class for FbxScene and FbxLibrary classes.
Definition: fbxdocument.h:46
virtual void SetEmbeddedFileCallback(FbxEmbeddedFileCallback *)
Definition: fbxwriter.h:196
To get the file version for a writer ex: 7100.
Definition: fbxwriter.h:79
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:29
FbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers...
void SetRenamingMode(FbxSceneRenamer::ERenamingMode pRenamingMode)
Sets the renaming mode as specified.
Definition: fbxwriter.h:167
The base class of most FBX objects.
Definition: fbxobject.h:157
void SetResamplingRate(double pResamplingRate)
Sets the resampling rate as specified.
Definition: fbxwriter.h:172
To get the file description for a writer ex:"Autodesk FBX (*.fbx)".
Definition: fbxwriter.h:78
Represents an element in the scene graph.
Definition: fbxnode.h:72
Class to export SDK objects into an FBX file.
Definition: fbxexporter.h:90
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
Base class of other writers used internally.
Definition: fbxwriter.h:59
To get the file compatible description for a writer.
Definition: fbxwriter.h:80
Class for progress reporting.
Definition: fbxprogress.h:31
To get the file ext for a writer ex: "FBX".
Definition: fbxwriter.h:77
FbxIO represents an FBX file.
Definition: fbxio.h:347
#define FBXSDK_DLL
Definition: fbxarch.h:176
To get the file UI label to show for a writer ex: file labels shown in "Open file dialog"...
Definition: fbxwriter.h:81
virtual void SetProgressHandler(FbxProgress *)
Pass a progress handler to the writer.
Definition: fbxwriter.h:194
Class for interfacing with files, providing a similar interface for files independant of the OS or fi...
Definition: fbxfile.h:27
ERenamingMode
The Mode describing from which format to which format.