13 #ifndef _FBXSDK_FILEIO_FBX_IO_H_
14 #define _FBXSDK_FILEIO_FBX_IO_H_
120 #define FBX_FILE_VERSION_2000 2000 //FBX 2.0
121 #define FBX_FILE_VERSION_2001 2001 //FBX 2.01
122 #define FBX_FILE_VERSION_3000 3000 //FBX 3.0
123 #define FBX_FILE_VERSION_3001 3001 //FBX 3.01
124 #define FBX_FILE_VERSION_4000 4000 //FBX 4.0
125 #define FBX_FILE_VERSION_4001 4001 //FBX 4.01
126 #define FBX_FILE_VERSION_4050 4050 //FBX 4.5
127 #define FBX_FILE_VERSION_5000 5000 //FBX 5.0
128 #define FBX_FILE_VERSION_5800 5800 //FBX 5.8
129 #define FBX_FILE_VERSION_6000 6000 //FBX 6.0
130 #define FBX_FILE_VERSION_6100 6100 //FBX 6.1 (guarantee compatibility with Autodesk 2010 products)
131 #define FBX_FILE_VERSION_7000 7000 //Compatible with 7.1, and taken as such
132 #define FBX_FILE_VERSION_7099 7099 //Compatible with 7.1, and taken as such
133 #define FBX_FILE_VERSION_7100 7100 //FBX 7.1 (guarantee compatibility with Autodesk 2011 products)
134 #define FBX_FILE_VERSION_7200 7200 //FBX 7.2 (guarantee compatibility with Autodesk 2012 products)
135 #define FBX_FILE_VERSION_7300 7300 //FBX 7.3 (guarantee compatibility with Autodesk 2013 products)
136 #define FBX_FILE_VERSION_7400 7400 //FBX 7.4 (guarantee compatibility with Autodesk 2014 products)
139 #define FBX_DEFAULT_FILE_VERSION FBX_FILE_VERSION_7400
142 #define FBX_53_MB55_COMPATIBLE "FBX53_MB55"
143 #define FBX_60_COMPATIBLE "FBX60_MB60"
144 #define FBX_2005_08_COMPATIBLE "FBX200508_MB70"
145 #define FBX_2006_02_COMPATIBLE "FBX200602_MB75"
146 #define FBX_2006_08_COMPATIBLE "FBX200608"
147 #define FBX_2006_11_COMPATIBLE "FBX200611"
148 #define FBX_2009_00_COMPATIBLE "FBX200900"
149 #define FBX_2009_00_V7_COMPATIBLE "FBX200900v7"
150 #define FBX_2010_00_COMPATIBLE "FBX201000"
151 #define FBX_2011_00_COMPATIBLE "FBX201100"
152 #define FBX_2012_00_COMPATIBLE "FBX201200"
153 #define FBX_2013_00_COMPATIBLE "FBX201300"
154 #define FBX_2014_00_COMPATIBLE "FBX201400"
237 virtual void Reset();
242 virtual bool ReadExtendedHeaderInformation(
FbxIO*);
336 mXRefManager = mFbx->ProjectGetXRefManager();
337 mFbx->ProjectSetXRefManager(&pXRefManager);
346 mFbx->ProjectSetXRefManager(mXRefManager);
410 bool ProjectOpenDirect(
const char* pName,
FbxReader* pReader,
bool pCheckCRC =
false,
bool pOpenMainSection =
true,
FbxIOFileHeaderInfo* pFileHeaderInfo =
NULL);
462 bool ProjectCreateEmpty(
const char* pName,
FbxWriter* pWriter,
int pVersion,
bool pBinary,
bool pEncrypted);
473 bool ProjectCreateEmpty(
FbxStream* pStream,
void* pStreamData,
FbxWriter* pWriter,
int pVersion,
bool pBinary,
bool pEncrypted);
478 bool ProjectWrite_BeginFileHeader();
483 bool ProjectWrite_BeginExtendedHeader();
494 bool ProjectWrite_EndExtendedHeader();
499 bool ProjectWrite_EndFileHeader();
506 bool ProjectClose(
void** pData=0,
size_t* pSize=0);
532 bool ProjectCreateEmbeddedFolder(
const FbxXRefManager& pXRefManager,
FbxString& pCreatedFolder,
const char* pUserDefinedFolder =
NULL);
537 void SetEmbedded(
bool pValue);
542 void SetEmbeddingExtractionFolder(
const char* pExtractionFolder);
546 const char* GetEmbeddingExtractionFolder();
551 bool IsEmbedded()
const;
556 bool IsBinary()
const;
561 bool IsEncrypted ()
const;
597 bool Fbx7Support()
const;
602 void Fbx7Support(
bool pSupport);
605 bool CompressArrays()
const;
610 void CompressArrays(
bool pCompress);
613 int CompressMinimumSize()
const;
618 void CompressMinimumSize(
int pSize);
621 int CompressLevel()
const;
628 void CompressLevel(
int pLevel);
640 bool ProjectOpenMainSection();
645 int ProjectGetExtensionSectionCount()
const;
651 bool ProjectOpenExtensionSection(
int pExtensionSectionIndex);
657 bool ProjectCreateExtensionSection(
bool pOverwriteLastExtensionSection =
false);
661 void ProjectCloseSection();
666 int ProjectGetCurrentSection()
const;
671 int ProjectGetCurrentSectionMode()
const;
676 int ProjectGetCurrentSectionVersion()
const;
685 int ProjectGetSectionVersion(
int pSection)
const;
693 static void ProjectConvertVersionNumber(
int pVersion,
int& pMajor,
int& pMinor,
int& pRevision);
698 bool IsPasswordProtected()
const;
705 bool CheckPassword(
const char* pPassword);
713 bool WritePassword(
const char* pPassword);
725 const char* GetFilename()
const;
731 FbxString GetDataDirectory(
bool pAutoCreate =
true);
741 FbxString GetMediaDirectory(
bool pCreate =
false,
const char* pUserDefinedFolder =
NULL);
748 FbxString GetContainerTemplateDirectory(
const char* pTemplateName,
bool pCreate);
754 char* GetRelativePath(
const char* pPath);
760 char* GetRelativeFilePath(
const char* pFilePath);
766 char* GetFullPath(
const char* pRelativePath);
772 char* GetFullFilePath(
const char* pRelativeFilePath);
778 char* GetTmpProjectName(
const char* pName)
const;
786 bool SwapFromTmpProject(
const char* pName,
char* pError=
NULL,
int pErrorSize=0);
798 void FieldReadResetPosition();
803 int FieldGetCount()
const;
809 const char* FieldGetName(
int pFieldIndex)
const;
815 int FieldGetInstanceCount(
const char* pFieldName)
const;
822 bool FieldReadBegin(
int pFieldIndex,
int pInstance);
828 bool FieldReadBegin(
const char* pFieldName);
835 bool FieldReadBegin(
const char* pFieldName,
int pInstance);
841 bool FieldReadIsBlock();
844 bool FieldReadBlockBegin();
847 void FieldReadBlockEnd();
850 int FieldReadGetCount()
const;
853 int FieldReadGetRemain()
const;
856 char FieldReadGetType()
const;
865 char FieldReadCH(
const char* pFieldName,
char pDefault=0);
868 const char* FieldReadC();
874 const char* FieldReadC(
const char* pFieldName,
const char* pDefault=
"");
877 const char* FieldReadS();
883 const char* FieldReadS(
const char* pFieldName,
const char* pDefault=
"");
892 bool FieldReadB(
const char* pFieldName,
bool pDefault =
false);
896 int FieldReadI(
const char* pFieldName,
int pDefault=0);
918 float FieldReadF(
const char* pFieldName,
float pDefault=0);
927 double FieldReadD(
const char* pFieldName,
double pDefault=0);
932 FbxTime FieldReadT(
const char* pFieldName);
949 void FieldReadFn(
float* pValue,
FbxUInt pn);
954 void FieldRead3F(
float* pValue);
959 void FieldRead4F(
float* pValue);
967 void FieldReadFn(
const char* pFieldName,
float* pValue,
const float *pDefault,
FbxUInt pn);
974 void FieldRead3F(
const char* pFieldName,
float* pValue,
const float* pDefault=
NULL);
981 void FieldRead4F(
const char* pFieldName,
float* pValue,
const float* pDefault=
NULL);
987 void FieldReadDn(
double* pValue,
FbxUInt pn);
992 void FieldRead3D(
double* pValue);
997 void FieldRead4D(
double* pValue);
1005 void FieldReadDn(
const char* pFieldName,
double* pValue,
const double *pDefault,
FbxUInt pn);
1012 void FieldRead3D(
const char* pFieldName,
double* pValue,
const double* pDefault=
NULL);
1019 void FieldRead4D(
const char* pFieldName,
double* pValue,
const double* pDefault=
NULL);
1024 void* FieldReadR(
int* pByteSize);
1030 void* FieldReadR(
const char* pFieldName,
int* pByteSize);
1043 FbxChar FieldReadByte(
const char* pFieldName,
FbxChar pDefault=0);
1073 unsigned int FieldReadUI();
1079 unsigned int FieldReadUI(
const char* pFieldName,
unsigned int pDefault=0);
1093 const FbxChar* FieldReadArraySBytes(
int &pCount );
1097 const FbxShort* FieldReadArrayShort (
int &pCount );
1101 const FbxUShort* FieldReadArrayUShort(
int &pCount );
1105 const unsigned int* FieldReadArrayUI (
int &pCount );
1129 const unsigned int* FieldReadArray(
int &pCount,
const unsigned int*);
1144 virtual bool FieldReadEmbeddedFile (
FbxString& pFileName,
FbxString& pRelativeFileName,
const char* pEmbeddedMediaDirectory =
"",
bool *pIsFileCreated=
NULL);
1149 const double* FieldReadArrayD(
int &pCount );
1153 const float* FieldReadArrayF(
int &pCount );
1157 const int* FieldReadArrayI(
int &pCount );
1165 const bool* FieldReadArrayB(
int &pCount );
1169 const FbxUChar* FieldReadArrayBytes(
int &pCount );
1174 const int* FieldReadArray(
int& pCount,
const int*);
1178 const float* FieldReadArray(
int& pCount,
const float*);
1182 const double* FieldReadArray(
int& pCount,
const double*);
1190 const bool* FieldReadArray(
int& pCount,
const bool*);
1207 void FieldWriteBegin(
const char* pFieldName);
1210 void FieldWriteEnd();
1213 void FieldWriteBlockBegin();
1220 void FieldWriteObjectBegin(
const char* pObjectType,
const char* pName,
const char* pSubType=
NULL);
1223 void FieldWriteObjectEnd();
1229 void FieldWriteBlockBegin(
const char* pFileName);
1232 void FieldWriteBlockEnd ();
1237 void FieldWriteCH(
char pValue);
1243 void FieldWriteCH(
const char* pFieldName,
char pValue);
1248 void FieldWriteC(
const char* pValue);
1254 void FieldWriteC(
const char* pFieldName,
const char* pValue);
1259 void FieldWriteS(
const char* pValue);
1264 void FieldWriteS(
const FbxString& pValue);
1270 void FieldWriteS(
const char* pFieldName,
const char* pValue);
1276 void FieldWriteS(
const char* pFieldName,
const FbxString& pValue);
1281 void FieldWriteB(
bool pValue);
1287 void FieldWriteB(
const char* pFieldName,
bool pValue);
1292 void FieldWriteI(
int pValue);
1298 void FieldWriteI(
const char* pFieldName,
int pValue);
1309 void FieldWriteLL(
const char* pFieldName,
FbxLongLong pValue);
1315 void FieldWriteF(
float pValue);
1322 void FieldWriteF(
const char* pFieldName,
float pValue);
1327 void FieldWriteD(
double pValue);
1333 void FieldWriteD(
const char* pFieldName,
double pValue);
1338 void FieldWriteT(
FbxTime pTime);
1344 void FieldWriteT(
const char* pFieldName,
FbxTime pValue);
1355 void FieldWriteTS(
const char* pFieldName,
FbxTimeSpan pValue);
1361 void FieldWriteFn(
const float* pValue,
FbxUInt pn);
1368 void FieldWriteFn(
const char* pFieldName,
const float* pValue,
FbxUInt pn);
1373 void FieldWrite3F(
const float* pValue);
1379 void FieldWrite3F(
const char* pFieldName,
const float* pValue);
1384 void FieldWrite4F(
const float* pValue);
1390 void FieldWrite4F(
const char* pFieldName,
const float* pValue);
1396 void FieldWriteDn(
const double* pValue,
FbxUInt pn);
1403 void FieldWriteDn(
const char* pFieldName,
const double* pValue,
FbxUInt pn);
1408 void FieldWrite3D(
const double* pValue);
1414 void FieldWrite3D(
const char* pFieldName,
const double* pValue);
1419 void FieldWrite4D(
const double* pValue);
1425 void FieldWrite4D(
const char* pFieldName,
const double* pValue);
1438 void FieldWriteArrayD(
int n,
const double* pValue,
int pSize = 1,
int pStride = 0 );
1445 void FieldWriteArrayF(
int n,
const float* pValue,
int pSize = 1,
int pStride = 0 );
1452 void FieldWriteArrayI(
int n,
const int* pValue,
int pSize = 1,
int pStride = 0 );
1459 void FieldWriteArrayLL(
int n,
const FbxLongLong* pValue,
int pSize = 1,
int pStride = 0 );
1466 void FieldWriteArrayB(
int n,
const bool* pValue,
int pSize = 1,
int pStride = 0 );
1473 void FieldWriteArrayBytes(
int n,
const FbxUChar* pValue,
int pSize = 1,
int pStride = 0 );
1479 void FieldWriteR(
const void* pRawData,
int pByteSize);
1486 void FieldWriteR(
const char* pFieldName,
const void* pRawData,
int pByteSize);
1496 void FieldWriteByte(
FbxChar pValue);
1502 void FieldWriteByte(
const char* pFieldName,
FbxChar pValue);
1507 void FieldWriteUByte(
FbxUChar pValue);
1513 void FieldWriteUByte(
const char* pFieldName,
FbxUChar pValue);
1518 void FieldWriteShort(
FbxShort pValue);
1524 void FieldWriteShort(
const char* pFieldName,
FbxShort pValue);
1529 void FieldWriteUShort(
FbxUShort pValue);
1535 void FieldWriteUShort(
const char* pFieldName,
FbxUShort pValue);
1540 void FieldWriteUI(
unsigned int pValue);
1546 void FieldWriteUI(
const char* pFieldName,
unsigned int pValue);
1558 void FieldWriteULL(
const char* pFieldName,
FbxULongLong pValue);
1566 void FieldWriteArraySBytes(
int n,
const FbxChar* pValue,
int pSize = 1,
int pStride = 0 );
1573 void FieldWriteArrayShort(
int n,
const FbxShort* pValue,
int pSize = 1,
int pStride = 0 );
1580 void FieldWriteArrayUShort(
int n,
const FbxUShort* pValue,
int pSize = 1,
int pStride = 0 );
1587 void FieldWriteArrayUI(
int n,
const unsigned int* pValue,
int pSize = 1,
int pStride = 0 );
1594 void FieldWriteArrayULL(
int n,
const FbxULongLong* pValue,
int pSize = 1,
int pStride = 0 );
1600 int GetFieldRMaxChunkSize()
const;
1605 void FieldWriteObjectReference(
const char* pName);
1611 void FieldWriteObjectReference(
const char* pFieldName,
const char* pName);
1624 void WriteComments(
const char* pFieldName);
1640 bool GetHaveLoadedEmbededFile()
const;
1646 void GetMemoryFileInfo(
void** pMemPtr,
size_t& pSize)
const;
1651 bool IsBeforeVersion6()
const;
1656 void SetIsBeforeVersion6(
bool pIsBeforeVersion6);
1661 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1670 struct InternalImpl;
1671 InternalImpl* mImpl;
1675 void ProjectClear();
1676 void ProjectReset();
1678 bool ProjectReadHeader(
bool pCheckASCIIHeader,
bool pCheckCRC,
bool pOpenMainSection,
FbxIOFileHeaderInfo* pFileHeaderInfo);
1679 bool ProjectReadExtendedHeader(
int& pExtendedHeaderEnd,
FbxIOFileHeaderInfo* pFileHeaderInfo);
1680 bool BinaryReadHeader();
1681 bool BinaryReadSectionPosition();
1682 bool ASCIIReadHeader();
1683 bool ASCIIReadSectionPosition();
1687 void BinaryWriteHeader();
1688 void ASCIIWriteHeader();
1690 void ReadEncryptionKey(
char* pEncryptionKey);
1691 void WriteEncryptionKey(
char* pEncryptionKey);
1695 bool ProjectClearSection();
1696 bool ProjectOpenSection(
int pSection);
1697 bool BinaryReadSectionHeader();
1698 int BinaryReadSectionFooter(
char* pSourceCheck);
1700 void BinaryReadSectionPassword();
1702 bool ProjectWriteSectionHeader();
1703 void BinaryWriteSectionFooter();
1707 void SetCreationTime(
FbxString pCreationTime);
1708 void CreateSourceCheck(
char* lSourceCheck);
1709 bool TestSourceCheck(
char* pSourceCheck,
char* pSourceCompany);
1711 void EncryptSourceCheck(
char* pSourceCheck,
char* pEncryptionData);
1712 void DecryptSourceCheck(
char* pSourceCheck,
const char* pEncryptionData);
1719 void CheckValidityOfFieldName(
const char* pFieldName);
1723 FbxString GetDirectory(
bool pAutoCreate,
const char* pExtension);
FbxAutoResetXRefManager(FbxIO *pFbx, FbxXRefManager &pXRefManager)
Default constructor.
FBX SDK environment definition.
indicate not in a valid section
~FbxAutoResetXRefManager()
Destructor.
indicate currently in the extention section 0
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.
FBXSDK_DLL int FbxFileVersionStrToInt(const char *pFileVersion)
Convert the FBX file version string to an integral number for <= or >= tests purposes.
Class to encapsulate time units.
Render and resolution information.
Base class of other writers used internally.
This class manages external references to files.
const FbxXRefManager * mXRefManager
double mResolutionH
resolution height.
static FbxIO * Create(FbxStatus &pStatus)
Creation function for this FbxIO class.
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.
indicate currently in the main section
bool mIsOK
If the resolution data is ready.