FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fbxcolladautils.h File Reference
#include <fbxsdk.h>
#include <fbxsdk/fileio/collada/fbxcolladatokens.h>
#include <fbxsdk/fileio/collada/fbxcolladaiostream.h>
#include <fbxsdk/scene/fbxscene.h>
#include <fbxsdk/utils/fbxrenamingstrategybase.h>
#include <fbxsdk/utils/fbxnamehandler.h>
#include <components/libxml2-2.7.8/include/libxml/globals.h>
#include <fbxsdk/fbxsdk_nsbegin.h>
#include <fbxsdk/fbxsdk_nsend.h>

Classes

class  FbxRenamingStrategyCollada
 
class  XmlNodeDeletionPolicy
 
struct  ColladaLayerTraits
 

Macros

#define INT_MAX   0x7FFFFFFF
 
#define CENTIMETERS_TO_INCHES   2.54f
 
#define RADIANS_TO_DEGREES   57.295799f
 
#define COLLADA_ID_PROPERTY_NAME   "COLLADA_ID"
 

Typedefs

typedef FbxAutoPtr< xmlNode, XmlNodeDeletionPolicyXmlNodePtr
 
typedef FbxMap< FbxString, xmlNode *> SourceElementMapType
 
typedef FbxMap< FbxString, xmlNode *> SkinMapType
 
typedef FbxArray< xmlNode * > CNodeList
 

Enumerations

enum  DAE_Flow { kCOLLADAFlowIn, kCOLLADAFlowOut, kCOLLADAFlowInOut }
 

Functions

void DAE_AddNotificationError (const FbxManager *pSdkManger, const FbxString &pErrorMessage)
 Emit error message. More...
 
void DAE_AddNotificationWarning (const FbxManager *pSdkManger, const FbxString &pWarningMessage)
 Emit warning message. More...
 
void DAE_ExportArray (xmlNode *parentXmlNode, const char *id, FbxArray< FbxVector4 > &arr)
 
void DAE_ExportArray (xmlNode *parentXmlNode, const char *id, FbxArray< FbxVector2 > &arr)
 
void DAE_ExportArray (xmlNode *parentXmlNode, const char *id, FbxArray< FbxColor > &arr)
 
void DAE_ExportArray (xmlNode *parentXmlNode, const char *id, FbxArray< double > &arr)
 
void DAE_ExportArray (xmlNode *parentXmlNode, const char *id, FbxStringList &arr)
 
xmlNode * DAE_ExportSource14 (xmlNode *parentXmlNode, const char *id, FbxStringList &accessorParams, FbxArray< double > &arr, bool isCommonProfile=true)
 
xmlNode * DAE_ExportSource14 (xmlNode *parentXmlNode, const char *id, FbxArray< FbxVector4 > &arr)
 
xmlNode * DAE_ExportSource14 (xmlNode *parentXmlNode, const char *id, FbxArray< FbxVector2 > &arr)
 
xmlNode * DAE_ExportSource14 (xmlNode *parentXmlNode, const char *id, FbxArray< FbxColor > &arr)
 
xmlNode * DAE_ExportSource14 (xmlNode *parentXmlNode, const char *id, FbxArray< FbxAMatrix > &arr)
 
xmlNode * DAE_ExportSource14 (xmlNode *parentXmlNode, const char *id, FbxArray< FbxMatrix > &arr)
 
xmlNode * DAE_ExportSource14 (xmlNode *parentXmlNode, const char *id, FbxStringList &arr, const char *type, bool isCommonProfile=true)
 
void DAE_ExportSourceArray (xmlNode *sourceNode, const char *id, FbxArray< FbxColor > &arr)
 
void DAE_ExportSourceArray14 (xmlNode *sourceNode, const char *id, FbxArray< FbxColor > &arr)
 
xmlNode * DAE_ExportAccessor (xmlNode *parentXmlNode, const char *id, const char *arrayRef, int count, int stride, const char *name, const char *type)
 
xmlNode * DAE_ExportAccessor14 (xmlNode *parentXmlNode, const char *id, const char *arrayRef, int count, int stride, const char *name, const char *type)
 
void DAE_AddXYZAccessor (xmlNode *parentXmlNode, const char *profile, const char *arrayName, const char *arrayRef, int count)
 
void DAE_AddSTAccessor (xmlNode *parentXmlNode, const char *profile, const char *arrayName, const char *arrayRef, int count)
 
