Fix blend shapes transformation applying

#2459
This commit is contained in:
Wojtek Figat
2024-04-20 16:16:01 +02:00
parent 5e086809ae
commit 6aacea99ab
3 changed files with 21 additions and 14 deletions

View File

@@ -800,7 +800,7 @@ bool ProcessMesh(ModelData& result, OpenFbxImporterData& data, const ofbx::Mesh*
{
// Mirror positions along the Z axis
for (int32 i = 0; i < vertexCount; i++)
mesh.Positions[i].Z *= -1.0f;
mesh.Positions.Get()[i].Z *= -1.0f;
for (auto& blendShapeData : mesh.BlendShapes)
{
for (auto& v : blendShapeData.Vertices)
@@ -815,7 +815,7 @@ bool ProcessMesh(ModelData& result, OpenFbxImporterData& data, const ofbx::Mesh*
{
// Invert the order
for (int32 i = 0; i < mesh.Indices.Count(); i += 3)
Swap(mesh.Indices[i], mesh.Indices[i + 2]);
Swap(mesh.Indices.Get()[i], mesh.Indices.Get()[i + 2]);
}
if ((data.Options.CalculateTangents || !tangents) && mesh.UVs.HasItems())