ATOM-15346 : Morph target buffer only found on first Atom mesh (merge from 1.0->main)
Instead of assuming the first submesh will always have a reference to the morph target buffer, search the submeshes to find the first one that does.
This commit is contained in:
@@ -500,7 +500,16 @@ namespace AZ
|
||||
skinnedMeshLod.SetIndexBufferAsset(mesh0.GetIndexBufferAssetView().GetBufferAsset());
|
||||
skinnedMeshLod.SetStaticBufferAsset(mesh0.GetSemanticBufferAssetView(Name{ "UV" })->GetBufferAsset(), SkinnedMeshStaticVertexStreams::UV_0);
|
||||
|
||||
const RPI::BufferAssetView* morphBufferAssetView = mesh0.GetSemanticBufferAssetView(Name{ "MORPHTARGET_VERTEXDELTAS" });
|
||||
const RPI::BufferAssetView* morphBufferAssetView = nullptr;
|
||||
for (const auto& mesh : modelLodAsset->GetMeshes())
|
||||
{
|
||||
morphBufferAssetView = mesh.GetSemanticBufferAssetView(Name{ "MORPHTARGET_VERTEXDELTAS" });
|
||||
if (morphBufferAssetView)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (morphBufferAssetView)
|
||||
{
|
||||
ProcessMorphsForLod(actor, morphBufferAssetView->GetBufferAsset(), lodIndex, fullFileName, skinnedMeshLod);
|
||||
|
||||
Reference in New Issue
Block a user