Skip to content
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

3D Armature with BoneAttachment Glitches on Reimport #82466

Closed
slumberface opened this issue Sep 28, 2023 · 5 comments · Fixed by #82471
Closed

3D Armature with BoneAttachment Glitches on Reimport #82466

slumberface opened this issue Sep 28, 2023 · 5 comments · Fixed by #82471

Comments

@slumberface
Copy link

Godot version

4.1.1

System information

Windows 10 - Godot v4.1.1 - Vulkan(Forward+) - dedicated

Issue description

If a model with an armature AND with direct object-to-bone parenting (imported as BoneAttachment3D in Godot) is changed in blender and reimported, it can break instances of the model's armature under specific circumstances.

Use Cases: A character is rigged with an armature using vertex weights, except for a weapon parented to the hand bone, or a hat parented to the head bone.

Of Note:

  • Dragging in a new instance of the model into the scene does not exhibit the bug. Only model instances which exist within scenes are affected.

Before:
image

After another BoneAttachement3D is added over head:
image

Steps to reproduce

Step 1: Import model to Godot. The model is then dragged into a scene AND "Editable Children" is toggled. If a model is turned into a "new inherited scene", the bug will occur without needing to toggle "Editable Children".

Step 2: In Blender, add another object that is parented directly to a bone. Export to Godot, overwriting the previous version.
image
image

Step 3: Upon importing, instances of the armature within scenes will bug out. Some bones will now be oriented in erroneous directions, and some previously existing BoneAttachement3Ds may no longer have the correct "Bone Idx" (1 value off if the new object precedes it in the hierarchy).

For simple reproduction, a project zip has been included which contains a README with instructions and models already setup to reproduce the bug. You will need Blender 3.6 to reproduce the bug. This bug has been reproduced with the following file types: .fbx, .gltf, .blend. For the sake of unified export options, this reproduction uses .blend

Minimal reproduction project

Bug Report Bone Attachement 3d.zip

@bitsawer
Copy link
Member

bitsawer commented Sep 28, 2023

Also tested on current master (545d1c0), the result seems also broken but in a slightly different way. Changes might be influenced by #81695 or something else. Almost looks like many left side bones of the model are more messed up for some reason, right side seems to match the new pose a bit better, Also possibly related: #64512

bones

@SaracenOne
Copy link
Member

SaracenOne commented Sep 28, 2023

Hmm, I'm guessing this is a consequence of the newer dynamic reimport system. When reloading, it copies all properties of all nodes from the previous scene to the new one. This should be fine for the bone names even if the structure of the skeleton changes, but since the idx is generated programmatically and is a still a front-facing property, if this is getting overwritten and not being properly refreshed, I could see how it might cause a bug like this. Will investigate.

@SaracenOne
Copy link
Member

Okay, when I wrote the reimport system, I added special NOTIFICATION_NODE_RECACHE_REQUESTED for instances like this. If I make the BoneAttachments respond to this notification and rebind themselves, this should hopefully fix this bug.

@SaracenOne
Copy link
Member

Nope, still investigating.

@SaracenOne
Copy link
Member

Okay, forcing the bone poses to reset seems to fix it.

@akien-mga akien-mga added this to the 4.2 milestone Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants