This reference page is linked to from the following overview topics: Your First FBX SDK Program, Importing and Exporting a Scene, I/O Settings, Importing a Scene, Exporting a Scene, FBX Properties, Connections, List of Python FBX classes.
KFbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers and writers to represent import and export options.
It is primarily used by FBX importers (KFbxImporter) and FBX exporter (KFbxExporter) when reading or writing data from or to a disk. The FBX plugins of some Autodesk products expose a UI representing the content of those options to let users see and choose options when an import or export operation is about to be done. The tree of options is extensible.
Options can be saved or loaded from an XML file using the functions: ReadXMLFile(), WriteXMLFile(), WriteXmlPropToFile(). This functionality can be useful for plugins that use preset files.
An instance of KFbxIOSettings must be created to be used before an import/export operation. When a new KFbxIOSettings instance is created, all options are created with default values. The new instance of KFbxIOSettings can be passed to the KFbxSdkManager, this way that instance will be used by all import/export operations.
Ex: to set an instance of KFbxIOSettings to the KFbxSdkManager
// First create a new instance of KFbxIOSettings KFbxIOSettings * ios = KFbxIOSettings::Create((KFbxSdkManager *) mKFbxSdkManager, IOSROOT); // then set the KFbxSdkManager mKFbxSdkManager->SetIOSettings(ios);
It's also possible for a developer to create another instance of KFbxIOSettings, set particular options and use it for import/export operation.
Ex: to set an instance of KFbxIOSettings to a KFbxImporter/KFbxExporter
mKFbxImporter->SetIOSettings(ios); / mKFbxExporter->SetIOSettings(ios);
A schematic view of the KFbxIOSettings tree :
OPTION_GROUP_ROOT (IOSROOT) | | ________________________________________ | | -OPTION_GROUP_EXPORT (IOSN_EXPORT) -OPTION_GROUP_IMPORT (IOSN_IMPORT) | | -OPTION_GROUP_A -OPTION_GROUP_A | | | | | -OPTION_A | -OPTION_A | -OPTION_B | -OPTION_B | | -OPTION_GROUP_B -OPTION_GROUP_B | | | | | -OPTION_GROUP_A | -OPTION_GROUP_A | | | | | | | | -OPTION_A | | -OPTION_A | | -OPTION_B | | -OPTION_B | | | | | -OPTION_GROUP_B | -OPTION_GROUP_B | | | | | -OPTION_A | -OPTION_A | -OPTION_B | -OPTION_B | | -OPTION_GROUP_C -OPTION_GROUP_C | | -OPTION_A -OPTION_A
Any group of options can contain sub options, or group of sub options. To access an option value, we must pass the full path to the Get/Set functions Ex:
ios->GetBoolProp("Import|IncludeGrp|Animation", true); // the root node name is not required
All options path are defined in the file kfbxiosettingspath.h to ease the access of any options. Then "Import|IncludeGrp|Animation" == IMP_ANIMATION since IMP_ANIMATION is defined in kfbxiosettingspath.h All options defined path start with "IMP_" for import branch or "EXP_" for export branch.
We strongly encourage to use the defined path in kfbxiosettingspath.h, this way if the parent group of an option is changed the change occur only in kfbxiosettingspath.h not in the code elsewhere.
Ex: to get the boolean import "Animation" option
bool anim = ios->GetBoolProp(IMP_ANIMATION, true); // will return true if not found, since we pass true as second param
Ex: to set the boolean import "Animation" option to false
ios->SetBoolProp(IMP_ANIMATION, false);
Ex: to create a new option group under the "Import" branch
// get the parent "Import" property KFbxProperty import_Group = ios->GetProperty( IOSN_IMPORT ); // IOSN_IMPORT is defined as "Import" in kfbxiosettingspath.h if(import_Group.IsValid()) // check if we have found the IOSN_IMPORT parent option { // add a new group of options "myOptionGroup" KFbxProperty myOptionGrp = ios->AddPropertyGroup(import_Group, "myOptionGroup", DTString, "My Option Group UI Label"); }
Ex: to create a new boolean option under the "myOptionGroup"
KFbxProperty myOptionGrp = ios->GetProperty( "Import|myOptionGroup" ); // can also use IOSN_IMPORT|"myOptionGroup" if(myOptionGrp.IsValid()) // check if we have found the "myOptionGroup" { bool defaultValue = true; KFbxProperty myOption = ios->AddProperty(myOptionGrp, "myOptionName", DTBool, "My Option UI label" , &defaultValue, eBOOL1); }
Ex: to set some flags to myOption
KFbxProperty myOption = ios->GetProperty( "Import|myOptionGroup|myOptionName" ); if(myOption.IsValid()) { myOPtion.ModifyFlag(KFbxProperty::eUI_HIDDEN, true); // to make that option not visible to the UI myOPtion.ModifyFlag(KFbxProperty::eNOT_SAVABLE, true); // to avoid the read/save of that option in XML file }
Common/Common.cxx, ExportDocument/main.cxx, MyOwnWriterReader/MyOwnWriterReader.cxx, MyOwnWriterReader/MyOwnWriterReader.h, UIExamples/Common/ImportExport.cxx, UIExamples/CubeCreator/SDK_Utility.cxx, and UIExamples/SceneTreeView/SDK_Utility.cxx.
Definition at line 291 of file kfbxiosettings.h.
#include <kfbxiosettings.h>
Public Types |
|
enum | ELoadMode { eCREATE, eMERGE, eEXCLUSIVE_MERGE } |
enum | EQuaternionMode { eAS_QUATERNION, eAS_EULER, eRESAMPLE } |
enum | EObjectDerivation { eBY_LAYER, eBY_ENTITY, eBY_BLOCK } |
enum | ESysUnits
{ kUNITS_USER, kUNITS_INCHES, kUNITS_FEET, kUNITS_YARDS, kUNITS_MILES, kUNITS_MILLIMETERS, kUNITS_CENTIMETERS, kUNITS_METERS, kUNITS_KILOMETERS } |
enum | ESysFrameRate
{ kFRAMERATE_USER, kFRAMERATE_HOURS, kFRAMERATE_MINUTES, kFRAMERATE_SECONDS, kFRAMERATE_MILLISECONDS, kFRAMERATE_GAMES_15, kFRAMERATE_FILM_24, kFRAMERATE_PAL_25, kFRAMERATE_NTSC_30, kFRAMERATE_SHOWSCAN_48, kFRAMERATE_PALFIELD_50, kFRAMERATE_NTSCFIELD_60 } |
enum | EEnveloppeSystem { eSKIN_MODIFIER, ePHYSIQUE, eBONESPRO, eENVELOPPE_SYSTEM_COUNT } |
enum | EGeometryType
{ eTRIANGLE, eSIMPLIFIED_POLY, ePOLY, eNURB, ePATCH, eGEOMETRY_TYPE_COUNT } |
enum | EIKType { eNONE, eFBIK, eHUMANIK } |
Public Member Functions |
|
virtual void | Destruct (bool pRecursive, bool pDependents) |
Destruct a property and optionally the
children properties. |
|
KFbxProperty | AddPropertyGroup (char const *pName, KFbxDataType const &pDataType=KFbxDataType(), char const *pLabel="") |
Add a property group under the root prop to
be a direct child of IOSROOT. |
|
KFbxProperty | AddPropertyGroup (KFbxProperty const &pParentProperty, char const *pName, KFbxDataType const &pDataType=KFbxDataType(), char const *pLabel="", bool pVisible=true, bool pSavable=true, bool pEnabled=true) |
Add a property group under another parent
property. |
|
KFbxProperty | AddProperty (KFbxProperty const &pParentProperty, char const *pName, KFbxDataType const &pDataType=KFbxDataType(), char const *pLabel="", void const *pValue=NULL, EFbxType pValueType=eUNIDENTIFIED, bool pVisible=true, bool pSavable=true, bool pEnabled=true) |
Add a property under another parent property
with a value to set. |
|
KFbxProperty | AddPropertyMinMax (KFbxProperty const &pParentProperty, char const *pName, KFbxDataType const &pDataType=KFbxDataType(), char const *pLabel="", void const *pValue=NULL, double const *pMinValue=NULL, double const *pMaxValue=NULL, EFbxType pValueType=eUNIDENTIFIED, bool pVisible=true, bool pSavable=true, bool pEnabled=true) |
Add a property under another parent property
with a value to set and a min max values. |
|
KFbxProperty | GetProperty (char const *pName) const |
Get a property using the full path in the
tree ex: "Export|IncludeGrp|Animation". |
|
KFbxProperty | GetProperty (KFbxProperty const &pParentProperty, char const *pName) const |
Get a property using a short path found
under the parent property. |
|
bool | GetBoolProp (char const *pName, bool pDefValue) const |
Get a bool property value using the full
path. |
|
void | SetBoolProp (char const *pName, bool pValue) |
set a bool property value using the full
path |
|
double | GetDoubleProp (char const *pName, double pDefValue) const |
Get a double property value using the full
path. |
|
void | SetDoubleProp (char const *pName, double pValue) |
Set a double property using the full path.
|
|
int | GetIntProp (char const *pName, int pDefValue) const |
Get a int property value using the full
path. |
|
void | SetIntProp (char const *pName, int pValue) |
Set a int property value using the full
path. |
|
KTime | GetKTimeProp (char const *pName, KTime pDefValue) const |
Get a KTime property value
using the full path. |
|
void | SetKTimeProp (char const *pName, KTime pValue) |
Set a KTime property value
using the full path. |
|
bool | SetFlag (char const *pName, FbxPropertyFlags::eFbxPropertyFlags propFlag, bool pValue) |
Set a specific flag value on a property
using the full path. |
|
KString | GetStringProp (char const *pName, KString pDefValue) const |
Get a KString property value
using the full path. |
|
void | SetStringProp (char const *pName, KString pValue) |
Set a KString property value
using the full path. |
|
PropInfo * | GetPropInfo (KFbxProperty &pProp) |
KString | GetLanguageLabel (KFbxProperty &pProp) |
void | SetLanguageLabel (KFbxProperty &pProp, KString &pLabel) |
FBXUILANGUAGE | Get_Max_Runtime_Language (KString regLocation) |
void | SetPropVisible (KFbxProperty &pProp, bool pWithChildren, bool pVisible) |
virtual bool | ConstructProperties (bool pForceSet) |
bool | ReadXmlPropFromMyDocument (KString &subDir, KString &filename) |
bool | WriteXmlPropToMyDocument (KString &subDir, KString &filename, KString &propPath) |
Enum Properties
|
|
An enum property is a list of KString and integer pairs. A current index value is available to get the selected pair of KString+integer Ex: Content of an enum property 0 -> (14, "Bird") 1 -> (17, "Horse") 2 -> (93, "Cat") 3 -> (45, "Dog") If current index is 2: the current int value is 93, and the current KString value is "Cat" |
|
KString | GetEnumProp (char const *pName, KString pDefValue) const |
Get the KString at current index
of an enum property using the full path. |
|
int | GetEnumProp (char const *pName, int pDefValue) const |
Get the integer at current index of an enum
property using the full path. |
|
int | GetEnumIndex (char const *pName, KString pValue) const |
Get the index of a KString from the enum
property using the full path. |
|
void | SetEnumProp (char const *pName, KString pValue) |
Set the current index using an existing
KString of an enum
property using the full path. |
|
void | SetEnumProp (char const *pName, int pValue) |
Set the current index of an enum property
using the full path. |
|
void | RemoveEnumPropValue (char const *pName, KString pValue) |
Remove a pair of KString+integer from an
enum property. |
|
void | EmptyEnumProp (char const *pName) |
Empty all the KString+integer pair of the
enum property. |
|
bool | IsEnumExist (KFbxProperty &pProp, KString &enumString) const |
Check if a KString is present in
the enum property. |
|
int | GetEnumIndex (KFbxProperty &pProp, KString &enumString, bool pNoCase=false) const |
Get the enum index of a KString. |
|
XML Serialization Functions
|
|
virtual bool | ReadXMLFile (KString &path) |
Load the settings values from an XML file.
|
|
virtual bool | WriteXMLFile (KString &path) |
Write the settings values to an XML file.
|
|
bool | WriteXmlPropToFile (KString &pFullPath, KString &propPath) |
Write the settings values to an XML file.
|
|
Static Public Member Functions |
|
static KString | GetUserMyDocumentDir () |
static const char * | GetFileMergeDescription (int pIndex) |
Public Attributes |
|
FBXUILANGUAGE | UILanguage |
KsoInfo | impInfo |
KsoInfo | expInfo |
Protected Member Functions |
|
KFbxIOSettings (KFbxSdkManager &pManager, char const *pName) |
enum ELoadMode |
eCREATE |
Add to scene(duplicate the ones with the same name) |
eMERGE |
Add to scene and update animation. |
eEXCLUSIVE_MERGE |
Update animation. |
Definition at line 613 of file kfbxiosettings.h.
{ eCREATE, eMERGE, eEXCLUSIVE_MERGE };
enum EQuaternionMode |
Definition at line 621 of file kfbxiosettings.h.
{ eAS_QUATERNION, eAS_EULER, eRESAMPLE };
enum EObjectDerivation |
Definition at line 622 of file kfbxiosettings.h.
{ eBY_LAYER, eBY_ENTITY, eBY_BLOCK };
enum ESysUnits |
kUNITS_USER | |
kUNITS_INCHES | |
kUNITS_FEET | |
kUNITS_YARDS | |
kUNITS_MILES | |
kUNITS_MILLIMETERS | |
kUNITS_CENTIMETERS | |
kUNITS_METERS | |
kUNITS_KILOMETERS |
Definition at line 624 of file kfbxiosettings.h.
enum ESysFrameRate |
Definition at line 637 of file kfbxiosettings.h.
enum EEnveloppeSystem |
Definition at line 654 of file kfbxiosettings.h.
enum EGeometryType |
Definition at line 663 of file kfbxiosettings.h.
enum EIKType |
Definition at line 674 of file kfbxiosettings.h.
KFbxIOSettings | ( | KFbxSdkManager & | pManager, |
char const * | pName | ||
) | [protected] |
virtual void Destruct | ( | bool | pRecursive, |
bool | pDependents | ||
) | [virtual] |
Destruct a property and optionally the children properties.
pRecursive | |
pDependents |
Reimplemented from KFbxObject.
KFbxProperty AddPropertyGroup | ( | char const * | pName, |
KFbxDataType const & | pDataType = KFbxDataType() , |
||
char const * | pLabel = "" |
||
) |
Add a property group under the root prop to be a direct child of IOSROOT.
pName | |
pDataType | |
pLabel |
KFbxProperty AddPropertyGroup | ( | KFbxProperty const & | pParentProperty, |
char const * | pName, | ||
KFbxDataType const & | pDataType = KFbxDataType() , |
||
char const * | pLabel = "" , |
||
bool | pVisible = true , |
||
bool | pSavable = true , |
||
bool | pEnabled =
true |
||
) |
Add a property group under another parent property.
pParentProperty | |
pName | |
pDataType | |
pLabel | (optional, used by the UI as widget label) |
pVisible | (used by the UI to show or not that property) |
pSavable | (to enable a read & write to an XML file) |
pEnabled | (used by the widget UI to show enabled or disabled) |
KFbxProperty AddProperty | ( | KFbxProperty const & | pParentProperty, |
char const * | pName, | ||
KFbxDataType const & | pDataType = KFbxDataType() , |
||
char const * | pLabel = "" , |
||
void const * | pValue = NULL , |
||
EFbxType | pValueType =
eUNIDENTIFIED , |
||
bool | pVisible = true , |
||
bool | pSavable = true , |
||
bool | pEnabled =
true |
||
) |
Add a property under another parent property with a value to set.
pParentProperty | |
pName | |
pDataType | |
pLabel | (optional, used by the UI as widget label) |
pValue | |
pValueType | |
pVisible | (used by the UI to show or not that property) |
pSavable | (to enable a read & write to an XML file) |
pEnabled | (used by the widget UI to show enabled or disabled) |
KFbxProperty AddPropertyMinMax | ( | KFbxProperty const & | pParentProperty, |
char const * | pName, | ||
KFbxDataType const & | pDataType = KFbxDataType() , |
||
char const * | pLabel = "" , |
||
void const * | pValue = NULL , |
||
double const * | pMinValue = NULL , |
||
double const * | pMaxValue = NULL , |
||
EFbxType | pValueType =
eUNIDENTIFIED , |
||
bool | pVisible = true , |
||
bool | pSavable = true , |
||
bool | pEnabled =
true |
||
) |
Add a property under another parent property with a value to set and a min max values.
pParentProperty | |
pName | |
pDataType | |
pLabel | (optional, used by the UI as widget label) |
pValue | |
pMinValue | |
pMaxValue | |
pValueType | |
pVisible | (used by the UI to show or not that property) |
pSavable | (to enable a read & write to an XML file) |
pEnabled | (used by the widget UI to show enabled or disabled) |
KFbxProperty GetProperty | ( | char const * | pName | ) | const |
Get a property using the full path in the tree ex: "Export|IncludeGrp|Animation".
pName |
KFbxProperty GetProperty | ( | KFbxProperty const & | pParentProperty, |
char const * | pName | ||
) | const |
Get a property using a short path found under the parent property.
pParentProperty | |
pName |
bool GetBoolProp | ( | char const * | pName, |
bool | pDefValue | ||
) | const |
Get a bool property value using the full path.
pName | |
pDefValue | Value returned if the property is not found |
void SetBoolProp | ( | char const * | pName, |
bool | pValue | ||
) |
double GetDoubleProp | ( | char const * | pName, |
double | pDefValue | ||
) | const |
Get a double property value using the full path.
pName | |
pDefValue | Value returned if the property is not found |
void SetDoubleProp | ( | char const * | pName, |
double | pValue | ||
) |
int GetIntProp | ( | char const * | pName, |
int | pDefValue | ||
) | const |
Get a int property value using the full path.
pName | |
pDefValue | Value returned if the property is not found |
void SetIntProp | ( | char const * | pName, |
int | pValue | ||
) |
Get a KTime property value using the full path.
pName | |
pDefValue | Value returned if the property is not found |
void SetKTimeProp | ( | char const * | pName, |
KTime | pValue | ||
) |
int GetEnumProp | ( | char const * | pName, |
int | pDefValue | ||
) | const |
Get the integer at current index of an enum property using the full path.
pName | |
pDefValue | Value returned if the property is not found |
int GetEnumIndex | ( | char const * | pName, |
KString | pValue | ||
) | const |
void SetEnumProp | ( | char const * | pName, |
KString | pValue | ||
) |
void SetEnumProp | ( | char const * | pName, |
int | pValue | ||
) |
Set the current index of an enum property using the full path.
pName | |
pValue |
void RemoveEnumPropValue | ( | char const * | pName, |
KString | pValue | ||
) |
Remove a pair of KString+integer from an enum property.
pName | |
pValue | The KString to find |
void EmptyEnumProp | ( | char const * | pName | ) |
Empty all the KString+integer pair of the enum property.
pName |
bool IsEnumExist | ( | KFbxProperty & | pProp, |
KString & | enumString | ||
) | const |
int GetEnumIndex | ( | KFbxProperty & | pProp, |
KString & | enumString, | ||
bool | pNoCase =
false |
||
) | const |
Get the enum index of a KString.
&pProp | a ref to an enum prop |
&enumString | ref to string to find |
pNoCase | To match case sensitive or not |
bool SetFlag | ( | char const * | pName, |
FbxPropertyFlags::eFbxPropertyFlags | propFlag, | ||
bool | pValue | ||
) |
Set a specific flag value on a property using the full path.
pName | |
propFlag | |
pValue |
void SetStringProp | ( | char const * | pName, |
KString | pValue | ||
) |
Set a KString property value using the full path.
pName | |
pValue |
virtual bool ReadXMLFile | ( | KString & | path | ) | [virtual] |
Load the settings values from an XML file.
path | The path of the XML file. |
True
on success, false
otherwise.virtual bool WriteXMLFile | ( | KString & | path | ) | [virtual] |
Write the settings values to an XML file.
path | The path of the XML file. |
True
on success, false
otherwise.Write the settings values to an XML file.
pFullPath | The path of the XML file. |
propPath | a prop Path |
True
on success, false
otherwise.PropInfo* GetPropInfo | ( | KFbxProperty & | pProp | ) |
KString GetLanguageLabel | ( | KFbxProperty & | pProp | ) |
void SetLanguageLabel | ( | KFbxProperty & | pProp, |
KString & | pLabel | ||
) |
FBXUILANGUAGE Get_Max_Runtime_Language | ( | KString | regLocation | ) |
static KString GetUserMyDocumentDir | ( | ) | [static] |
void SetPropVisible | ( | KFbxProperty & | pProp, |
bool | pWithChildren, | ||
bool | pVisible | ||
) |
virtual bool ConstructProperties | ( | bool | pForceSet | ) | [virtual] |
Reimplemented from KFbxObject.
static const char* GetFileMergeDescription | ( | int | pIndex | ) | [static] |
Definition at line 592 of file kfbxiosettings.h.
Definition at line 597 of file kfbxiosettings.h.
Definition at line 598 of file kfbxiosettings.h.