void DAE_AddFlow (xmlNode *node, DAE_Flow flow)
 
void DAE_AddXYZAccessor14 (xmlNode *parentXmlNode, const char *profile, const char *arrayName, const char *arrayRef, int count)
 
void DAE_AddSTAccessor14 (xmlNode *parentXmlNode, const char *profile, const char *arrayName, const char *arrayRef, int count)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, const FbxColor &color, DAE_Flow flow)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, const FbxVector4 &vector, DAE_Flow flow)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, double value, DAE_Flow flow)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, bool value, DAE_Flow flow)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, const char *type, const char *value, DAE_Flow flow)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, const FbxDouble3 &color)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, const FbxColor &color)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, const FbxVector4 &vector)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, double value)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, bool value)
 
xmlNode * DAE_AddParameter (xmlNode *parentXmlNode, const char *name, const char *type, const char *value)
 
xmlNode * DAE_AddTechnique (xmlNode *parentXmlNode, const char *technique)
 
void DAE_AddInput (xmlNode *parentXmlNode, const char *semantic, const char *source, int idx=-1)
 
void DAE_AddInput14 (xmlNode *parentXmlNode, const char *semantic, const char *source, int offset=-1, int set=-1)
 
FbxString matrixToString (const FbxAMatrix &mx)
 
void findChildrenByType (xmlNode *pParentElement, const FbxSet< FbxString > &pTypes, CNodeList &pChildrenElements)
 Find children elements whose type is included in a list of type. More...
 
void findChildrenByType (xmlNode *pParentElement, const char *pType, CNodeList &pChildrenElements)
 Find children elements of a specific type. More...
 
xmlNode * getSourceAccessor (xmlNode *sourceNode)
 
xmlNode * getTechniqueNode (xmlNode *parent, const char *profile)
 
double inchesToCentimeters (double val)
 
double centimetersToInches (double val)
 
double degreesToRadians (double val)
 
double radiansToDegrees (double val)
 
xmlNode * DAE_FindChildElementByAttribute (xmlNode *pParentElement, const char *pAttributeName, const char *pAttributeValue, const char *pDefaultAttributeValue="")
 Find a child element with a given attribute value. More...
 
xmlNode * DAE_FindChildElementByTag (xmlNode *pParentElement, const char *pTag, xmlNode *pFindFrom=((void *) 0))
 Find a child element with a given tag. More...
 
template<typename TYPE >
void DAE_GetElementContent (xmlNode *pElement, TYPE &pData)
 Get the content of a XML element. More...
 
bool DAE_CheckCompatibility (xmlNode *pNodeElement)
 Check whether this node is compatible to FBX transform structure. More...
 
void DAE_GetElementTag (xmlNode *pElement, FbxString &pTag)
 Get the tag of the specific element. More...
 
const FbxString DAE_GetElementAttributeValue (xmlNode *pElement, const char *pAttributeName)
 Get the value of an attribute of an element. More...
 
template<typename TYPE >
bool DAE_GetElementAttributeValue (xmlNode *pElement, const char *pAttributeName, TYPE &pData)
 Get the value of an attribute of an element. More...
 
template<>
bool DAE_GetElementAttributeValue (xmlNode *pElement, const char *pAttributeName, FbxString &pData)
 
bool DAE_CompareAttributeValue (xmlNode *pElement, const char *pAttributeName, const char *pValue)
 Compare the value of specific attribute of specific element with given value. More...
 
const FbxString DAE_GetIDFromUrlAttribute (xmlNode *pElement, FbxString &pExternalRef)
 Get the ID of another element from the url attribute of the given element. More...
 
const FbxString DAE_GetIDFromSourceAttribute (xmlNode *pElement)
 Get the ID of another element from the source attribute of the given element. More...
 
const FbxString DAE_GetIDFromTargetAttribute (xmlNode *pElement)
 Get the ID of another element from the target attribute of the given element. More...
 
void DAE_SetName (FbxObject *pObject, const FbxString &pName, const FbxString &pID)
 Set the name of the object with a given name. More...
 
xmlNode * DAE_GetSourceWithSemantic (xmlNode *pConsumerElement, const char *pSemantic, const SourceElementMapType &pSourceElements)
 Get the COLLADA source element with a semantic meaning and a consumer element; The COLLADA input element declares the input connections to a data source that a consumer requires. More...
 
template<typename T >
xmlNode * DAE_AddChildElement (xmlNode *pParentElement, const char *pTag, const T &pContent)
 Add a child element with specific content. More...
 
xmlNode * DAE_AddChildElement (xmlNode *pParentElement, const char *pTag)
 
xmlNode * DAE_NewElement (const char *pTag)
 
template<typename T >
xmlAttr * DAE_AddAttribute (xmlNode *pElement, const FbxString &pAttributeName, const T &pAttributeValue)
 Add an attribute for a element. More...
 
const FbxSystemUnit DAE_ImportUnit (xmlNode *pUnitElement)
 Import a COLLADA unit element into a FBX system unit. More...
 
void IncreaseLclTranslationAnimation (FbxNode *pNode, FbxDouble3 &pOffset)
 If the specific node has animation on its local translation, increase every key by the offset. More...
 
void RecursiveSearchElement (xmlNode *pBaseElement, const char *pTag, FbxArray< xmlNode *> &pResult)
 Search the elements with given tag, push the found results to the end of the given array. More...
 

Variables

const int MATRIX_STRIDE = 16
 
const int VECTOR_STRIDE = 3
 

Macro Definition Documentation

◆ INT_MAX

#define INT_MAX   0x7FFFFFFF

Definition at line 43 of file fbxcolladautils.h.

◆ CENTIMETERS_TO_INCHES

#define CENTIMETERS_TO_INCHES   2.54f

Definition at line 47 of file fbxcolladautils.h.

◆ RADIANS_TO_DEGREES

#define RADIANS_TO_DEGREES   57.295799f

Definition at line 51 of file fbxcolladautils.h.

◆ COLLADA_ID_PROPERTY_NAME

#define COLLADA_ID_PROPERTY_NAME   "COLLADA_ID"

Definition at line 59 of file fbxcolladautils.h.

Typedef Documentation

◆ XmlNodePtr

Definition at line 74 of file fbxcolladautils.h.

◆ SourceElementMapType

typedef FbxMap< FbxString, xmlNode* > SourceElementMapType

Definition at line 75 of file fbxcolladautils.h.

◆ SkinMapType

typedef FbxMap< FbxString, xmlNode* > SkinMapType

Definition at line 76 of file fbxcolladautils.h.

◆ CNodeList

typedef FbxArray<xmlNode*> CNodeList

Definition at line 159 of file fbxcolladautils.h.

Enumeration Type Documentation

◆ DAE_Flow

enum DAE_Flow
Enumerator
kCOLLADAFlowIn 
kCOLLADAFlowOut 
kCOLLADAFlowInOut 

Definition at line 54 of file fbxcolladautils.h.

Function Documentation

◆ DAE_AddNotificationError()

void DAE_AddNotificationError ( const FbxManager pSdkManger,
const FbxString pErrorMessage 
)

Emit error message.

Parameters
pSdkMangerThe SDK manager used to access user notification object.
pErrorMessageThe message to be presented.

◆ DAE_AddNotificationWarning()

void DAE_AddNotificationWarning ( const FbxManager pSdkManger,
const FbxString pWarningMessage 
)

Emit warning message.

Parameters
pSdkMangerThe SDK manager used to access user notification object.
pWarningMessageThe message to be presented.

◆ DAE_ExportArray() [1/5]

void DAE_ExportArray ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< FbxVector4 > &  arr 
)

◆ DAE_ExportArray() [2/5]

void DAE_ExportArray ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< FbxVector2 > &  arr 
)

◆ DAE_ExportArray() [3/5]

void DAE_ExportArray ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< FbxColor > &  arr 
)

◆ DAE_ExportArray() [4/5]

void DAE_ExportArray ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< double > &  arr 
)

◆ DAE_ExportArray() [5/5]

void DAE_ExportArray ( xmlNode *  parentXmlNode,
const char *  id,
FbxStringList arr 
)

◆ DAE_ExportSource14() [1/7]

xmlNode* DAE_ExportSource14 ( xmlNode *  parentXmlNode,
const char *  id,
FbxStringList accessorParams,
FbxArray< double > &  arr,
bool  isCommonProfile = true 
)

◆ DAE_ExportSource14() [2/7]

xmlNode* DAE_ExportSource14 ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< FbxVector4 > &  arr 
)

◆ DAE_ExportSource14() [3/7]

xmlNode* DAE_ExportSource14 ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< FbxVector2 > &  arr 
)

