13 #ifndef _FBXSDK_FILEIO_FBX_IO_H_ 14 #define _FBXSDK_FILEIO_FBX_IO_H_ 123 #define FBX_FILE_VERSION_2000 2000 //FBX 2.0 124 #define FBX_FILE_VERSION_2001 2001 //FBX 2.01 125 #define FBX_FILE_VERSION_3000 3000 //FBX 3.0 126 #define FBX_FILE_VERSION_3001 3001 //FBX 3.01 127 #define FBX_FILE_VERSION_4000 4000 //FBX 4.0 128 #define FBX_FILE_VERSION_4001 4001 //FBX 4.01 129 #define FBX_FILE_VERSION_4050 4050 //FBX 4.5 130 #define FBX_FILE_VERSION_5000 5000 //FBX 5.0 131 #define FBX_FILE_VERSION_5800 5800 //FBX 5.8 132 #define FBX_FILE_VERSION_6000 6000 //FBX 6.0 133 #define FBX_FILE_VERSION_6100 6100 //FBX 6.1 (guarantee compatibility with Autodesk 2010 products) 134 #define FBX_FILE_VERSION_7000 7000 //Compatible with 7.1, and taken as such 135 #define FBX_FILE_VERSION_7099 7099 //Compatible with 7.1, and taken as such 136 #define FBX_FILE_VERSION_7100 7100 //FBX 7.1 (guarantee compatibility with Autodesk 2011 products) 137 #define FBX_FILE_VERSION_7200 7200 //FBX 7.2 (guarantee compatibility with Autodesk 2012 products) 138 #define FBX_FILE_VERSION_7300 7300 //FBX 7.3 (guarantee compatibility with Autodesk 2013 products) 139 #define FBX_FILE_VERSION_7400 7400 //FBX 7.4 (guarantee compatibility with Autodesk 2014/2015 products) 140 #define FBX_FILE_VERSION_7500 7500 //FBX 7.5 (guarantee compatibility with Autodesk 2016 products) 143 #define FBX_53_MB55_COMPATIBLE "FBX53_MB55" 144 #define FBX_60_COMPATIBLE "FBX60_MB60" 145 #define FBX_2005_08_COMPATIBLE "FBX200508_MB70" 146 #define FBX_2006_02_COMPATIBLE "FBX200602_MB75" 147 #define FBX_2006_08_COMPATIBLE "FBX200608" 148 #define FBX_2006_11_COMPATIBLE "FBX200611" 149 #define FBX_2009_00_COMPATIBLE "FBX200900" 150 #define FBX_2009_00_V7_COMPATIBLE "FBX200900v7" 151 #define FBX_2010_00_COMPATIBLE "FBX201000" 152 #define FBX_2011_00_COMPATIBLE "FBX201100" 153 #define FBX_2012_00_COMPATIBLE "FBX201200" 154 #define FBX_2013_00_COMPATIBLE "FBX201300" 155 #define FBX_2014_00_COMPATIBLE "FBX201400" 156 #define FBX_2016_00_COMPATIBLE "FBX201600" 157 #define FBX_2018_00_COMPATIBLE "FBX201800" 158 #define FBX_2019_00_COMPATIBLE "FBX201900" 161 #define FBX_DEFAULT_FILE_VERSION FBX_FILE_VERSION_7500 162 #define FBX_DEFAULT_FILE_COMPATIBILITY FBX_2019_00_COMPATIBLE 245 virtual void Reset();
250 virtual bool ReadExtendedHeaderInformation(
FbxIO*);
424 bool ProjectOpenDirect(
const char* pName,
FbxReader* pReader,
bool pCheckCRC =
false,
bool pOpenMainSection =
true,
FbxIOFileHeaderInfo* pFileHeaderInfo =
NULL);
476 bool ProjectCreateEmpty(
const char* pName,
FbxWriter* pWriter,
int pVersion,
bool pBinary,
bool pEncrypted);
487 bool ProjectCreateEmpty(
FbxStream* pStream,
void* pStreamData,
FbxWriter* pWriter,
int pVersion,
bool pBinary,
bool pEncrypted);
492 bool ProjectWrite_BeginFileHeader();
497 bool ProjectWrite_BeginExtendedHeader();
508 bool ProjectWrite_EndExtendedHeader();
513 bool ProjectWrite_EndFileHeader();
520 bool ProjectClose(
void** pData=0,
size_t* pSize=0);
546 bool ProjectCreateEmbeddedFolder(
const FbxXRefManager& pXRefManager,
FbxString& pCreatedFolder,
const char* pUserDefinedFolder =
NULL);
551 void SetEmbedded(
bool pValue);
556 void SetEmbeddingExtractionFolder(
const char* pExtractionFolder);
560 const char* GetEmbeddingExtractionFolder();
565 bool IsEmbedded()
const;
570 bool IsBinary()
const;
575 bool IsEncrypted ()
const;
611 bool Fbx7Support()
const;
616 void Fbx7Support(
bool pSupport);
619 bool CompressArrays()
const;
624 void CompressArrays(
bool pCompress);
627 int CompressMinimumSize()
const;
632 void CompressMinimumSize(
int pSize);
635 int CompressLevel()
const;
642 void CompressLevel(
int pLevel);
654 bool ProjectOpenMainSection();
659 int ProjectGetExtensionSectionCount()
const;
665 bool ProjectOpenExtensionSection(
int pExtensionSectionIndex);
671 bool ProjectCreateExtensionSection(
bool pOverwriteLastExtensionSection =
false);
675 void ProjectCloseSection();
680 int ProjectGetCurrentSection()
const;
685 int ProjectGetCurrentSectionMode()
const;
690 int ProjectGetCurrentSectionVersion()
const;
699 int ProjectGetSectionVersion(
int pSection)
const;
707 static void ProjectConvertVersionNumber(
int pVersion,
int& pMajor,
int& pMinor,
int& pRevision);
712 bool IsPasswordProtected()
const;
719 bool CheckPassword(
const char* pPassword);
727 bool WritePassword(
const char* pPassword);
739 const char* GetFilename()
const;
745 FbxString GetDataDirectory(
bool pAutoCreate =
true);
755 FbxString GetMediaDirectory(
bool pCreate =
false,
const char* pUserDefinedFolder =
NULL);
762 FbxString GetContainerTemplateDirectory(
const char* pTemplateName,
bool pCreate);
768 char* GetRelativePath(
const char* pPath);
774 char* GetRelativeFilePath(
const char* pFilePath);
780 char* GetFullPath(
const char* pRelativePath);
786 char* GetFullFilePath(
const char* pRelativeFilePath);
792 char* GetTmpProjectName(
const char* pName)
const;
800 bool SwapFromTmpProject(
const char* pName,
char* pError=
NULL,
int pErrorSize=0);
812 void FieldReadResetPosition();
817 int FieldGetCount()
const;
823 const char* FieldGetName(
int pFieldIndex)
const;
829 int FieldGetInstanceCount(
const char* pFieldName)
const;
836 bool FieldReadBegin(
int pFieldIndex,
int pInstance);
842 bool FieldReadBegin(
const char* pFieldName);
849 bool FieldReadBegin(
const char* pFieldName,
int pInstance);
855 bool FieldReadIsBlock();
858 bool FieldReadBlockBegin();
861 void FieldReadBlockEnd();
864 int FieldReadGetCount()
const;
867 int FieldReadGetRemain()
const;
870 char FieldReadGetType()
const;
879 char FieldReadCH(
const char* pFieldName,
char pDefault=0);
882 const char* FieldReadC();
888 const char* FieldReadC(
const char* pFieldName,
const char* pDefault=
"");
891 const char* FieldReadS();
897 const char* FieldReadS(
const char* pFieldName,
const char* pDefault=
"");
906 bool FieldReadB(
const char* pFieldName,
bool pDefault =
false);
910 int FieldReadI(
const char* pFieldName,
int pDefault=0);
932 float FieldReadF(
const char* pFieldName,
float pDefault=0);
941 double FieldReadD(
const char* pFieldName,
double pDefault=0);
946 FbxTime FieldReadT(
const char* pFieldName);
963 void FieldReadFn(
float* pValue,
FbxUInt pn);
968 void FieldRead3F(
float* pValue);
973 void FieldRead4F(
float* pValue);
981 void FieldReadFn(
const char* pFieldName,
float* pValue,
const float *pDefault,
FbxUInt pn);
988 void FieldRead3F(
const char* pFieldName,
float* pValue,
const float* pDefault=
NULL);
995 void FieldRead4F(
const char* pFieldName,
float* pValue,
const float* pDefault=
NULL);
1001 void FieldReadDn(
double* pValue,
FbxUInt pn);
1006 void FieldRead3D(
double* pValue);
1011 void FieldRead4D(
double* pValue);
1019 void FieldReadDn(
const char* pFieldName,
double* pValue,
const double *pDefault,
FbxUInt pn);
1026 void FieldRead3D(
const char* pFieldName,
double* pValue,
const double* pDefault=
NULL);
1033 void FieldRead4D(
const char* pFieldName,
double* pValue,
const double* pDefault=
NULL);
1038 void* FieldReadR(
int* pByteSize);
1044 void* FieldReadR(
const char* pFieldName,
int* pByteSize);
1057 FbxChar FieldReadByte(
const char* pFieldName,
FbxChar pDefault=0);
1087 unsigned int FieldReadUI();
1093 unsigned int FieldReadUI(
const char* pFieldName,
unsigned int pDefault=0);
1107 const FbxChar* FieldReadArraySBytes(
int &pCount );
1111 const FbxShort* FieldReadArrayShort (
int &pCount );
1115 const FbxUShort* FieldReadArrayUShort(
int &pCount );
1119 const unsigned int* FieldReadArrayUI (
int &pCount );
1143 const unsigned int* FieldReadArray(
int &pCount,
const unsigned int*);
1158 virtual bool FieldReadEmbeddedFile (
FbxString& pFileName,
FbxString& pRelativeFileName,
const char* pEmbeddedMediaDirectory =
"",
bool *pIsFileCreated=
NULL);
1163 const double* FieldReadArrayD(
int &pCount );
1167 const float* FieldReadArrayF(
int &pCount );
1171 const int* FieldReadArrayI(
int &pCount );
1179 const bool* FieldReadArrayB(
int &pCount );
1183 const FbxUChar* FieldReadArrayBytes(
int &pCount );
1188 const int* FieldReadArray(
int& pCount,
const int*);
1192 const float* FieldReadArray(
int& pCount,
const float*);
1196 const double* FieldReadArray(
int& pCount,
const double*);
1204 const bool* FieldReadArray(
int& pCount,
const bool*);
1221 void FieldWriteBegin(
const char* pFieldName);
1224 void FieldWriteEnd();
1227 void FieldWriteBlockBegin();
1234 void FieldWriteObjectBegin(
const char* pObjectType,
const char* pName,
const char* pSubType=
NULL);
1237 void FieldWriteObjectEnd();
1243 void FieldWriteBlockBegin(
const char* pFileName);
1246 void FieldWriteBlockEnd ();
1251 void FieldWriteCH(
char pValue);
1257 void FieldWriteCH(
const char* pFieldName,
char pValue);
1262 void FieldWriteC(
const char* pValue);
1268 void FieldWriteC(
const char* pFieldName,
const char* pValue);
1273 void FieldWriteS(
const char* pValue);
1278 void FieldWriteS(
const FbxString& pValue);
1284 void FieldWriteS(
const char* pFieldName,
const char* pValue);
1290 void FieldWriteS(
const char* pFieldName,
const FbxString& pValue);
1295 void FieldWriteB(
bool pValue);
1301 void FieldWriteB(
const char* pFieldName,
bool pValue);
1306 void FieldWriteI(
int pValue);
1312 void FieldWriteI(
const char* pFieldName,
int pValue);
1323 void FieldWriteLL(
const char* pFieldName,
FbxLongLong pValue);
1329 void FieldWriteF(
float pValue);
1336 void FieldWriteF(
const char* pFieldName,
float pValue);
1341 void FieldWriteD(
double pValue);
1347 void FieldWriteD(
const char* pFieldName,
double pValue);
1352 void FieldWriteT(
FbxTime pTime);
1358 void FieldWriteT(
const char* pFieldName,
FbxTime pValue);
1369 void FieldWriteTS(
const char* pFieldName,
FbxTimeSpan pValue);
1375 void FieldWriteFn(
const float* pValue,
FbxUInt pn);
1382 void FieldWriteFn(
const char* pFieldName,
const float* pValue,
FbxUInt pn);
1387 void FieldWrite3F(
const float* pValue);
1393 void FieldWrite3F(
const char* pFieldName,
const float* pValue);
1398 void FieldWrite4F(
const float* pValue);
1404 void FieldWrite4F(
const char* pFieldName,
const float* pValue);
1410 void FieldWriteDn(
const double* pValue,
FbxUInt pn);
1417 void FieldWriteDn(
const char* pFieldName,
const double* pValue,
FbxUInt pn);
1422 void FieldWrite3D(
const double* pValue);
1428 void FieldWrite3D(
const char* pFieldName,
const double* pValue);
1433 void FieldWrite4D(
const double* pValue);
1439 void FieldWrite4D(
const char* pFieldName,
const double* pValue);
1452 void FieldWriteArrayD(
int n,
const double* pValue,
int pSize = 1,
int pStride = 0 );
1459 void FieldWriteArrayF(
int n,
const float* pValue,
int pSize = 1,
int pStride = 0 );
1466 void FieldWriteArrayI(
int n,
const int* pValue,
int pSize = 1,
int pStride = 0 );
1473 void FieldWriteArrayLL(
int n,
const FbxLongLong* pValue,
int pSize = 1,
int pStride = 0 );
1480 void FieldWriteArrayB(
int n,
const bool* pValue,
int pSize = 1,
int pStride = 0 );
1487 void FieldWriteArrayBytes(
int n,
const FbxUChar* pValue,
int pSize = 1,
int pStride = 0 );
1493 void FieldWriteR(
const void* pRawData,
int pByteSize);
1500 void FieldWriteR(
const char* pFieldName,
const void* pRawData,
int pByteSize);
1510 void FieldWriteByte(
FbxChar pValue);
1516 void FieldWriteByte(
const char* pFieldName,
FbxChar pValue);
1521 void FieldWriteUByte(
FbxUChar pValue);
1527 void FieldWriteUByte(
const char* pFieldName,
FbxUChar pValue);
1532 void FieldWriteShort(
FbxShort pValue);
1538 void FieldWriteShort(
const char* pFieldName,
FbxShort pValue);
1543 void FieldWriteUShort(
FbxUShort pValue);
1549 void FieldWriteUShort(
const char* pFieldName,
FbxUShort pValue);
1554 void FieldWriteUI(
unsigned int pValue);
1560 void FieldWriteUI(
const char* pFieldName,
unsigned int pValue);
1572 void FieldWriteULL(
const char* pFieldName,
FbxULongLong pValue);
1580 void FieldWriteArraySBytes(
int n,
const FbxChar* pValue,
int pSize = 1,
int pStride = 0 );
1587 void FieldWriteArrayShort(
int n,
const FbxShort* pValue,
int pSize = 1,
int pStride = 0 );
1594 void FieldWriteArrayUShort(
int n,
const FbxUShort* pValue,
int pSize = 1,
int pStride = 0 );
1601 void FieldWriteArrayUI(
int n,
const unsigned int* pValue,
int pSize = 1,
int pStride = 0 );
1608 void FieldWriteArrayULL(
int n,
const FbxULongLong* pValue,
int pSize = 1,
int pStride = 0 );
1614 int GetFieldRMaxChunkSize()
const;
1619 void FieldWriteObjectReference(
const char* pName);
1625 void FieldWriteObjectReference(
const char* pFieldName,
const char* pName);
1638 void WriteComments(
const char* pFieldName);
1654 bool GetHaveLoadedEmbededFile()
const;
1660 void GetMemoryFileInfo(
void** pMemPtr,
size_t& pSize)
const;
1665 bool IsBeforeVersion6()
const;
1670 void SetIsBeforeVersion6(
bool pIsBeforeVersion6);
1675 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1677 FbxStatus& GetStatus() {
return mStatus; }
1685 struct InternalImpl;
1686 struct InternalImpl32;
1687 struct InternalImpl64;
1688 InternalImpl* mImpl;
1692 void ProjectClear();
1693 void ProjectReset();
1695 bool ProjectReadHeader(
bool pCheckASCIIHeader,
bool pCheckCRC,
bool pOpenMainSection,
FbxIOFileHeaderInfo* pFileHeaderInfo);
1697 bool BinaryReadHeader();
1698 bool BinaryReadSectionPosition();
1699 bool ASCIIReadHeader();
1700 bool ASCIIReadSectionPosition();
1704 void BinaryWriteHeader();
1705 void ASCIIWriteHeader();
1707 void ReadEncryptionKey(
char* pEncryptionKey);
1708 void WriteEncryptionKey(
char* pEncryptionKey);
1712 bool ProjectClearSection();
1713 bool ProjectOpenSection(
int pSection);
1714 bool BinaryReadSectionHeader();
1715 FbxInt64 BinaryReadSectionFooter(
char* pSourceCheck);
1717 void BinaryReadSectionPassword();
1719 bool ProjectWriteSectionHeader();
1720 void BinaryWriteSectionFooter();
1721 bool BinaryWriteExtensionCode(
FbxInt64 pSectionStart,
FbxUInt32 pSectionVersion);
1724 void SetCreationTime(
FbxString pCreationTime);
1725 void CreateSourceCheck(
char* lSourceCheck);
1726 bool TestSourceCheck(
char* pSourceCheck,
char* pSourceCompany);
1728 void EncryptSourceCheck(
char* pSourceCheck,
char* pEncryptionData);
1729 void DecryptSourceCheck(
char* pSourceCheck,
const char* pEncryptionData);
1736 void CheckValidityOfFieldName(
const char* pFieldName);
1740 FbxString GetDirectory(
bool pAutoCreate,
const char* pExtension);
FbxAutoResetXRefManager(FbxIO *pFbx, FbxXRefManager &pXRefManager)
Default constructor.
FBX SDK environment definition.
const FbxXRefManager * ProjectGetXRefManager() const
Get the XRef Manager to use.
~FbxAutoResetXRefManager()
Destructor.
FbxString mResolutionMode
resolution mode.
Abstract class for implementing I/O operations through a stream of data.
Utility class to manipulate strings.
Base class of other readers used internally.
This class facilitates the testing/reporting of errors.
double mResolutionW
resolution width.
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.
Render and resolution information.
indicate not in a valid section
Base class of other writers used internally.
This class manages external references to files.
static FbxIO * Create(BinaryType pBinaryType, FbxStatus &pStatus)
Creation function for this FbxIO class.
const FbxXRefManager * mXRefManager
double mResolutionH
resolution height.
indicate currently in the main section
signed long long FbxInt64
indicate currently in the extention section 0
FbxIO represents an FBX file.
FbxString mCameraName
camera name.
Class for interfacing with files, providing a similar interface for files independant of the OS or fi...
Class to encapsulate time intervals.
bool mIsOK
If the resolution data is ready.