Browse Source

In O3DE I moved the material slot list from ModelLodAsset to ModelAsset. This required change in ASV's skinned mesh sample to match the new API. I haven't been able to test these changes because the skinned mesh sample was already broken and disabled.

Signed-off-by: santorac <[email protected]>
Chris Santora 4 years ago
parent
commit
ae9e6058cd
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Gem/Code/Source/ProceduralSkinnedMeshUtils.cpp

+ 3 - 1
Gem/Code/Source/ProceduralSkinnedMeshUtils.cpp

@@ -98,7 +98,9 @@ namespace AtomSampleViewer
         AZ::Aabb localAabb = AZ::Aabb::CreateCenterHalfExtents(AZ::Vector3(0.0f, 0.0f, 0.0f), AZ::Vector3(1000000.0f, 1000000.0f, 1000000.0f));
         modelLodCreator.SetMeshAabb(AZStd::move(localAabb));
 
-        modelLodCreator.SetMeshMaterialSlot(RPI::ModelMaterialSlot{0, AZ::Name{}, AZ::RPI::AssetUtils::LoadAssetByProductPath<AZ::RPI::MaterialAsset>(DefaultSkinnedMeshMaterial)});
+        RPI::ModelMaterialSlot::StableId slotId = 0;
+        modelCreator.AddMaterialSlot(RPI::ModelMaterialSlot{slotId, AZ::Name{}, AZ::RPI::AssetUtils::LoadAssetByProductPath<AZ::RPI::MaterialAsset>(DefaultSkinnedMeshMaterial)});
+        modelLodCreator.SetMeshMaterialSlot(slotId);
 
         modelLodCreator.EndMesh();