◆ DAE_ExportSource14() [4/7]

xmlNode* DAE_ExportSource14 ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< FbxColor > &  arr 
)

◆ DAE_ExportSource14() [5/7]

xmlNode* DAE_ExportSource14 ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< FbxAMatrix > &  arr 
)

◆ DAE_ExportSource14() [6/7]

xmlNode* DAE_ExportSource14 ( xmlNode *  parentXmlNode,
const char *  id,
FbxArray< FbxMatrix > &  arr 
)

◆ DAE_ExportSource14() [7/7]

xmlNode* DAE_ExportSource14 ( xmlNode *  parentXmlNode,
const char *  id,
FbxStringList arr,
const char *  type,
bool  isCommonProfile = true 
)

◆ DAE_ExportSourceArray()

void DAE_ExportSourceArray ( xmlNode *  sourceNode,
const char *  id,
FbxArray< FbxColor > &  arr 
)

◆ DAE_ExportSourceArray14()

void DAE_ExportSourceArray14 ( xmlNode *  sourceNode,
const char *  id,
FbxArray< FbxColor > &  arr 
)

◆ DAE_ExportAccessor()

xmlNode* DAE_ExportAccessor ( xmlNode *  parentXmlNode,
const char *  id,
const char *  arrayRef,
int  count,
int  stride,
const char *  name,
const char *  type 
)

◆ DAE_ExportAccessor14()

xmlNode* DAE_ExportAccessor14 ( xmlNode *  parentXmlNode,
const char *  id,
const char *  arrayRef,
int  count,
int  stride,
const char *  name,
const char *  type 
)

◆ DAE_AddXYZAccessor()

void DAE_AddXYZAccessor ( xmlNode *  parentXmlNode,
const char *  profile,
const char *  arrayName,
const char *  arrayRef,
int  count 
)

◆ DAE_AddSTAccessor()

void DAE_AddSTAccessor ( xmlNode *  parentXmlNode,
const char *  profile,
const char *  arrayName,
const char *  arrayRef,
int  count 
)

◆ DAE_AddFlow()

void DAE_AddFlow ( xmlNode *  node,
DAE_Flow  flow 
)

◆ DAE_AddXYZAccessor14()

void DAE_AddXYZAccessor14 ( xmlNode *  parentXmlNode,
const char *  profile,
const char *  arrayName,
const char *  arrayRef,
int  count 
)

◆ DAE_AddSTAccessor14()

void DAE_AddSTAccessor14 ( xmlNode *  parentXmlNode,
const char *  profile,
const char *  arrayName,
const char *  arrayRef,
int  count 
)

◆ DAE_AddParameter() [1/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
const FbxColor color,
DAE_Flow  flow 
)

◆ DAE_AddParameter() [2/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
const FbxVector4 vector,
DAE_Flow  flow 
)

◆ DAE_AddParameter() [3/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
double  value,
DAE_Flow  flow 
)

◆ DAE_AddParameter() [4/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
bool  value,
DAE_Flow  flow 
)

◆ DAE_AddParameter() [5/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
const char *  type,
const char *  value,
DAE_Flow  flow 
)

◆ DAE_AddParameter() [6/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
const FbxDouble3 color 
)

◆ DAE_AddParameter() [7/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
const FbxColor color 
)

◆ DAE_AddParameter() [8/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
const FbxVector4 vector 
)

◆ DAE_AddParameter() [9/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
double  value 
)

◆ DAE_AddParameter() [10/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
bool  value 
)

◆ DAE_AddParameter() [11/11]

xmlNode* DAE_AddParameter ( xmlNode *  parentXmlNode,
const char *  name,
const char *  type,
const char *  value 
)

◆ DAE_AddTechnique()

xmlNode* DAE_AddTechnique ( xmlNode *  parentXmlNode,
const char *  technique 
)

◆ DAE_AddInput()

void DAE_AddInput ( xmlNode *  parentXmlNode,
const char *  semantic,
const char *  source,
int  idx = -1 
)

◆ DAE_AddInput14()

void DAE_AddInput14 ( xmlNode *  parentXmlNode,
const char *  semantic,
const char *  source,
int  offset = -1,
int  set = -1 
)

◆ matrixToString()

FbxString matrixToString ( const FbxAMatrix mx)

◆ findChildrenByType() [1/2]

