Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Skeleton unit scaling is awkward #20

Closed
bqqbarbhg opened this issue Sep 16, 2023 · 6 comments
Closed

Skeleton unit scaling is awkward #20

bqqbarbhg opened this issue Sep 16, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@bqqbarbhg
Copy link
Collaborator

bqqbarbhg commented Sep 16, 2023

Issue description

Importing small meshes exported from Maya with 1cm units causes the model to be loaded correctly as tiny, but the bounding box is massive as the Skeleton3D itself it not scaled, but only the root node within.

image

image

Could try to scale the Skeleton3D node itself, but then we need to be careful to compensate for that in animations etc. alternatively we could bake the scaling into the root node, but that had some issues as well and will require us to have an unnecessary node.

Steps to reproduce

Minimal reproduction project (For SDK or engine issues)

No response

Using a released version?

0b874ae

What OS? Any other relevant information? (godot-ufbx revision, Godot revision, System information)

Windows, Godot 4.2 master

@bqqbarbhg bqqbarbhg added the bug Something isn't working label Sep 16, 2023
@bqqbarbhg
Copy link
Collaborator Author

Turns out that there's not much that can be done here as the bounding box size is based on the mesh, so even if we'd fix the scale issue on bones the bounding box may be rotated. I saw that the glTF importer transforms the mesh geometry itself but that's not ideal especially for blender files, as then you end up with nodes having scale=100 and all vertices being scaled to tiny.

@fire
Copy link
Member

fire commented Sep 30, 2023

The transform to identity scale to the mesh geometry itself is part of the scene importer and independent of the importers.

Also agree that this is really a rendering of Godot Engine issue and it's minor as this is used for culling (bug?) and editor debug.

@fire
Copy link
Member

fire commented Sep 30, 2023

I'd probably close the issue as I have no approaches for fixing this.

@bqqbarbhg
Copy link
Collaborator Author

Yeah every approach has it's downsides, I'd consider this a Godot Engine issue as well.

@fire fire closed this as completed Sep 30, 2023
@fire
Copy link
Member

fire commented Nov 4, 2023

@bqqbarbhg
Copy link
Collaborator Author

Yeah would need something similar for 3D probably, one solution is to just calculate maximum distance from bone to vertex and estimate the skeleton AABB by approximating bone sizes as such. Adding some fudge factor it works in practice.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants