Open hu-xd opened 6 months ago
Fix proposal: Do not apply the GeometricTransformation to the vertices/normals, instead, if GeometricTransformation exists, create another GltfNode as the child of current node, use the GeometricTransformation as the transformation of that child node, and attach the GltfMesh to that child node.
We don't have an approach to solving geometric transformations in fbx2gltf.
We have a private test case for geometric transformations that passes with the new https://github.com/godotengine/godot/pull/81746 ufbx implementation. Godot Engine is moving to a new ufbx implementation so FBX2gltf will have less enhancements done for it.
If you wish to provide a pull request for fixing geometric transforms we can review.
What do you think of the fix proposal above ? I see OpenSceneGraph has a similiar solution: insert a layer in the node hierachy to hold the geometric transform. See Here
It might work.
We added geometric helpers to ufbx support. https://godotengine.org/article/introducing-the-improved-ufbx-importer-in-godot-4-3/
Godot version
Fbx2Gltf commit 6154391
System information
Windows 11
Issue description
Fbx GeometricTransformation support is problematic See Code, current logic is "Apply the geometric transform to the mesh geometry (vertices, normal etc.)"
but this is problematic since a mesh can be shared by several nodes with different GeometricTransformation, so in this scenario, effectively only 1 node will actually use its GeometricTransformation, other nodes' GeometricTransformation-s will be ignored, since the mesh/surface will only be loaded once.
Steps to reproduce
Build an model in 3DMax with several nodes that share the same mesh/instance but with different object-offset, export it as FBX. Convert the FBX file to GLTF/GLB with Fbx2Gltf. View the GLB file and see those geometries are incorrect.
Minimal reproduction project
N/A