void findChildrenByType ( xmlNode *  pParentElement,
const FbxSet< FbxString > &  pTypes,
CNodeList pChildrenElements 
)

Find children elements whose type is included in a list of type.

Parameters
pParentElementThe parent element.
pTypesThe list of types.
pChildrenElementsThe found children elements.

◆ findChildrenByType() [2/2]

void findChildrenByType ( xmlNode *  pParentElement,
const char *  pType,
CNodeList pChildrenElements 
)

Find children elements of a specific type.

Parameters
pParentElementThe parent element.
pTypeThe type.
pChildrenElementsThe found children elements.

◆ getSourceAccessor()

xmlNode* getSourceAccessor ( xmlNode *  sourceNode)

◆ getTechniqueNode()

xmlNode* getTechniqueNode ( xmlNode *  parent,
const char *  profile 
)

◆ inchesToCentimeters()

double inchesToCentimeters ( double  val)
inline

Definition at line 179 of file fbxcolladautils.h.

179 { return FbxFloor(val / CENTIMETERS_TO_INCHES * 100000) / 100000; }
float FbxFloor(const float x)
Definition: fbxmath.h:134
#define CENTIMETERS_TO_INCHES

◆ centimetersToInches()

double centimetersToInches ( double  val)
inline

Definition at line 180 of file fbxcolladautils.h.

180 { return FbxFloor(val * CENTIMETERS_TO_INCHES * 100000) / 100000; }
float FbxFloor(const float x)
Definition: fbxmath.h:134
#define CENTIMETERS_TO_INCHES

◆ degreesToRadians()

double degreesToRadians ( double  val)
inline

Definition at line 182 of file fbxcolladautils.h.

182 { return FbxFloor(val / RADIANS_TO_DEGREES * 100000) / 100000; }
float FbxFloor(const float x)
Definition: fbxmath.h:134
#define RADIANS_TO_DEGREES

◆ radiansToDegrees()

double radiansToDegrees ( double  val)
inline

Definition at line 183 of file fbxcolladautils.h.

183 { return FbxFloor(val * RADIANS_TO_DEGREES * 100000) / 100000; }
float FbxFloor(const float x)
Definition: fbxmath.h:134
#define RADIANS_TO_DEGREES

◆ DAE_FindChildElementByAttribute()

xmlNode* DAE_FindChildElementByAttribute ( xmlNode *  pParentElement,
const char *  pAttributeName,
const char *  pAttributeValue,
const char *  pDefaultAttributeValue = "" 
)

Find a child element with a given attribute value.

Parameters
pParentElementThe parent element.
pAttributeNameThe name of the attribute.
pAttributeValueThe value of the attribute.
pDefaultAttributeValueThe default value of the attribute used when the attribute is not found explicitly.
Returns
Return NULL if no child element has the given attribute value.

◆ DAE_FindChildElementByTag()

xmlNode* DAE_FindChildElementByTag ( xmlNode *  pParentElement,
const char *  pTag,
xmlNode *  pFindFrom = ((void *) 0) 
)

Find a child element with a given tag.

Parameters
pParentElementThe parent element.
pTagThe value of the tag.
pFindFromFind from the next child after pFindFrom if pFindFrom is not NULL.
Returns
Return NULL if no child element has the given tag.

◆ DAE_GetElementContent()

void DAE_GetElementContent ( xmlNode *  pElement,
TYPE &  pData 
)

Get the content of a XML element.

Parameters
pElementThe element whose content is returned.
pDataThe returned data.

Definition at line 208 of file fbxcolladautils.h.

209 {
210  if (pElement != NULL)
211  {
212  FbxAutoFreePtr<xmlChar> lContent(xmlNodeGetContent(pElement));
213  FromString(&pData, (const char *)lContent.Get());
214  }
215 }
bool FromString(T *pDest, const char *pSourceBegin, const char **pSourceEnd=((void *) 0))
Convert part of the source string into destination type.
#define NULL
Definition: fbxarch.h:210
Scoped pointer for FbxMalloc allocations, which call FbxFree() to deallocate.
Definition: fbxalloc.h:253

◆ DAE_CheckCompatibility()

bool DAE_CheckCompatibility ( xmlNode *  pNodeElement)

Check whether this node is compatible to FBX transform structure.

Parameters
pNodeElementThe specific node element.
Returns
Return true if it is compatible.

◆ DAE_GetElementTag()

void DAE_GetElementTag ( xmlNode *  pElement,
FbxString pTag 
)

