Skip to content

Commit

Permalink
Repair some models with bogus transforms SharpGLTF doesn't like
Browse files Browse the repository at this point in the history
  • Loading branch information
kythyria committed Aug 31, 2021
1 parent e417256 commit 57969a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PD2ModelParser/Exporters/GltfExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ void CreateNodeFromObject3D(Object3D thing, GLTF.IVisualNodeContainer parent)
var mat = thing.Transform;
mat.Translation = mat.Translation * scaleFactor;

// Some models in the wild need this doing to them, god knows why
mat.M44 = 1;

node.LocalMatrix = isSkinned ? Matrix4x4.Identity : mat;

}
Expand Down

0 comments on commit 57969a0

Please sign in to comment.