-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give bone attachments in the GLTF importer stable and proper names, and deduplicate. #47290
Give bone attachments in the GLTF importer stable and proper names, and deduplicate. #47290
Conversation
bd73b2f
to
daa6711
Compare
I put this onto my bucket list. The changes to the import dialogue took my time for today. |
@mortarroad Since I'm here, can you give me a visual and an import project of before and after. I want to approve without compiling the engine and importing. Edited: I mean a regular test case project without .import / .godot. |
You mean the project with an .import folder? |
@fire If that's okay, I will only provide an example after I've fixed another issue that I found: Currently, unique names for nodes are enforced globally, even though in Godot unique names are only required within each parent node. I think that should be fixed too, before this can be merged. |
On master, the set of all unique names is part of the public interface. Is there a reason why the name uniqueness is enforced in the importer? |
All gltf nodes must have unique names, so the gltf importer enforces it there. |
Ah, so I suppose I can just get rid of it for BoneAttachments, since those aren't GLTF nodes anyway. |
daa6711
to
c5380a8
Compare
I will update the PR against 3.x soon. |
My opinion is that if we are auto-generating the names of the bone attachments we can make them unique in the entire scene. Having two nodes with the same name looks ugly :D Although Godot only enforces uniqueness on sibling nodes, the fact Godot can also export a gltf2 scene means I want both import and export to be symmetrical. Thoughts? |
I think the name should stay identical to the name in the file, if possible. |
When I want to move the head do I animate the "head" or "head"/ "head" node in the animation player? I also recall that the BoneAttachment3D has a relation to a bone. Maybe we can use that name? Like BoneNameBoneAttachment3D (original.bone_CasingBoneAttachment3D is fine too). |
Hm, I had also thought about adding a prefix / postfix and I think it is acceptable, though I'd prefer a short one if possible. |
I agree with |
Hm, I'm not sure what the best prefix would be. What's also possible is converting the bone's name into PascalCase, then the "Bone" prefix could be used. (There seems to be a function for that, but it's local to the mono module and would have to be moved.) |
Is that camelcase_to_underscore()? |
No, I meant the other way around, because nodes are usually in PascalCase.
|
I suppose that's overthinking it. |
I think getting the prefix perfectly right isn't as big of an issue, since a user can always rename these using a post import script (see EditorScenePostImport). |
Can you help get this reviewed by rebasing? Thanks! |
I'm a bit confused what the new code does; and I have no files to test it with. |
I thought the design was |
Yes. |
c5380a8
to
0719cf1
Compare
The iOS build failure looks spurious. |
The code has changed a bit, can you review? |
The bone attachment code was revised can you update and see if your changes apply? It's holiday season so things will be delayed. |
0719cf1
to
6b44674
Compare
6b44674
to
2174b02
Compare
I did a rebase, but I don't currently have the time to do testing. |
Will need to go through the tests @lyuma made with the odd skeletons. https://github.com/godotengine/godot-tests/tree/master/tests/gltf_skeleton_tests |
Fixed by: #72162 |
Superseded by #72162. |
Same as #47270, but for master.