Get the tag of the specific element.

Parameters
pElementThe specific element.
pTagReturn the tag of the element.

◆ DAE_GetElementAttributeValue() [1/3]

const FbxString DAE_GetElementAttributeValue ( xmlNode *  pElement,
const char *  pAttributeName 
)

Get the value of an attribute of an element.

Parameters
pElementThe specific XML element.
pAttributeNameThe name of the specific attribute.
Returns
The value of the attribute in the form of a string. If the attribute is not available, an empty string is returned.

◆ DAE_GetElementAttributeValue() [2/3]

bool DAE_GetElementAttributeValue ( xmlNode *  pElement,
const char *  pAttributeName,
TYPE &  pData 
)

Get the value of an attribute of an element.

Parameters
pElementThe specific XML element.
pAttributeNameThe name of the specific attribute.
pDataThe returned data.
Returns
Return true on success and false if no attribute has the given name.

Definition at line 243 of file fbxcolladautils.h.

244 {
245  if (!pElement || !pAttributeName)
246  return false;
247 
248  FbxAutoFreePtr<xmlChar> lPropertyValue(xmlGetProp(pElement, (const xmlChar *)pAttributeName));
249  if (lPropertyValue)
250  {
251  FromString(&pData, (const char *)lPropertyValue.Get());
252  return true;
253  }
254  return false;
255 }
bool FromString(T *pDest, const char *pSourceBegin, const char **pSourceEnd=((void *) 0))
Convert part of the source string into destination type.
Scoped pointer for FbxMalloc allocations, which call FbxFree() to deallocate.
Definition: fbxalloc.h:253

◆ DAE_GetElementAttributeValue() [3/3]

bool DAE_GetElementAttributeValue ( xmlNode *  pElement,
const char *  pAttributeName,
FbxString pData 
)
inline

Definition at line 260 of file fbxcolladautils.h.

263 {
264  if (!pElement || !pAttributeName)
265  return false;
266 
267  FbxAutoFreePtr<xmlChar> lPropertyValue(xmlGetProp(pElement, (const xmlChar *)pAttributeName));
268  if (lPropertyValue)
269  {
270  pData = (const char *)lPropertyValue.Get();
271  return true;
272  }
273  return false;
274 }
Scoped pointer for FbxMalloc allocations, which call FbxFree() to deallocate.
Definition: fbxalloc.h:253

◆ DAE_CompareAttributeValue()

bool DAE_CompareAttributeValue ( xmlNode *  pElement,
const char *  pAttributeName,
const char *  pValue 
)

Compare the value of specific attribute of specific element with given value.

Parameters
pElementThe specific element.
pAttributeNameThe name of the specific attribute.
pValueThe value to compare with.
Returns
Return true if values equal.

◆ DAE_GetIDFromUrlAttribute()

const FbxString DAE_GetIDFromUrlAttribute ( xmlNode *  pElement,
FbxString pExternalRef 
)

Get the ID of another element from the url attribute of the given element.

