Go
to the documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013 #ifndef _FBXSDK_SCENE_SHADING_IMPLEMENTATION_UTILS_H_
00014 #define _FBXSDK_SCENE_SHADING_IMPLEMENTATION_UTILS_H_
00015
00016 #include <fbxsdk/fbxsdk_def.h>
00017
00018 #include <fbxsdk/scene/shading/fbximplementation.h>
00019 #include <fbxsdk/scene/shading/fbxbindingoperator.h>
00020 #include <fbxsdk/scene/shading/fbxoperatorentryview.h>
00021 #include <fbxsdk/scene/shading/fbxpropertyentryview.h>
00022
00023 #include <fbxsdk/fbxsdk_nsbegin.h>
00024
00030 FBXSDK_DLL FbxImplementation const* GetImplementation( FbxObject const* pObject, char const* pImplementationTarget );
00031
00040 template <typename T> bool GetBoundPropertyValue(FbxBindingTable const* pBindingTable,
00041 char const* pEntryName,
00042 FbxImplementation const* pImplementation,
00043 FbxObject const* pBoundObject,
00044 T& pValue)
00045 {
00046 if ((NULL != pImplementation) && (NULL != pBindingTable) && (NULL != pBoundObject) && (NULL != pEntryName))
00047 {
00048 FbxBindingTableEntry const* lEntry = pBindingTable->GetEntryForDestination(pEntryName);
00049
00050 if (NULL != lEntry)
00051 {
00052 if (strcmp(lEntry->GetEntryType(true), FbxPropertyEntryView::sEntryType) == 0)
00053 {
00054 char const* lPropName = lEntry->GetSource();
00055 FbxProperty lProp = pBoundObject->FindPropertyHierarchical(lPropName);
00056 if (lProp.IsValid())
00057 {
00058 pValue = lProp.Get<T>();
00059 return true;
00060 }
00061 }
00062 else if (strcmp(lEntry->GetEntryType(true), FbxOperatorEntryView::sEntryType) == 0)
00063 {
00064 char const* lOperatorName = lEntry->GetSource();
00065 FbxBindingOperator const* lOp = pImplementation->GetOperatorByTargetName(lOperatorName);
00066 if (lOp)
00067 {
00068 return lOp->Evaluate(pBoundObject, &pValue);
00069 }
00070 }
00071 }
00072 }
00073
00074 return false;
00075 }
00076
00077 #include <fbxsdk/fbxsdk_nsend.h>
00078
00079 #endif