FBX C++ API Reference
fbxiosettings.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2017 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_IO_SETTINGS_H_
14 #define _FBXSDK_FILEIO_IO_SETTINGS_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxobject.h>
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
23 //Undefine the macro mkdir, since it conflict with function mkdir in Qt\4.2.3\src\corelib\io\qdir.h
24 #if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(mkdir)
25  #undef mkdir
26 #endif
27 
28 #define IOSVisible true
29 #define IOSHidden false
30 
31 #define IOSSavable true
32 #define IOSNotSavable false
33 
34 #define IOSEnabled true
35 #define IOSDisabled false
36 
37 #define IOSBinary 0
38 #define IOSASCII 1
39 
40 class FbxManager;
41 class FbxIOSettings;
42 
43 /*****************************************************************************************************************************
44 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
45 *****************************************************************************************************************************/
46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
47 class FbxIOPropInfo
48 {
49 public:
50  FbxIOPropInfo();
51  ~FbxIOPropInfo();
52 
53  void* UIWidget; // UI widget for showing the property
54  void* cbValueChanged; // call back when value changed
55  void* cbDirty; // call back when value changed
56  FbxStringList labels; // list of labels in many languages
57 };
58 
59 class FBXSDK_DLL FbxIOInfo
60 {
61 public:
62  enum EImpExp {eImport, eExport};
63 
64  FbxIOInfo();
65 
66  void Reset(EImpExp pImpExp);
67  void SetTimeMode(FbxTime::EMode pTimeMode, double pCustomFrameRate = 0.0);
68  FbxTime::EMode GetTimeMode(){ return mTimeMode; }
69  FbxTime GetFramePeriod();
70  void SetASFScene(FbxObject* pASFScene, bool pASFSceneOwned = false);
71  FbxObject* GetASFScene(){ return mASFScene; }
72  void Set_IOS(FbxIOSettings* pIOS){ios = pIOS;}
73  void SetImportExportMode(EImpExp pImpExp){mImpExp = pImpExp;}
74 
75 private:
76  FbxTime::EMode mTimeMode;
77  FbxObject* mASFScene;
78  EImpExp mImpExp;
79  FbxIOSettings* ios;
80 };
81 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
82 
208 {
210 
211 public:
214  {
222  eLanguageCount
223  };
224 
231  FbxProperty AddPropertyGroup(const char* pName, const FbxDataType& pDataType=FbxDataType(), const char* pLabel="");
232 
243  FbxProperty AddPropertyGroup(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
244  const char* pLabel = "", bool pVisible = true, bool pSavable = true, bool pEnabled = true );
245 
257  FbxProperty AddProperty(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
258  const char* pLabel = "", const void* pValue = NULL, bool pVisible = true,
259  bool pSavable = true, bool pEnabled = true );
260 
275  FbxProperty AddPropertyMinMax(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
276  const char* pLabel = "", const void* pValue = NULL, const double* pMinValue = NULL, const double* pMaxValue = NULL,
277  bool pVisible = true, bool pSavable = true, bool pEnabled = true );
278 
279 
286  FbxProperty GetProperty(const char* pName) const;
287 
294  FbxProperty GetProperty(const FbxProperty& pParentProperty, const char* pName) const;
295 
301  bool GetBoolProp(const char* pName, bool pDefValue) const;
302 
307  void SetBoolProp(const char* pName, bool pValue);
308 
314  double GetDoubleProp(const char* pName, double pDefValue) const;
315 
320  void SetDoubleProp(const char* pName, double pValue);
321 
327  int GetIntProp(const char* pName, int pDefValue) const;
328 
333  void SetIntProp(const char* pName, int pValue);
334 
339  FbxTime GetTimeProp(const char* pName, FbxTime pDefValue) const;
340 
346  void SetTimeProp(const char* pName, FbxTime pValue);
347 
366 
372  FbxString GetEnumProp(const char* pName, FbxString pDefValue) const;
373 
379  int GetEnumProp(const char* pName, int pDefValue) const;
380 
386  int GetEnumIndex(const char* pName, FbxString pValue) const;
387 
393  void SetEnumProp(const char* pName, FbxString pValue);
394 
400  void SetEnumProp(const char* pName, int pValue);
401 
409  void RemoveEnumPropValue(const char* pName, FbxString pValue);
410 
414  void EmptyEnumProp(const char* pName);
415 
421  bool IsEnumExist(FbxProperty& pProp, const FbxString& enumString) const;
422 
429  int GetEnumIndex(FbxProperty& pProp, const FbxString& enumString, bool pNoCase = false) const;
431 
438  bool SetFlag(const char* pName, FbxPropertyFlags::EFlags propFlag, bool pValue);
439 
445  FbxString GetStringProp(const char* pName, FbxString pDefValue) const;
446 
451  void SetStringProp(const char* pName, FbxString pValue);
452 
455 
460  virtual bool ReadXMLFile(const FbxString& path);
461 
467  virtual bool WriteXMLFile(const FbxString& path);
468 
475  bool WriteXmlPropToFile(const FbxString& pFullPath, const FbxString& propPath);
477 
478 /*****************************************************************************************************************************
479 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
480 *****************************************************************************************************************************/
481 #ifndef DOXYGEN_SHOULD_SKIP_THIS
482  FbxIOPropInfo* GetPropInfo(FbxProperty &pProp);
483 
484  ELanguage UILanguage;
485  FbxString GetLanguageLabel(FbxProperty& pProp);
486  void SetLanguageLabel(FbxProperty& pProp, FbxString& pLabel);
487 
488  FbxIOInfo impInfo;
489  FbxIOInfo expInfo;
490 
491  static FbxString GetUserMyDocumentDir();
492  void SetPropVisible(FbxProperty& pProp, bool pWithChildren, bool pVisible);
493 
494  // Read an XML file from MyDocument dir
495  bool ReadXmlPropFromMyDocument(const FbxString& subDir, const FbxString& filename);
496 
497  // Write property branch to an XML file in MyDocument dir
498  bool WriteXmlPropToMyDocument(const FbxString& subDir, const FbxString& filename, const FbxString& propPath);
499 
500  static const char* GetFileMergeDescription(int pIndex);
501 
502  enum ELoadMode
503  {
504  eCreate,
505  eMerge,
506  eExclusiveMerge
507  };
508 
509 
510  enum EQuaternionMode { eAsQuaternion, eAsEuler, eResample };
511  enum EObjectDerivation { eByLayer, eByEntity, eByBlock };
512 
513  enum ESysUnits
514  {
515  eUnitsUser,
516  eUnitsInches,
517  eUnitsFeet,
518  eUnitYards,
519  eUnitsMiles,
520  eUnitsMillimeters,
521  eUnitsCentimeters,
522  eUnitsMeters,
523  eUnitsKilometers
524  };
525 
526  enum ESysFrameRate
527  {
528  eFrameRateUser,
529  eFrameRateHours,
530  eFrameRateMinutes,
531  eFrameRateSeconds,
532  eFrameRateMilliseconds,
533  eFrameRateGames15,
534  eFrameRateFilm24,
535  eFrameRatePAL25,
536  eFrameRateNTSC30,
537  eFrameRateShowScan48,
538  eFrameRatePALField50,
539  eFrameRateNTSCField60
540  };
541 
542 // Max
543  enum EEnveloppeSystem
544  {
545  eSkinModifier,
546  ePhysic,
547  eBonePro,
548  eEnveloppeSystemCount
549  };
550 
551 // Max
552  enum EGeometryType
553  {
554  eTriangle,
555  eSimplifiedPoly,
556  ePolygon,
557  eNurbs,
558  ePatch,
559  eGeometryTypeCount
560  };
561 
562 // Maya IK type
563  enum EIKType
564  {
565  eNone,
566  eFBIK,
567  eHumanIK
568  };
569 
570 protected:
571  virtual void Construct(const FbxObject* pFrom);
572  virtual void ConstructProperties(bool pForceSet);
573  virtual void Destruct(bool pRecursive);
574 
575 private:
576  void AddNewPropInfo(FbxProperty& pProp);
577  void DeletePropInfo(FbxProperty& pProp);
578  void DeleteAllPropInfo(FbxProperty& pProp);
579 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
580 };
581 
582 #include <fbxsdk/fbxsdk_nsend.h>
583 
584 #endif /* _FBXSDK_FILEIO_IO_SETTINGS_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.
SDK object manager.
Definition: fbxmanager.h:56
EFlags
Property flags that affect their behaviors.
#define NULL
Definition: fbxarch.h:210
Array that stores pairs of FbxString and a pointer.
Utility class to manipulate strings.
Definition: fbxstring.h:66
FBX SDK data type class.
Definition: fbxdatatypes.h:26
English - United States.
Japanese - Japan.
FbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers...
Korean(Extended Wansung) - Korea.
German - Germany.
Portuguese - Brasil.
Class to encapsulate time units.
Definition: fbxtime.h:44
The base class of most FBX objects.
Definition: fbxobject.h:157
Chinese - PRC.
EMode
Time modes.
Definition: fbxtime.h:90
French - France.
Class to hold user properties.
Definition: fbxproperty.h:37
ELanguage
Supported languages enumeration list.
#define FBXSDK_DLL
Definition: fbxarch.h:173