Parameters
pElementThe specific XML element in which the ID is looked for.
pExternalRefThe external reference part of the url (before the #)
Returns
The ID of another element if success, or an empty string if no url attributes are found.

◆ DAE_GetIDFromSourceAttribute()

const FbxString DAE_GetIDFromSourceAttribute ( xmlNode *  pElement)

Get the ID of another element from the source attribute of the given element.

Parameters
pElementThe specific XML element in which the ID is looked for.
Returns
The ID of another element if success, or an empty string if no source attributes are found.

◆ DAE_GetIDFromTargetAttribute()

const FbxString DAE_GetIDFromTargetAttribute ( xmlNode *  pElement)

Get the ID of another element from the target attribute of the given element.

Note that in target attribute, the URI identifier may or may not preceded with the pound sign.

Parameters
pElementThe specific XML element in which the ID is looked for.
Returns
The ID of another element if success, or an empty string if no target attributes are found.

◆ DAE_SetName()

void DAE_SetName ( FbxObject pObject,
const FbxString pName,
const FbxString pID 
)

Set the name of the object with a given name.

If the name is empty, use the ID.

Parameters
pObjectThe object whose name is to be set.
pNameThe name string.
pIDThe ID string.

◆ DAE_GetSourceWithSemantic()

xmlNode* DAE_GetSourceWithSemantic ( xmlNode *  pConsumerElement,
const char *  pSemantic,
const SourceElementMapType pSourceElements 
)

Get the COLLADA source element with a semantic meaning and a consumer element; The COLLADA input element declares the input connections to a data source that a consumer requires.

A data source is a container of raw data that lacks semantic meaning so that the data can be reused within the document. To use the data, a consumer declares a connection to it with the desired semantic information.

Parameters
pConsumerElementA consumer element, like sampler element in animation system or joints element in controller system.
pSemanticA semantic meaning, like "INPUT", "OUTPUT" or "INTERPOLATION" in animation system.
pSourceElementsThe container of raw data.
Returns
Return NULL is failed.

◆ DAE_AddChildElement() [1/2]

xmlNode* DAE_AddChildElement ( xmlNode *  pParentElement,
const char *  pTag,
const T &  pContent 
)

Add a child element with specific content.

Parameters
pParentElementThe parent element.
pTagThe tag string of the new child element.
pContentThe content of the child element.
Returns
The created child element.

Definition at line 332 of file fbxcolladautils.h.

334 {
335  const FbxString lRepr = ToString(pContent);
336  return xmlNewChild(pParentElement, NULL, (xmlChar *)pTag,
337  (xmlChar *)lRepr.Buffer());
338 }
const FbxString ToString(const T &pValue)
#define NULL
Definition: fbxarch.h:210
Utility class to manipulate strings.
Definition: fbxstring.h:66
char * Buffer()
Non-const buffer access.

◆ DAE_AddChildElement() [2/2]

xmlNode* DAE_AddChildElement ( xmlNode *  pParentElement,
const char *  pTag 
)
inline

Definition at line 341 of file fbxcolladautils.h.

342 {
343  return DAE_AddChildElement(pParentElement, pTag, FbxString());
344 }
Utility class to manipulate strings.
Definition: fbxstring.h:66
xmlNode * DAE_AddChildElement(xmlNode *pParentElement, const char *pTag, const T &pContent)
Add a child element with specific content.

◆ DAE_NewElement()

xmlNode* DAE_NewElement ( const char *  pTag)
inline

Definition at line 347 of file fbxcolladautils.h.

348 {
349  return xmlNewNode(NULL, reinterpret_cast<xmlChar*>(const_cast<char *>(pTag)));
350 }
#define NULL
Definition: fbxarch.h:210

◆ DAE_AddAttribute()

xmlAttr* DAE_AddAttribute ( xmlNode *  pElement,
const FbxString pAttributeName,
const T &  pAttributeValue 
)

Add an attribute for a element.

Parameters
pElementThe element where the attribute is added.
pAttributeNameThe name of the attribute.
pAttributeValueThe value of the attribute.
Returns
The created attribute.

Definition at line 359 of file fbxcolladautils.h.

361 {
362  const FbxString lRepr = ToString(pAttributeValue);
363  return xmlNewProp(pElement, (xmlChar *)pAttributeName.Buffer(),
364  (xmlChar *)lRepr.Buffer());
365 }
const FbxString ToString(const T &pValue)
Utility class to manipulate strings.
Definition: fbxstring.h:66
char * Buffer()
Non-const buffer access.

◆ DAE_ImportUnit()

const FbxSystemUnit DAE_ImportUnit ( xmlNode *  pUnitElement)

Import a COLLADA unit element into a FBX system unit.

Parameters
pUnitElementThe COLLADA unit element.
Returns
The created FBX system unit.

◆ IncreaseLclTranslationAnimation()

void IncreaseLclTranslationAnimation ( FbxNode pNode,
FbxDouble3 pOffset 
)

If the specific node has animation on its local translation, increase every key by the offset.

Parameters
pNodeThe specific node.
pOffsetThe specific offset value.

◆ RecursiveSearchElement()

void RecursiveSearchElement ( xmlNode *  pBaseElement,
const char *  pTag,
FbxArray< xmlNode *> &  pResult 
)

Search the elements with given tag, push the found results to the end of the given array.

Parameters
pBaseElementSearch from this element.
pTagThe given tag.
pResultThe array to return the found results.

Variable Documentation

◆ MATRIX_STRIDE

const int MATRIX_STRIDE = 16

Definition at line 56 of file fbxcolladautils.h.

◆ VECTOR_STRIDE

const int VECTOR_STRIDE = 3

Definition at line 57 of file fbxcolladautils.h.

Go to the source code of this file.