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" 160 #define FBX_DEFAULT_FILE_VERSION FBX_FILE_VERSION_7500 161 #define FBX_DEFAULT_FILE_COMPATIBILITY FBX_2018_00_COMPATIBLE 244 virtual void Reset();
249 virtual bool ReadExtendedHeaderInformation(
FbxIO*);
423 bool ProjectOpenDirect(
const char* pName,
FbxReader* pReader,
bool pCheckCRC =
false,
bool pOpenMainSection =
true,
FbxIOFileHeaderInfo* pFileHeaderInfo =
NULL);
475 bool ProjectCreateEmpty(
const char* pName,
FbxWriter* pWriter,
int pVersion,
bool pBinary,
bool pEncrypted);
486 bool ProjectCreateEmpty(
FbxStream* pStream,
void* pStreamData,
FbxWriter* pWriter,
int pVersion,
bool pBinary,
bool pEncrypted);
491 bool ProjectWrite_BeginFileHeader();
496 bool ProjectWrite_BeginExtendedHeader();
507 bool ProjectWrite_EndExtendedHeader();
512 bool ProjectWrite_EndFileHeader();
519 bool ProjectClose(
void** pData=0,
size_t* pSize=0);
545 bool ProjectCreateEmbeddedFolder(
const FbxXRefManager& pXRefManager,
FbxString& pCreatedFolder,
const char* pUserDefinedFolder =
NULL);
550 void SetEmbedded(
bool pValue);
555 void SetEmbeddingExtractionFolder(
const char* pExtractionFolder);
559 const char* GetEmbeddingExtractionFolder();
564 bool IsEmbedded()
const;
569 bool IsBinary()
const;
574 bool IsEncrypted ()
const;
610 bool Fbx7Support()
const;
615 void Fbx7Support(
bool pSupport);
618 bool CompressArrays()
const;
623 void CompressArrays(
bool pCompress);
626 int CompressMinimumSize()
const;
631 void CompressMinimumSize(
int pSize);
634 int CompressLevel()
const;
641 void CompressLevel(
int pLevel);
653 bool ProjectOpenMainSection();
658 int ProjectGetExtensionSectionCount()
const;
664 bool ProjectOpenExtensionSection(
int pExtensionSectionIndex);
670 bool ProjectCreateExtensionSection(
bool pOverwriteLastExtensionSection =
false);
674 void ProjectCloseSection();
679 int ProjectGetCurrentSection()
const;
684 int ProjectGetCurrentSectionMode()
const;
689 int ProjectGetCurrentSectionVersion()
const;
698 int ProjectGetSectionVersion(
int pSection)
const;
706 static void ProjectConvertVersionNumber(
int pVersion,
int& pMajor,
int& pMinor,
int& pRevision);
711 bool IsPasswordProtected()
const;
718 bool CheckPassword(
const char* pPassword);
726 bool WritePassword(
const char* pPassword);
738 const char* GetFilename()
const;
744 FbxString GetDataDirectory(
bool pAutoCreate =
true);
754 FbxString GetMediaDirectory(
bool pCreate =
false,
const char* pUserDefinedFolder =
NULL);
761 FbxString GetContainerTemplateDirectory(
const char* pTemplateName,
bool pCreate);
767 char* GetRelativePath(
const char* pPath);
773 char* GetRelativeFilePath(
const char* pFilePath);
779 char* GetFullPath(
const char* pRelativePath);
785 char* GetFullFilePath(
const char* pRelativeFilePath);
791 char* GetTmpProjectName(
const char* pName)
const;
799 bool SwapFromTmpProject(
const char* pName,
char* pError=
NULL,
int pErrorSize=0);
811 void FieldReadResetPosition();
816 int FieldGetCount()
const;
822 const char* FieldGetName(
int pFieldIndex)
const;
828 int FieldGetInstanceCount(
const char* pFieldName)
const;
835 bool FieldReadBegin(
int pFieldIndex,
int pInstance);
841 bool FieldReadBegin(
const char* pFieldName);
848 bool FieldReadBegin(
const char* pFieldName,
int pInstance);
854 bool FieldReadIsBlock();
857 bool FieldReadBlockBegin();
860 void FieldReadBlockEnd();
863 int FieldReadGetCount()
const;
866 int FieldReadGetRemain()
const;
869 char FieldReadGetType()
const;
878 char FieldReadCH(
const char* pFieldName,
char pDefault=0);
881 const char* FieldReadC();
887 const char* FieldReadC(
const char* pFieldName,
const char* pDefault=
"");
890 const char* FieldReadS();
896 const char* FieldReadS(
const char* pFieldName,
const char* pDefault=
"");
905 bool FieldReadB(
const char* pFieldName,
bool pDefault =
false);
909 int FieldReadI(
const char* pFieldName,
int pDefault=0);
931 float FieldReadF(
const char* pFieldName,
float pDefault=0);
940 double FieldReadD(
const char* pFieldName,
double pDefault=0);
945 FbxTime FieldReadT(
const char* pFieldName);
962 void FieldReadFn(
float* pValue,
FbxUInt pn);
967 void FieldRead3F(
float* pValue);
972 void FieldRead4F(
float* pValue);
980 void FieldReadFn(
const char* pFieldName,
float* pValue,
const float *pDefault,
FbxUInt pn);
987 void FieldRead3F(
const char* pFieldName,
float* pValue,
const float* pDefault=
NULL);
994 void FieldRead4F(
const char* pFieldName,
float* pValue,
const float* pDefault=
NULL);
1000 void FieldReadDn(
double* pValue,
FbxUInt pn);
1005 void FieldRead3D(
double* pValue);
1010 void FieldRead4D(
double* pValue);
1018 void FieldReadDn(
const char* pFieldName,
double* pValue,
const double *pDefault,
FbxUInt pn);
1025 void FieldRead3D(
const char* pFieldName,
double* pValue,
const double* pDefault=
NULL);
1032 void FieldRead4D(
const char* pFieldName,
double* pValue,
const double* pDefault=
NULL);
1037 void* FieldReadR(
int* pByteSize);
1043 void* FieldReadR(
const char* pFieldName,
int* pByteSize);
1056 FbxChar FieldReadByte(
const char* pFieldName,
FbxChar pDefault=0);
1086 unsigned int FieldReadUI();
1092 unsigned int FieldReadUI(
const char* pFieldName,
unsigned int pDefault=0);
1106 const FbxChar* FieldReadArraySBytes(
int &pCount );
1110 const FbxShort* FieldReadArrayShort (
int &pCount );
1114 const FbxUShort* FieldReadArrayUShort(
int &pCount );
1118 const unsigned int* FieldReadArrayUI (
int &pCount );
1142 const unsigned int* FieldReadArray(
int &pCount,
const unsigned int*);
1157 virtual bool FieldReadEmbeddedFile (
FbxString& pFileName,
FbxString& pRelativeFileName,
const char* pEmbeddedMediaDirectory =
"",
bool *pIsFileCreated=
NULL);
1162 const double* FieldReadArrayD(
int &pCount );
1166 const float* FieldReadArrayF(
int &pCount );
1170 const int* FieldReadArrayI(
int &pCount );
1178 const bool* FieldReadArrayB(
int &pCount );
1182 const FbxUChar* FieldReadArrayBytes(
int &pCount );
1187 const int* FieldReadArray(
int& pCount,
const int*);
1191 const float* FieldReadArray(
int& pCount,
const float*);
1195 const double* FieldReadArray(
int& pCount,
const double*);
1203 const bool* FieldReadArray(
int& pCount,
const bool*);
1220 void FieldWriteBegin(
const char* pFieldName);
1223 void FieldWriteEnd();
1226 void FieldWriteBlockBegin();
1233 void FieldWriteObjectBegin(
const char* pObjectType,
const char* pName,
const char* pSubType=
NULL);
1236 void FieldWriteObjectEnd();
1242 void FieldWriteBlockBegin(
const char* pFileName);
1245 void FieldWriteBlockEnd ();
1250 void FieldWriteCH(
char pValue);
1256 void FieldWriteCH(
const char* pFieldName,
char pValue);
1261 void FieldWriteC(
const char* pValue);
1267 void FieldWriteC(
const char* pFieldName,
const char* pValue);
1272 void FieldWriteS(
const char* pValue);
1277 void FieldWriteS(
const FbxString& pValue);
1283 void FieldWriteS(
const char* pFieldName,
const char* pValue);
1289 void FieldWriteS(
const char* pFieldName,
const FbxString& pValue);
1294 void FieldWriteB(
bool pValue);
1300 void FieldWriteB(
const char* pFieldName,
bool pValue);
1305 void FieldWriteI(
int pValue);
1311 void FieldWriteI(
const char* pFieldName,
int pValue);
1322 void FieldWriteLL(
const char* pFieldName,
FbxLongLong pValue);
1328 void FieldWriteF(
float pValue);
1335 void FieldWriteF(
const char* pFieldName,
float pValue);
1340 void FieldWriteD(
double pValue);
1346 void FieldWriteD(
const char* pFieldName,
double pValue);
1351 void FieldWriteT(
FbxTime pTime);
1357 void FieldWriteT(
const char* pFieldName,
FbxTime pValue);
1368 void FieldWriteTS(
const char* pFieldName,
FbxTimeSpan pValue);
1374 void FieldWriteFn(
const float* pValue,
FbxUInt pn);
1381 void FieldWriteFn(
const char* pFieldName,
const float* pValue,
FbxUInt pn);
1386 void FieldWrite3F(
const float* pValue);
1392 void FieldWrite3F(
const char* pFieldName,
const float* pValue);
1397 void FieldWrite4F(
const float* pValue);
1403 void FieldWrite4F(
const char* pFieldName,
const float* pValue);
1409 void FieldWriteDn(
const double* pValue,
FbxUInt pn);
1416 void FieldWriteDn(
const char* pFieldName,
const double* pValue,
FbxUInt pn);
1421 void FieldWrite3D(
const double* pValue);
1427 void FieldWrite3D(
const char* pFieldName,
const double* pValue);
1432 void FieldWrite4D(
const double* pValue);
1438 void FieldWrite4D(
const char* pFieldName,
const double* pValue);
1451 void FieldWriteArrayD(
int n,
const double* pValue,
int pSize = 1,
int pStride = 0 );
1458 void FieldWriteArrayF(
int n,
const float* pValue,
int pSize = 1,
int pStride = 0 );
1465 void FieldWriteArrayI(
int n,
const int* pValue,
int pSize = 1,
int pStride = 0 );
1472 void FieldWriteArrayLL(
int n,
const FbxLongLong* pValue,
int pSize = 1,
int pStride = 0 );
1479 void FieldWriteArrayB(
int n,
const bool* pValue,
int pSize = 1,
int pStride = 0 );
1486 void FieldWriteArrayBytes(
int n,
const FbxUChar* pValue,
int pSize = 1,
int pStride = 0 );
1492 void FieldWriteR(
const void* pRawData,
int pByteSize);
1499 void FieldWriteR(
const char* pFieldName,
const void* pRawData,
int pByteSize);
1509 void FieldWriteByte(
FbxChar pValue);
1515 void FieldWriteByte(
const char* pFieldName,
FbxChar pValue);
1520 void FieldWriteUByte(
FbxUChar pValue);
1526 void FieldWriteUByte(
const char* pFieldName,
FbxUChar pValue);
1531 void FieldWriteShort(
FbxShort pValue);
1537 void FieldWriteShort(
const char* pFieldName,
FbxShort pValue);
1542 void FieldWriteUShort(
FbxUShort pValue);
1548 void FieldWriteUShort(
const char* pFieldName,
FbxUShort pValue);
1553 void FieldWriteUI(
unsigned int pValue);
1559 void FieldWriteUI(
const char* pFieldName,
unsigned int pValue);
1571 void FieldWriteULL(
const char* pFieldName,
FbxULongLong pValue);
1579 void FieldWriteArraySBytes(
int n,
const FbxChar* pValue,
int pSize = 1,
int pStride = 0 );
1586 void FieldWriteArrayShort(
int n,
const FbxShort* pValue,
int pSize = 1,
int pStride = 0 );
1593 void FieldWriteArrayUShort(
int n,
const FbxUShort* pValue,
int pSize = 1,
int pStride = 0 );
1600 void FieldWriteArrayUI(
int n,
const unsigned int* pValue,
int pSize = 1,
int pStride = 0 );
1607 void FieldWriteArrayULL(
int n,
const FbxULongLong* pValue,
int pSize = 1,
int pStride = 0 );
1613 int GetFieldRMaxChunkSize()
const;
1618 void FieldWriteObjectReference(
const char* pName);
1624 void FieldWriteObjectReference(
const char* pFieldName,
const char* pName);
1637 void WriteComments(
const char* pFieldName);
1653 bool GetHaveLoadedEmbededFile()
const;
1659 void GetMemoryFileInfo(
void** pMemPtr,
size_t& pSize)
const;
1664 bool IsBeforeVersion6()
const;
1669 void SetIsBeforeVersion6(
bool pIsBeforeVersion6);
1674 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1676 FbxStatus& GetStatus() {
return mStatus; }
1680 FbxIO& operator=(
const FbxIO& pOther);
1684 struct InternalImpl;
1685 struct InternalImpl32;
1686 struct InternalImpl64;
1687 InternalImpl* mImpl;
1691 void ProjectClear();
1692 void ProjectReset();
1694 bool ProjectReadHeader(
bool pCheckASCIIHeader,
bool pCheckCRC,
bool pOpenMainSection,
FbxIOFileHeaderInfo* pFileHeaderInfo);
1696 bool BinaryReadHeader();
1697 bool BinaryReadSectionPosition();
1698 bool ASCIIReadHeader();
1699 bool ASCIIReadSectionPosition();
1703 void BinaryWriteHeader();
1704 void ASCIIWriteHeader();
1706 void ReadEncryptionKey(
char* pEncryptionKey);
1707 void WriteEncryptionKey(
char* pEncryptionKey);
1711 bool ProjectClearSection();
1712 bool ProjectOpenSection(
int pSection);
1713 bool BinaryReadSectionHeader();
1714 FbxInt64 BinaryReadSectionFooter(
char* pSourceCheck);
1716 void BinaryReadSectionPassword();
1718 bool ProjectWriteSectionHeader();
1719 void BinaryWriteSectionFooter();
1720 bool BinaryWriteExtensionCode(
FbxInt64 pSectionStart,
FbxUInt32 pSectionVersion);
1723 void SetCreationTime(
FbxString pCreationTime);
1724 void CreateSourceCheck(
char* lSourceCheck);
1725 bool TestSourceCheck(
char* pSourceCheck,
char* pSourceCompany);
1727 void EncryptSourceCheck(
char* pSourceCheck,
char* pEncryptionData);
1728 void DecryptSourceCheck(
char* pSourceCheck,
const char* pEncryptionData);
1735 void CheckValidityOfFieldName(
const char* pFieldName);
1739 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.