本文整理汇总了C++中FbxSurfaceMaterial::FindPropertyHierarchical方法的典型用法代码示例。如果您正苦于以下问题:C++ FbxSurfaceMaterial::FindPropertyHierarchical方法的具体用法?C++ FbxSurfaceMaterial::FindPropertyHierarchical怎么用?C++ FbxSurfaceMaterial::FindPropertyHierarchical使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FbxSurfaceMaterial
的用法示例。
在下文中一共展示了FbxSurfaceMaterial::FindPropertyHierarchical方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void Tools::DisplayMaterial::DisplayMaterial( FbxGeometry *i_geometry )
{
DisplayCommon::DisplayString( "\n\n--------------------\nMaterial\n--------------------" );
int materialCount = 0;
FbxNode *node = NULL;
if( i_geometry )
{
node = i_geometry->GetNode();
if( node )
materialCount = node->GetMaterialCount();
}
if( materialCount > 0 )
{
FbxPropertyT<FbxDouble3> double3;
FbxPropertyT<FbxDouble> double1;
FbxColor theColor;
for( int ctr = 0; ctr < materialCount; ctr++ )
{
DisplayCommon::DisplayInt( " Material ", ctr );
FbxSurfaceMaterial *material = node->GetMaterial( ctr );
DisplayCommon::DisplayString( " Name: \"", (char *) material->GetName(), "\"" );
#ifdef DISPLAY_HARDWARE_SHADER_INFORMATION
//Get the implementation to see if it's a hardware shader.
// Note:: this cause memory leak
const FbxImplementation* implementation = GetImplementation( material, FBXSDK_IMPLEMENTATION_HLSL );
FbxString implementationType = "HLSL";
if( !implementation )
{
implementation = GetImplementation( material, FBXSDK_IMPLEMENTATION_CGFX );
implementationType = "CGFX";
}
if( implementation )
{
//Now we have a hardware shader, let's read it
FBXSDK_printf( " Hardware Shader Type: %s\n", implemenationType.Buffer() );
DisplayCommon::DisplayString( " Hardware Shader Type: ", implemenationType );
const FbxBindingTable* rootTable = implementation->GetRootTable();
FbxString fileName = rootTable->DescAbsoluteURL.Get();
FbxString techniqueName = rootTable->DescTAG.Get();
const FbxBindingTable* table = implementation->GetRootTable();
size_t entryNum = table->GetEntryCount();
for( int i = 0; i < (int)entryNum; i++ )
{
const FbxBindingTableEntry& entry = table->GetEntry( i );
const char *entrySrcType = entry.GetEntryType( true );
FbxProperty fbxProp;
FbxString test = entry.GetSource();
FBXSDK_printf( " Entry: %s\n", test.Buffer() );
DisplayCommon::DisplayString( " Entry: %s\n", test );
if ( strcmp( FbxPropertyEntryView::sEntryType, entrySrcType ) == 0 )
{
fbxProp = material->FindPropertyHierarchical(entry.GetSource());
if( !fbxProp.IsValid() )
{
fbxProp = material->RootProperty.FindHierarchical( entry.GetSource() );
}
}
else if( strcmp( FbxConstantEntryView::sEntryType, entrySrcType ) == 0 )
{
fbxProp = implementation->GetConstants().FindHierarchical( entry.GetSource() );
}
if( fbxProp.IsValid() )
{
if( fbxProp.GetSrcObjectCount<FbxTexture>() > 0 )
{
//do what you want with the textures
for( int j = 0; j < fbxProp.GetSrcObjectCount<FbxFileTexture>(); j++ )
{
FbxFileTexture *tex = fbxProp.GetSrcObject<FbxFileTexture>( j );
FBXSDK_printf( " File Texture: %s\n", tex->GetFileName() );
DisplayCommon::DisplayString( " File Texture: %s\n", tex->GetFileName() );
}
for( int j = 0; j < fbxProp.GetSrcObjectCount<FbxLayeredTexture>(); j++ )
{
FbxLayeredTexture *tex = fbxProp.GetSrcObject<FbxLayeredTexture>( j );
FBXSDK_printf( " Layered Texture: %s\n", tex->GetName() );
DisplayCommon::DisplayString( " Layered Texture: %s\n", tex->GetName() );
}
for( int j = 0; j < fbxProp.GetSrcObjectCount<FbxProceduralTexture>(); j++ )
{
FbxProceduralTexture *tex = fbxProp.GetSrcObject<FbxProceduralTexture>( j );
FBXSDK_printf( " Procedural Texture: %s\n", tex->GetName() );
DisplayCommon::DisplayString( " Procedural Texture: %s\n", tex->GetName() );
}
}
else
{
FbxDataType fbxType = fbxProp.GetPropertyDataType();
//.........这里部分代码省略.........