소스 검색

In O3DE, fixed an issue with Actors where the material slot IDs were incorrect. This requires corresponding code changes in ASV.
I'm not sure whether these changes work correctly, since the skinned mesh sample is not hooked up and doesn't appear to be functional.

Signed-off-by: santorac <[email protected]>

Chris Santora 4 년 전
부모
커밋
cfed7b4c58
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      Gem/Code/Source/ProceduralSkinnedMeshUtils.cpp

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

@@ -98,7 +98,7 @@ 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.SetMeshMaterialAsset(AZ::RPI::AssetUtils::LoadAssetByProductPath<AZ::RPI::MaterialAsset>(DefaultSkinnedMeshMaterial));
+        modelLodCreator.SetMeshMaterialSlot(RPI::ModelMaterialSlot{0, AZ::Name{}, AZ::RPI::AssetUtils::LoadAssetByProductPath<AZ::RPI::MaterialAsset>(DefaultSkinnedMeshMaterial)});
 
         modelLodCreator.EndMesh();
 
@@ -140,7 +140,8 @@ namespace AtomSampleViewer
             subMesh.m_vertexOffset = 0;
             subMesh.m_vertexCount = lodVertexCount;
             // Do a load blocking queue on the material asset because the ModelLod will ignore the material if it is not ready
-            subMesh.m_material = AZ::RPI::AssetUtils::LoadAssetByProductPath<AZ::RPI::MaterialAsset>(DefaultSkinnedMeshMaterial);
+            subMesh.m_materialSlot.m_defaultMaterialAsset = AZ::RPI::AssetUtils::LoadAssetByProductPath<AZ::RPI::MaterialAsset>(DefaultSkinnedMeshMaterial);
+            subMesh.m_materialSlot.m_stableId = 0;
 
             subMeshes.push_back(subMesh);