fbxsdk/scene/shading/fbximplementationutils.h File Reference
 
 
 
fbxsdk/scene/shading/fbximplementationutils.h File Reference

File Description

Definition in file fbximplementationutils.h.

Functions

FBXSDK_DLL const
FbxImplementation
GetImplementation (const FbxObject *pObject, const char *pImplementationTarget)
  Get FbxImplementation from FbxObject.
template<typename T >
bool  GetBoundPropertyValue (const FbxBindingTable *pBindingTable, const char *pEntryName, const FbxImplementation *pImplementation, const FbxObject *pBoundObject, T &pValue)
  Get bound property value from FbxBindingTable.

Function Documentation

FBXSDK_DLL const FbxImplementation* GetImplementation ( const FbxObject pObject,
const char *  pImplementationTarget 
)

Get FbxImplementation from FbxObject.

Parameters:
pObject FbxObject to get FbxImplementation.
pImplementationTarget Name of the implementation property to get.
Returns:
FbxImplementation Pointer to FbxImplementation.
Examples:
ImportScene/DisplayMaterial.cxx.
bool GetBoundPropertyValue ( const FbxBindingTable pBindingTable,
const char *  pEntryName,
const FbxImplementation pImplementation,
const FbxObject pBoundObject,
T &  pValue 
)

Get bound property value from FbxBindingTable.

Parameters:
pBindingTable FbxBindingTable to get bound property value.
pEntryName Name of the Entry type to get.
pImplementation FbxImplementation of the bound property value to get if the Entry type is FbxOperatorEntryView::sEntryType.
pBoundObject FbxObject of the bound property value to get if the Entry type is FbxPropertyEntryView::sEntryType.
pValue Pointer to bound property value from FbxBindingTable.
Returns:
Whether get bound property value success or not.

Definition at line 40 of file fbximplementationutils.h.

{
    if ((NULL != pImplementation) && (NULL != pBindingTable) && (NULL != pBoundObject) && (NULL != pEntryName))
    {
        const FbxBindingTableEntry* lEntry = pBindingTable->GetEntryForDestination(pEntryName);

        if (NULL != lEntry)
        {
            if (strcmp(lEntry->GetEntryType(true), FbxPropertyEntryView::sEntryType) == 0)
            {
                const char* lPropName = lEntry->GetSource();
                FbxProperty lProp = pBoundObject->FindPropertyHierarchical(lPropName);
                if (lProp.IsValid())
                {
                                        pValue = lProp.Get<T>();
                    return true;
                }
            }
            else if (strcmp(lEntry->GetEntryType(true), FbxOperatorEntryView::sEntryType) == 0)
            {
                const char* lOperatorName = lEntry->GetSource();
                const FbxBindingOperator* lOp = pImplementation->GetOperatorByTargetName(lOperatorName);
                if (lOp)
                {
                    return lOp->Evaluate(pBoundObject, &pValue);
                }
            }
        }
    }

    return false;
}

Go to the source code of this file.