FBX C++ API Reference
fbxio.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_FBX_IO_H_
14 #define _FBXSDK_FILEIO_FBX_IO_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
22 
23 #include <fbxsdk/fbxsdk_nsbegin.h>
24 
25 class FbxIO;
26 class FbxReader;
27 class FbxWriter;
28 class FbxFile;
29 class FbxStream;
30 class FbxXRefManager;
31 
131 //File version numbers
132 #define FBX_FILE_VERSION_2000 2000 //FBX 2.0
133 #define FBX_FILE_VERSION_2001 2001 //FBX 2.01
134 #define FBX_FILE_VERSION_3000 3000 //FBX 3.0
135 #define FBX_FILE_VERSION_3001 3001 //FBX 3.01
136 #define FBX_FILE_VERSION_4000 4000 //FBX 4.0
137 #define FBX_FILE_VERSION_4001 4001 //FBX 4.01
138 #define FBX_FILE_VERSION_4050 4050 //FBX 4.5
139 #define FBX_FILE_VERSION_5000 5000 //FBX 5.0
140 #define FBX_FILE_VERSION_5800 5800 //FBX 5.8
141 #define FBX_FILE_VERSION_6000 6000 //FBX 6.0
142 #define FBX_FILE_VERSION_6100 6100 //FBX 6.1 (guarantee compatibility with Autodesk 2010 products)
143 #define FBX_FILE_VERSION_7000 7000 //Compatible with 7.1, and taken as such
144 #define FBX_FILE_VERSION_7099 7099 //Compatible with 7.1, and taken as such
145 #define FBX_FILE_VERSION_7100 7100 //FBX 7.1 (guarantee compatibility with Autodesk 2011 products)
146 #define FBX_FILE_VERSION_7200 7200 //FBX 7.2 (guarantee compatibility with Autodesk 2012 products)
147 #define FBX_FILE_VERSION_7300 7300 //FBX 7.3 (guarantee compatibility with Autodesk 2013 products)
148 #define FBX_FILE_VERSION_7400 7400 //FBX 7.4 (guarantee compatibility with Autodesk 2014/2015 products)
149 #define FBX_FILE_VERSION_7500 7500 //FBX 7.5 (guarantee compatibility with Autodesk 2016/2017/2018 products)
150 #define FBX_FILE_VERSION_7700 7700 //FBX 7.7 (guarantee compatibility with Autodesk 2019/2020 products)
151 
152 #define FBX_FILE_VERSION_7600 7600 // Needed to support the few existing files generated with this version.
153 // Files with this version, are written using the new FBXSDK_TC_MILLISECOND but without the flag to identify this.
154 // Old readers are unable to figure this out and will still assume that the millisecond is 46186158 (so all the timings
155 // are wrong).
156 
157 
158 //File version compatibility strings
159 #define FBX_53_MB55_COMPATIBLE "FBX53_MB55"
160 #define FBX_60_COMPATIBLE "FBX60_MB60"
161 #define FBX_2005_08_COMPATIBLE "FBX200508_MB70"
162 #define FBX_2006_02_COMPATIBLE "FBX200602_MB75"
163 #define FBX_2006_08_COMPATIBLE "FBX200608"
164 #define FBX_2006_11_COMPATIBLE "FBX200611"
165 #define FBX_2009_00_COMPATIBLE "FBX200900"
166 #define FBX_2009_00_V7_COMPATIBLE "FBX200900v7"
167 #define FBX_2010_00_COMPATIBLE "FBX201000"
168 #define FBX_2011_00_COMPATIBLE "FBX201100"
169 #define FBX_2012_00_COMPATIBLE "FBX201200"
170 #define FBX_2013_00_COMPATIBLE "FBX201300"
171 #define FBX_2014_00_COMPATIBLE "FBX201400"
172 #define FBX_2016_00_COMPATIBLE "FBX201600"
173 #define FBX_2018_00_COMPATIBLE "FBX201800"
174 #define FBX_2019_00_COMPATIBLE "FBX201900"
175 #define FBX_2020_00_COMPATIBLE "FBX202000"
176 
177 //Default file version number used when writing new FBX files
178 #define FBX_DEFAULT_FILE_VERSION FBX_FILE_VERSION_7700
179 #define FBX_DEFAULT_FILE_COMPATIBILITY FBX_2020_00_COMPATIBLE
180 
194 FBXSDK_DLL int FbxFileVersionStrToInt(const char* pFileVersion);
195 
197 enum
198 {
202 };
203 
208 {
209 public:
211  bool mIsOK;
217  double mResolutionW;
219  double mResolutionH;
220 
228 
233  void Reset();
236 };
237 
243 {
244 public:
251 
253  virtual ~FbxIOFileHeaderInfo();
255 
260 
262  virtual void Reset();
263 
267  virtual bool ReadExtendedHeaderInformation(FbxIO*);
269 
272 
274 
276 
281 
284 
287 
292 
294  bool mIOPlugin;
295 
297  bool mPLE;
299 
302  bool mBinary;
303 };
304 
348 {
349 public:
350 
354  {
357 
360  : mFbx(pFbx)
361  , mXRefManager(NULL)
362  {
363  if( mFbx )
364  {
365  mXRefManager = mFbx->ProjectGetXRefManager();
366  mFbx->ProjectSetXRefManager(&pXRefManager);
367  }
368  }
369 
372  {
373  if( mFbx )
374  {
375  mFbx->ProjectSetXRefManager(mXRefManager);
376  }
377  }
378  };
379 
381  {
382  BinaryNormal, //<! Standard FBX file field alignment using 32bit values, used by all file format version 7.4.0 or lower
383  BinaryLarge //<! New FBX file field alignment using 64bit values, used by all file format version 7.5.0 or higher
384  };
385 
390  static FbxIO* Create(BinaryType pBinaryType, FbxStatus& pStatus){ return FbxNew< FbxIO >(pBinaryType, pStatus); }
391 
393  FbxIO(BinaryType pBinaryType, FbxStatus& pStatus);
394 
396  virtual ~FbxIO();
397 
404 
414  bool ProjectOpen(void* pAddress, FbxULong pMaxLength, FbxReader* pReader, bool pCheckCRC = false, bool pOpenMainSection = true, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
415 
424  bool ProjectOpen(const char* pName, FbxReader* pReader, bool pCheckCRC = false, bool pOpenMainSection = true, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
425 
435  bool ProjectOpen(FbxStream* pStream, void* pStreamData, FbxReader* pReader, bool pCheckCRC = false, bool pOpenMainSection = true, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
436 
445  bool ProjectOpenDirect(const char* pName, FbxReader* pReader, bool pCheckCRC = false, bool pOpenMainSection = true, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
446 
456  bool ProjectCreate(void* pAddress, FbxUInt pSize, FbxWriter* pWriter, bool pBinary, bool pEncrypted, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
457 
466  bool ProjectCreate(const char* pName, FbxWriter* pWriter, bool pBinary, bool pEncrypted, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
467 
477  bool ProjectCreate(FbxStream* pStream, void* pStreamData, FbxWriter* pWriter, bool pBinary, bool pEncrypted, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
478 
487  bool ProjectCreateDirect(const char* pName, FbxWriter* pWriter, bool pBinary, bool pEncrypted, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
488 
497  bool ProjectCreateEmpty(const char* pName, FbxWriter* pWriter, int pVersion, bool pBinary, bool pEncrypted);
498 
508  bool ProjectCreateEmpty(FbxStream* pStream, void* pStreamData, FbxWriter* pWriter, int pVersion, bool pBinary, bool pEncrypted);
509 
513  bool ProjectWrite_BeginFileHeader();
514 
518  bool ProjectWrite_BeginExtendedHeader();
519 
524  bool ProjectWrite_WriteExtendedHeader(const FbxIOFileHeaderInfo* pExtendedHeader);
525 
529  bool ProjectWrite_EndExtendedHeader();
530 
534  bool ProjectWrite_EndFileHeader();
535 
542  bool ProjectClose(void** pData=0, size_t* pSize=0);
543 
547  void ProjectSetXRefManager(const FbxXRefManager*);
548 
552  const FbxXRefManager* ProjectGetXRefManager() const;
553 
568  bool ProjectCreateEmbeddedFolder(const FbxXRefManager& pXRefManager, FbxString& pCreatedFolder, const char* pUserDefinedFolder = NULL);
569 
573  void SetEmbedded(bool pValue);
574 
578  void SetEmbeddingExtractionFolder(const char* pExtractionFolder);
579 
582  const char* GetEmbeddingExtractionFolder();
583 
587  bool IsEmbedded() const;
588 
592  bool IsBinary() const;
593 
597  bool IsEncrypted () const;
598 
602  bool CheckCRC();
603 
607  FbxUInt32 GetFileVersionNumber() const;
608 
612  void CacheSize(FbxUInt32 pCacheSize);
613 
617  FbxUInt32 CacheSize() const;
618 
620 
631 
633  bool Fbx7Support() const;
634 
638  void Fbx7Support(bool pSupport);
639 
641  bool CompressArrays() const;
642 
646  void CompressArrays(bool pCompress);
647 
649  int CompressMinimumSize() const;
650 
654  void CompressMinimumSize(int pSize);
655 
657  int CompressLevel() const;
658 
664  void CompressLevel(int pLevel);
666 
672 
676  bool ProjectOpenMainSection();
677 
681  int ProjectGetExtensionSectionCount() const;
682 
687  bool ProjectOpenExtensionSection(int pExtensionSectionIndex);
688 
693  bool ProjectCreateExtensionSection(bool pOverwriteLastExtensionSection = false);
694 
697  void ProjectCloseSection();
698 
702  int ProjectGetCurrentSection() const;
703 
707  int ProjectGetCurrentSectionMode() const;
708 
712  int ProjectGetCurrentSectionVersion() const;
713 
721  int ProjectGetSectionVersion(int pSection) const;
722 
729  static void ProjectConvertVersionNumber(int pVersion, int& pMajor, int& pMinor, int& pRevision);
730 
734  bool IsPasswordProtected() const;
735 
741  bool CheckPassword(const char* pPassword);
742 
749  bool WritePassword(const char* pPassword);
750 
752 
757 
761  const char* GetFilename() const;
762 
767  FbxString GetDataDirectory(bool pAutoCreate = true);
768 
777  FbxString GetMediaDirectory(bool pCreate = false, const char* pUserDefinedFolder = NULL);
778 
784  FbxString GetContainerTemplateDirectory(const char* pTemplateName, bool pCreate);
785 
790  char* GetRelativePath(const char* pPath);
791 
796  char* GetRelativeFilePath(const char* pFilePath);
797 
802  char* GetFullPath(const char* pRelativePath);
803 
808  char* GetFullFilePath(const char* pRelativeFilePath);
809 
814  char* GetTmpProjectName(const char* pName) const;
815 
822  bool SwapFromTmpProject(const char* pName, char* pError=NULL, int pErrorSize=0);
823 
825 
831 
834  void FieldReadResetPosition();
835 
839  int FieldGetCount() const;
840 
845  const char* FieldGetName(int pFieldIndex) const;
846 
851  int FieldGetInstanceCount(const char* pFieldName) const;
852 
858  bool FieldReadBegin(int pFieldIndex, int pInstance);
859 
864  bool FieldReadBegin(const char* pFieldName);
865 
871  bool FieldReadBegin(const char* pFieldName, int pInstance);
872 
874  void FieldReadEnd();
875 
877  bool FieldReadIsBlock();
878 
880  bool FieldReadBlockBegin();
881 
883  void FieldReadBlockEnd();
884 
886  int FieldReadGetCount() const;
887 
889  int FieldReadGetRemain() const;
890 
892  char FieldReadGetType() const;
893 
895  char FieldReadCH();
896 
901  char FieldReadCH(const char* pFieldName, char pDefault=0);
902 
904  const char* FieldReadC();
905 
910  const char* FieldReadC(const char* pFieldName, const char* pDefault="");
911 
913  const char* FieldReadS();
914 
919  const char* FieldReadS(const char* pFieldName, const char* pDefault="");
920 
922  bool FieldReadB();
923 
928  bool FieldReadB(const char* pFieldName, bool pDefault = false);
929 
931  int FieldReadI();
932 int FieldReadI(const char* pFieldName, int pDefault=0);
937 
939  FbxLongLong FieldReadLL();
940 
945  FbxLongLong FieldReadLL(const char* pFieldName, FbxLongLong pDefault=0);
946 
948  float FieldReadF();
949 
954  float FieldReadF(const char* pFieldName, float pDefault=0);
955 
957  double FieldReadD();
958 
963  double FieldReadD(const char* pFieldName, double pDefault=0);
964 
968  FbxTime FieldReadT(const char* pFieldName);
969 
971  FbxTime FieldReadT();
972 
976  FbxTimeSpan FieldReadTS(const char* pFieldName);
977 
979  FbxTimeSpan FieldReadTS();
980 
985  void FieldReadFn(float* pValue, FbxUInt pn);
986 
990  void FieldRead3F(float* pValue);
991 
995  void FieldRead4F(float* pValue);
996 
1003  void FieldReadFn(const char* pFieldName, float* pValue, const float *pDefault, FbxUInt pn);
1004 
1010  void FieldRead3F(const char* pFieldName, float* pValue, const float* pDefault=NULL);
1011 
1017  void FieldRead4F(const char* pFieldName, float* pValue, const float* pDefault=NULL);
1018 
1023  void FieldReadDn(double* pValue, FbxUInt pn);
1024 
1028  void FieldRead3D(double* pValue);
1029 
1033  void FieldRead4D(double* pValue);
1034 
1041  void FieldReadDn(const char* pFieldName, double* pValue, const double *pDefault, FbxUInt pn);
1042 
1048  void FieldRead3D(const char* pFieldName, double* pValue, const double* pDefault=NULL);
1049 
1055  void FieldRead4D(const char* pFieldName, double* pValue, const double* pDefault=NULL);
1056 
1060  void* FieldReadR(int* pByteSize);
1061 
1066  void* FieldReadR(const char* pFieldName,int* pByteSize);
1067 
1072  FbxChar FieldReadByte();
1074 
1079  FbxChar FieldReadByte(const char* pFieldName, FbxChar pDefault=0);
1080 
1082  FbxUChar FieldReadUByte();
1083 
1088  FbxUChar FieldReadUByte(const char* pFieldName, FbxUChar pDefault=0);
1089 
1091  FbxShort FieldReadShort();
1092 
1097  FbxShort FieldReadShort(const char* pFieldName, FbxShort pDefault=0);
1098 
1100  FbxUShort FieldReadUShort();
1101 
1106  FbxUShort FieldReadUShort(const char* pFieldName, FbxUShort pDefault=0);
1107 
1109  unsigned int FieldReadUI();
1110 
1115  unsigned int FieldReadUI(const char* pFieldName, unsigned int pDefault=0);
1116 
1118  FbxULongLong FieldReadULL();
1119 
1124  FbxULongLong FieldReadULL(const char* pFieldName, FbxULongLong pDefault=0);
1125 
1129  const FbxChar* FieldReadArraySBytes( int &pCount );
1133  const FbxShort* FieldReadArrayShort ( int &pCount );
1137  const FbxUShort* FieldReadArrayUShort( int &pCount );
1141  const unsigned int* FieldReadArrayUI ( int &pCount );
1145  const FbxULongLong* FieldReadArrayULL ( int &pCount );
1146 
1150  const FbxChar* FieldReadArray(int &pCount, const FbxChar*);
1157  const FbxShort* FieldReadArray(int &pCount, const FbxShort*);
1161  const FbxUShort* FieldReadArray(int &pCount, const FbxUShort*);
1165  const unsigned int* FieldReadArray(int &pCount, const unsigned int*);
1169  const FbxULongLong* FieldReadArray(int &pCount, const FbxULongLong*);
1171 
1183  virtual bool FieldReadEmbeddedFile(FbxString& pFileName, FbxString& pRelativeFileName,
1184  const char* pEmbeddedMediaDirectory = "", bool *pIsFileCreated = NULL,
1185  FbxClassId pExpectedTypeHint = FbxClassId());
1186 
1190  const double* FieldReadArrayD( int &pCount );
1194  const float* FieldReadArrayF( int &pCount );
1198  const int* FieldReadArrayI( int &pCount );
1202  const FbxLongLong*FieldReadArrayLL(int &pCount );
1206  const bool* FieldReadArrayB( int &pCount );
1210  const FbxUChar* FieldReadArrayBytes( int &pCount );
1211 
1215  const int* FieldReadArray(int& pCount, const int*);
1219  const float* FieldReadArray(int& pCount, const float*);
1223  const double* FieldReadArray(int& pCount, const double*);
1227  const FbxLongLong* FieldReadArray(int& pCount, const FbxLongLong*);
1231  const bool* FieldReadArray(int& pCount, const bool*);
1235  const FbxUChar* FieldReadArray(int& pCount, const FbxUChar*);
1236 
1238 
1244 
1248  void FieldWriteBegin(const char* pFieldName);
1249 
1251  void FieldWriteEnd();
1252 
1254  void FieldWriteBlockBegin();
1255 
1261  void FieldWriteObjectBegin(const char* pObjectType, const char* pName, const char* pSubType=NULL);
1262 
1264  void FieldWriteObjectEnd();
1265 
1270  void FieldWriteBlockBegin(const char* pFileName);
1271 
1273  void FieldWriteBlockEnd ();
1274 
1278  void FieldWriteCH(char pValue);
1279 
1284  void FieldWriteCH(const char* pFieldName, char pValue);
1285 
1289  void FieldWriteC(const char* pValue);
1290 
1295  void FieldWriteC(const char* pFieldName, const char* pValue);
1296 
1300  void FieldWriteS(const char* pValue);
1301 
1305  void FieldWriteS(const FbxString& pValue);
1306 
1311  void FieldWriteS(const char* pFieldName, const char* pValue);
1312 
1317  void FieldWriteS(const char* pFieldName, const FbxString& pValue);
1318 
1322  void FieldWriteB(bool pValue);
1323 
1328  void FieldWriteB(const char* pFieldName, bool pValue);
1329 
1333  void FieldWriteI(int pValue);
1334 
1339  void FieldWriteI(const char* pFieldName, int pValue);
1340 
1344  void FieldWriteLL(FbxLongLong pValue);
1345 
1350  void FieldWriteLL(const char* pFieldName, FbxLongLong pValue);
1351 
1356  void FieldWriteF(float pValue);
1357 
1363  void FieldWriteF(const char* pFieldName, float pValue);
1364 
1368  void FieldWriteD(double pValue);
1369 
1374  void FieldWriteD(const char* pFieldName, double pValue);
1375 
1379  void FieldWriteT(FbxTime pTime);
1380 
1385  void FieldWriteT(const char* pFieldName,FbxTime pValue);
1386 
1390  void FieldWriteTS(FbxTimeSpan pTimeSpan);
1391 
1396  void FieldWriteTS(const char* pFieldName,FbxTimeSpan pValue);
1397 
1402  void FieldWriteFn(const float* pValue, FbxUInt pn);
1403 
1409  void FieldWriteFn(const char* pFieldName, const float* pValue, FbxUInt pn);
1410 
1414  void FieldWrite3F(const float* pValue);
1415 
1420  void FieldWrite3F(const char* pFieldName, const float* pValue);
1421 
1425  void FieldWrite4F(const float* pValue);
1426 
1431  void FieldWrite4F(const char* pFieldName, const float* pValue);
1432 
1437  void FieldWriteDn(const double* pValue, FbxUInt pn);
1438 
1444  void FieldWriteDn(const char* pFieldName, const double* pValue, FbxUInt pn);
1445 
1449  void FieldWrite3D(const double* pValue);
1450 
1455  void FieldWrite3D(const char* pFieldName, const double* pValue);
1456 
1460  void FieldWrite4D(const double* pValue);
1461 
1466  void FieldWrite4D(const char* pFieldName, const double* pValue);
1467 
1468  // The maximum number of value entries is, in theory, 2**32. In practice it should be a lot less than that.
1469  // pSize is the number of values to write from each pointer location, and stride is how much we
1470  // advance to get to the next value; if the stride is zero, values are tighly packed together.
1471  // So in total we'll write n * pSize items.
1472 
1479  void FieldWriteArrayD( int n, const double* pValue, int pSize = 1, int pStride = 0 );
1486  void FieldWriteArrayF( int n, const float* pValue, int pSize = 1, int pStride = 0 );
1493  void FieldWriteArrayI( int n, const int* pValue, int pSize = 1, int pStride = 0 );
1500  void FieldWriteArrayLL(int n, const FbxLongLong* pValue, int pSize = 1, int pStride = 0 );
1507  void FieldWriteArrayB( int n, const bool* pValue, int pSize = 1, int pStride = 0 );
1514  void FieldWriteArrayBytes( int n, const FbxUChar* pValue, int pSize = 1, int pStride = 0 );
1515 
1520  void FieldWriteR(const void* pRawData, int pByteSize);
1521 
1527  void FieldWriteR(const char* pFieldName, const void* pRawData, int pByteSize);
1528 
1533 
1537  void FieldWriteByte(FbxChar pValue);
1538 
1543  void FieldWriteByte(const char* pFieldName, FbxChar pValue);
1544 
1548  void FieldWriteUByte(FbxUChar pValue);
1549 
1554  void FieldWriteUByte(const char* pFieldName, FbxUChar pValue);
1555 
1559  void FieldWriteShort(FbxShort pValue);
1560 
1565  void FieldWriteShort(const char* pFieldName, FbxShort pValue);
1566 
1570  void FieldWriteUShort(FbxUShort pValue);
1571 
1576  void FieldWriteUShort(const char* pFieldName, FbxUShort pValue);
1577 
1581  void FieldWriteUI(unsigned int pValue);
1582 
1587  void FieldWriteUI(const char* pFieldName, unsigned int pValue);
1588 
1592  void FieldWriteULL(FbxULongLong pValue);
1593 
1599  void FieldWriteULL(const char* pFieldName, FbxULongLong pValue);
1600 
1607  void FieldWriteArraySBytes( int n, const FbxChar* pValue, int pSize = 1, int pStride = 0 );
1614  void FieldWriteArrayShort( int n, const FbxShort* pValue, int pSize = 1, int pStride = 0 );
1621  void FieldWriteArrayUShort( int n, const FbxUShort* pValue, int pSize = 1, int pStride = 0 );
1628  void FieldWriteArrayUI( int n, const unsigned int* pValue, int pSize = 1, int pStride = 0 );
1635  void FieldWriteArrayULL(int n, const FbxULongLong* pValue, int pSize = 1, int pStride = 0 );
1637 
1641  int GetFieldRMaxChunkSize() const;
1642 
1646  void FieldWriteObjectReference(const char* pName);
1647 
1652  void FieldWriteObjectReference(const char* pFieldName, const char* pName);
1653 
1663  bool FieldWriteEmbeddedFile (FbxString pFileName, FbxString pRelativeFileName, FbxClassId pTypeHint = FbxClassId());
1664 
1668  void WriteComments(const char* pFieldName);
1669 
1671 
1672 #ifdef _DEBUG
1673  // Dump function for debugging purpose only
1674  void StdoutDump();
1675 #endif
1676 
1679  void SetEmbeddedFileCallback(FbxEmbeddedFileCallback* pCallbackObj);
1680 
1684  bool GetHaveEmbeddedFileCallback() const;
1685 
1693  bool GetHaveLoadedEmbededFile() const;
1694 
1699  void GetMemoryFileInfo(void** pMemPtr, size_t& pSize) const;
1700 
1704  bool IsBeforeVersion6() const;
1705 
1709  void SetIsBeforeVersion6(bool pIsBeforeVersion6);
1710 
1711 /*****************************************************************************************************************************
1712 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
1713 *****************************************************************************************************************************/
1714 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1715  bool ProjectOpen (FbxFile * pFile, FbxReader* pReader, bool pCheckCRC = false, bool pOpenMainSection = true, FbxIOFileHeaderInfo* pFileHeaderInfo = NULL);
1716  FbxStatus& GetStatus() { return mStatus; }
1717 
1718  int GetTCDefinition();
1719  bool NeedTCConversion();
1720 
1721 private:
1722  // to resolve warning C4512: 'class' : assignment operator could not be generated
1723  FbxIO& operator=(const FbxIO& pOther);
1724 
1725  FbxStatus& mStatus;
1726 
1727  struct InternalImpl;
1728  struct InternalImpl32;
1729  struct InternalImpl64;
1730  InternalImpl* mImpl;
1731 
1733 
1734  void ProjectClear();
1735  void ProjectReset();
1736 
1737  bool ProjectReadHeader(bool pCheckASCIIHeader, bool pCheckCRC, bool pOpenMainSection, FbxIOFileHeaderInfo* pFileHeaderInfo);
1738  bool ProjectReadExtendedHeader(FbxInt64& pExtendedHeaderEnd, FbxIOFileHeaderInfo* pFileHeaderInfo);
1739  bool BinaryReadHeader();
1740  bool BinaryReadSectionPosition();
1741  bool ASCIIReadHeader();
1742  bool ASCIIReadSectionPosition();
1743 
1744  bool ProjectWriteHeader(FbxIOFileHeaderInfo* pFileHeaderInfo);
1745  bool ProjectWriteExtendedHeader(FbxIOFileHeaderInfo* pFileHeaderInfo);
1746  void BinaryWriteHeader();
1747  void ASCIIWriteHeader();
1748 
1749  void ReadEncryptionKey(char* pEncryptionKey);
1750  void WriteEncryptionKey(char* pEncryptionKey);
1751 
1753 
1754  bool ProjectClearSection();
1755  bool ProjectOpenSection(int pSection);
1756  bool BinaryReadSectionHeader();
1757  FbxInt64 BinaryReadSectionFooter(unsigned char* pSourceCheck);
1758  bool BinaryReadExtensionCode(FbxInt64 pFollowingSectionStart, FbxInt64& pSectionStart, FbxUInt32& pSectionVersion);
1759  void BinaryReadSectionPassword();
1760 
1761  bool ProjectWriteSectionHeader();
1762  void BinaryWriteSectionFooter();
1763  bool BinaryWriteExtensionCode(FbxInt64 pSectionStart, FbxUInt32 pSectionVersion);
1764 
1765  FbxString GetCreationTime() const;
1766  FbxString GetMangledCreationTime() const;
1767  void SetCreationTime(FbxString pCreationTime);
1768  void CreateSourceCheck(unsigned char* lSourceCheck);
1769  bool TestSourceCheck(unsigned char* pSourceCheck, unsigned char* pSourceCompany);
1770  void EncryptSourceCheck(unsigned char* pSourceCheck, unsigned char* pEncryptionData);
1771  void DecryptSourceCheck(unsigned char* pSourceCheck, const unsigned char* pEncryptionData);
1772 
1773  void EncryptPasswordV1(FbxString pOriginalPassword, FbxString &pEncryptedPassword);
1774  void DecryptPasswordV1(FbxString pEncryptedPassword, FbxString &pDecryptedPassword);
1775 
1777 
1778  void CheckValidityOfFieldName(const char* pFieldName);
1779  void GetUnusedEmbeddedName(const FbxString& pDirectory, const FbxString& pName, FbxString& pResult, bool pCreateSubdirectory);
1780 
1782  FbxString GetDirectory(bool pAutoCreate, const char* pExtension);
1783 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
1784 };
1785 
1786 #include <fbxsdk/fbxsdk_nsend.h>
1787 
1788 #endif /* _FBXSDK_FILEIO_FBX_IO_H_ */
FbxUInt64 FbxULongLong
Definition: fbxtypes.h:93
unsigned int FbxUInt
Definition: fbxtypes.h:40
FbxLocalTime mCreationTimeStamp
Indicates whether the mCreationTimeStamp member variable contains the actual creation time of the fil...
Definition: fbxio.h:286
Callback to operate on the embedded data while it is processed.
Definition: fbxcallbacks.h:166
FbxAutoResetXRefManager(FbxIO *pFbx, FbxXRefManager &pXRefManager)
Default constructor.
Definition: fbxio.h:359
FBX SDK environment definition.
indicate not in a valid section
Definition: fbxio.h:199
~FbxAutoResetXRefManager()
Destructor.
Definition: fbxio.h:371
FbxString mResolutionMode
resolution mode.
Definition: fbxio.h:215
Abstract class for implementing I/O operations through a stream of data.
Definition: fbxstream.h:26
#define NULL
Definition: fbxarch.h:213
bool mPLE
The flag indicates that the header was created by a personal learning edition (PLE) of FBX...
Definition: fbxio.h:297
Utility class to manipulate strings.
Definition: fbxstring.h:66
Base class of other readers used internally.
Definition: fbxreader.h:65
indicate currently in the main section
Definition: fbxio.h:200
bool mCreationTimeStampPresent
Indicates whether a creation time stamp is preset.
Definition: fbxio.h:283
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:29
unsigned short FbxUShort
Definition: fbxtypes.h:38
double mResolutionW
resolution width.
Definition: fbxio.h:217
unsigned char FbxUChar
Definition: fbxtypes.h:36
int FbxFileVersionStrToInt(const char *pFileVersion)
Convert the FBX file version string to an integral number for <= or>= tests purposes.
void ProjectSetXRefManager(const FbxXRefManager *)
Provide the XRef Manager to use to create the .fbm folder.
Class to encapsulate time units.
Definition: fbxtime.h:44
signed short FbxShort
Definition: fbxtypes.h:37
Render and resolution information.
Definition: fbxio.h:207
FbxString mCreator
Indicates who is the creator of the file Ex: "FBX SDK/FBX Plugins version 2011.2".
Definition: fbxio.h:291
bool mBinary
Indicates whether the file is in binary or ASCII format.
Definition: fbxio.h:302
Base class of other writers used internally.
Definition: fbxwriter.h:59
This class manages external references to files.
Definition: fbxxref.h:30
static FbxIO * Create(BinaryType pBinaryType, FbxStatus &pStatus)
Creation function for this FbxIO class.
Definition: fbxio.h:390
const FbxXRefManager * ProjectGetXRefManager() const
Get the XRef Manager to use.
const FbxXRefManager * mXRefManager
Definition: fbxio.h:356
double mResolutionH
resolution height.
Definition: fbxio.h:219
signed long long FbxInt64
Definition: fbxtypes.h:81
Internal class used to differentiate objects during run-time.
Definition: fbxclassid.h:39
signed char FbxChar
Definition: fbxtypes.h:35
FBX header information used at beginning of the FBX file to get or set important values like the file...
Definition: fbxio.h:242
FbxIODefaultRenderResolution mDefaultRenderResolution
FbxIODefaultRenderResolution to handle default resolution values.
Definition: fbxio.h:271
FbxIO represents an FBX file.
Definition: fbxio.h:347
#define FBXSDK_DLL
Definition: fbxarch.h:176
FbxString mCameraName
camera name.
Definition: fbxio.h:213
int mFileVersion
Read only properties (not used for file write)
Definition: fbxio.h:280
unsigned int FbxUInt32
Definition: fbxtypes.h:80
Class for interfacing with files, providing a similar interface for files independant of the OS or fi...
Definition: fbxfile.h:27
Class to encapsulate time intervals.
Definition: fbxtime.h:510
BinaryType
Definition: fbxio.h:380
bool mIsOK
If the resolution data is ready.
Definition: fbxio.h:211
bool mIOPlugin
Indicates whether the file is created by a genuine Autodesk plug-in or not.
Definition: fbxio.h:294
FbxInt64 FbxLongLong
Definition: fbxtypes.h:92
unsigned long FbxULong
Definition: fbxtypes.h:90
indicate currently in the extention section 0
Definition: fbxio.h:201