FBX C++ API Reference
fbxexporter.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 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_EXPORTER_H_
14 #define _FBXSDK_FILEIO_EXPORTER_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxevent.h>
24 
25 #include <fbxsdk/fbxsdk_nsbegin.h>
26 
27 class FbxIO;
29 class FbxThread;
30 class FbxWriter;
31 
32 struct FbxExportThreadArg;
33 
90 {
92 
93 public:
107  virtual bool Initialize(const char* pFileName, int pFileFormat = -1, FbxIOSettings* pIOSettings = NULL);
108 
119  virtual bool Initialize(FbxStream* pStream, void* pStreamData=NULL, int pFileFormat = -1, FbxIOSettings * pIOSettings = NULL);
120 
124  bool GetExportOptions();
125 
129  FbxIOSettings* GetIOSettings();
130 
134  void SetIOSettings(FbxIOSettings* pIOSettings);
135 
136 
145  bool Export(FbxDocument* pDocument, bool pNonBlocking=false);
146 
147  #if !defined(FBXSDK_ENV_WINSTORE) && !defined(FBXSDK_ENV_EMSCRIPTEN)
148 
156  bool IsExporting(bool& pExportResult);
157  #endif /* !FBXSDK_ENV_WINSTORE && ! FBXSDK_ENV_EMSCRIPTEN */
158 
163  float GetProgress(FbxString* pStatus=NULL);
164 
169  void SetProgressCallback(FbxProgressCallback pCallback, void* pArgs=NULL);
171 
179  int GetFileFormat();
180 
183  bool IsFBX();
184 
203  char const* const* GetCurrentWritableVersions();
204 
210  bool SetFileExportVersion(FbxString pVersion, FbxSceneRenamer::ERenamingMode pRenamingMode=FbxSceneRenamer::eNone);
211 
215  inline void SetResamplingRate(double pResamplingRate){ mResamplingRate = pResamplingRate; }
216 
229  void SetDefaultRenderResolution(FbxString pCamName, FbxString pResolutionMode, double pW, double pH);
230 
234  FbxIOFileHeaderInfo* GetFileHeaderInfo();
236 
237 /*****************************************************************************************************************************
238 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
239 *****************************************************************************************************************************/
240 #ifndef DOXYGEN_SHOULD_SKIP_THIS
241  bool GetExportOptions(FbxIO* pFbxObject);
242  bool Export(FbxDocument* pDocument, FbxIO* pFbxObject);
243 
244 protected:
245  virtual void Construct(const FbxObject* pFrom);
246  virtual void Destruct(bool pRecursive);
247  virtual void SetOrCreateIOSettings(FbxIOSettings* pIOSettings, bool pAllowNULL);
248 
249  void Reset();
250  bool FileCreate();
251  void FileClose();
252 
253 private:
254  bool ExportProcess(FbxDocument* pDocument);
255 
256  int mFileFormat;
257  FbxWriter* mWriter;
258 #if !defined(FBXSDK_ENV_WINSTORE) && !defined(FBXSDK_ENV_EMSCRIPTEN)
259  FbxThread* mExportThread;
260  FbxExportThreadArg* mExportThreadArg;
261  bool mExportThreadResult;
262  bool mIsThreadExporting;
263 #endif /* !FBXSDK_ENV_WINSTORE && !FBXSDK_ENV_EMSCRIPTEN */
264  FbxProgress mProgress;
265  FbxStream* mStream;
266  void* mStreamData;
267  FbxString mStrFileVersion;
268  double mResamplingRate;
269  FbxSceneRenamer::ERenamingMode mRenamingMode;
270  FbxIOFileHeaderInfo* mHeaderInfo;
271  FbxIOSettings* mIOSettings;
272  bool mClientIOSettings;
273 
274  friend void ExportThread(void*);
275 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
276 };
277 
279 class FBXSDK_DLL FbxEventPreExport : public FbxEvent<FbxEventPreExport>
280 {
282 
283 public:
284  FbxEventPreExport(FbxDocument* pDocument) : mDocument(pDocument) {};
285 
288 };
289 
291 class FBXSDK_DLL FbxEventPostExport : public FbxEvent<FbxEventPostExport>
292 {
294 
295 public:
296  FbxEventPostExport(FbxDocument* pDocument) : mDocument(pDocument) {};
297 
300 };
301 
302 #include <fbxsdk/fbxsdk_nsend.h>
303 
304 #endif /* _FBXSDK_FILEIO_EXPORTER_H_ */
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FBX SDK environment definition.
Abstract class for implementing I/O operations through a stream of data.
Definition: fbxstream.h:26
#define NULL
Definition: fbxarch.h:210
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxDocument is a base class for FbxScene and FbxLibrary classes.
Definition: fbxdocument.h:46
FbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers...
void SetResamplingRate(double pResamplingRate)
Set the resampling rate (only used when exporting to FBX 5.3 and lower)
Definition: fbxexporter.h:215
Base class for FBX file importer and exporter.
Definition: fbxiobase.h:28
Event that is emitted to plugins after a file is exported to the FBX format.
Definition: fbxexporter.h:291
FbxDocument * mDocument
The document to be exported.
Definition: fbxexporter.h:284
The base class of most FBX objects.
Definition: fbxobject.h:157
virtual bool Initialize(const char *pFileName, int pFileFormat=-1, FbxIOSettings *pIOSettings=((void *) 0))
Initializes the object.
Class to export SDK objects into an FBX file.
Definition: fbxexporter.h:89
Base class of other writers used internally.
Definition: fbxwriter.h:58
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
Class for progress reporting.
Definition: fbxprogress.h:31
FBX header information used at beginning of the FBX file to get or set important values like the file...
Definition: fbxio.h:224
FbxIO represents an FBX file.
Definition: fbxio.h:325
#define FBXSDK_EVENT_DECLARE(Class)
Definition: fbxevent.h:68
Event that is emitted to plugins before a file is exported to the FBX format.
Definition: fbxexporter.h:279
#define FBXSDK_DLL
Definition: fbxarch.h:173
virtual void Destruct(bool pRecursive)
Optional destructor override, automatically called by default destructor.
FbxDocument * mDocument
The document to be exported.
Definition: fbxexporter.h:296
This class implement a standard way to use threads across platforms.
Definition: fbxthread.h:29
bool(* FbxProgressCallback)(void *pArgs, float pPercentage, const char *pStatus)
Definition: fbxprogress.h:22
FBX event class, derived from FbxEventBase, and it contains a type ID for event.
Definition: fbxevent.h:134
ERenamingMode
The Mode describing from which format to which format.