fbximplementationutils.h File Reference

#include <fbxsdk/fbxsdk_def.h>
#include <fbxsdk/scene/shading/fbximplementation.h>
#include <fbxsdk/scene/shading/fbxbindingoperator.h>
#include <fbxsdk/scene/shading/fbxoperatorentryview.h>
#include <fbxsdk/scene/shading/fbxpropertyentryview.h>
#include <fbxsdk/fbxsdk_nsbegin.h>
#include <fbxsdk/fbxsdk_nsend.h>

Go to the source code of this file.

Functions

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

Detailed Description

Definition in file fbximplementationutils.h.


Function Documentation

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

Get FbxImplementation from FbxObject.

Parameters:
pObjectFbxObject to get FbxImplementation.
pImplementationTargetName of the implementation property to get.
Returns:
FbxImplementation Pointer to FbxImplementation.
bool GetBoundPropertyValue ( FbxBindingTable const *  pBindingTable,
char const *  pEntryName,
FbxImplementation const *  pImplementation,
FbxObject const *  pBoundObject,
T &  pValue 
)

Get bound property value from FbxBindingTable.

Parameters:
pBindingTableFbxBindingTable to get bound property value.
pEntryNameName of the Entry type to get.
pImplementationFbxImplementation of the bound property value to get if the Entry type is FbxOperatorEntryView::sEntryType.
pBoundObjectFbxObject of the bound property value to get if the Entry type is FbxPropertyEntryView::sEntryType.
pValuePointer 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))
    {
        FbxBindingTableEntry const* lEntry = pBindingTable->GetEntryForDestination(pEntryName);

        if (NULL != lEntry)
        {
            if (strcmp(lEntry->GetEntryType(true), FbxPropertyEntryView::sEntryType) == 0)
            {
                char const* 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)
            {
                char const* lOperatorName = lEntry->GetSource();
                FbxBindingOperator const* lOp = pImplementation->GetOperatorByTargetName(lOperatorName);
                if (lOp)
                {
                    return lOp->Evaluate(pBoundObject, &pValue);
                }
            }
        }
    }

    return false;
}