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.
main
Tommy Walton 5 years ago committed by GitHub
parent 7a557c05ac
commit 343fc1999f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);

Loading…
Cancel
Save