本文整理汇总了C++中UMaterial::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ UMaterial::GetName方法的具体用法?C++ UMaterial::GetName怎么用?C++ UMaterial::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMaterial
的用法示例。
在下文中一共展示了UMaterial::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ImportMaterialsForSkelMesh
/**
* Extract the material names from the Apex Render Mesh contained within an Apex Destructible Asset.
* @param ImportData - SkeletalMesh import data into which we are extracting information
* @param ApexDestructibleAsset - the Apex Destructible Asset
*/
static void ImportMaterialsForSkelMesh(FSkeletalMeshImportData &ImportData, const NxDestructibleAsset& ApexDestructibleAsset)
{
physx::PxU32 SubmeshCount = 0;
// Get the submesh count from the Destructible Asset's Render Mesh
const physx::NxRenderMeshAsset* ApexRenderMesh = ApexDestructibleAsset.getRenderMeshAsset();
if (ApexRenderMesh != NULL)
{
SubmeshCount = ApexRenderMesh->getSubmeshCount();
}
if( SubmeshCount == 0 )
{
// No material info, create a default material slot
++SubmeshCount;
UE_LOG(LogApexDestructibleAssetImport, Warning,TEXT("No material associated with skeletal mesh - using default"));
}
else
{
UE_LOG(LogApexDestructibleAssetImport, Warning,TEXT("Using default materials for material slot"));
}
// Create material slots
UMaterial* DefaultMaterial = UMaterial::GetDefaultMaterial(MD_Surface);
if (DefaultMaterial)
{
for (uint32 MatIndex = 0; MatIndex < SubmeshCount; MatIndex++)
{
ImportData.Materials.Add( VMaterial() );
ImportData.Materials.Last().Material = DefaultMaterial;
ImportData.Materials.Last().MaterialImportName = DefaultMaterial->GetName();
}
}
}