Integrating up through commit 90f050496

This commit is contained in:
alexpete
2021-04-07 14:03:29 -07:00
parent 8f2ed080a9
commit c2cbd430fe
2694 changed files with 285622 additions and 176874 deletions
@@ -422,7 +422,7 @@ namespace AZ
if (morphSetup)
{
uint32_t morphTargetCount = morphSetup->GetNumMorphTargets();
AZStd::vector<float> weights;
m_morphTargetWeights.clear();
for (uint32_t morphTargetIndex = 0; morphTargetIndex < morphTargetCount; ++morphTargetIndex)
{
EMotionFX::MorphTarget* morphTarget = morphSetup->GetMorphTarget(morphTargetIndex);
@@ -441,10 +441,15 @@ namespace AZ
// and thus correspond with unique dispatches in the morph target pass
for (uint32_t deformDataIndex = 0; deformDataIndex < morphTargetStandard->GetNumDeformDatas(); ++deformDataIndex)
{
weights.push_back(morphTargetSetupInstance->GetWeight());
// Morph targets that don't deform any vertices (e.g. joint-based morph targets) are not registered in the render proxy. Skip adding their weights.
const EMotionFX::MorphTargetStandard::DeformData* deformData = morphTargetStandard->GetDeformData(deformDataIndex);
if (deformData->mNumVerts > 0)
{
m_morphTargetWeights.push_back(morphTargetSetupInstance->GetWeight());
}
}
}
m_skinnedMeshRenderProxy->SetMorphTargetWeights(lodIndex, weights);
m_skinnedMeshRenderProxy->SetMorphTargetWeights(lodIndex, m_morphTargetWeights);
}
}
}