Open ydeltastar opened 5 months ago
By the way, test with https://github.com/godotengine/godot/pull/91122 to avoid crashes while reimporting. I added it to the description.
https://github.com/godotengine/godot/pull/91122 was required to reimport without crashes but it doesn't fix this issue.
Some fixes were done to the reload scene system, I'm not sure how it interacts with the bug.
Tested with latest. The issue still happens.
Okay, I'm looking into this now. It seems to be a complex edge case based around unique qualities of the skeleton node in relation to how the scene importer attempts to save and restore state. It seems that the wonky bone hierarchy has become embedded in the actor_x.tscn
in the same fashion as any other modifiable property in scene. One key difference with the skeleton inspector is none of the direct bone properties are revertable (they probably should be though if those changes are serializable). This problem kind of has different levels to it though. By the rules of the system, those bone hierarchy changes actually SHOULD attempt to preserve these changes, so the behaviour observed when reimporting with the actor_x scene open seems the most correct.
Why these changes occur in the first place in another matter though and will require further investigation. May take some time and may require a bunch of special case code when dealing with armatures. It's supposedly just a natural occurance of modifying the base model with editable children open, right? In which case, this is all likely a byproduct of Skeleton3D all being contained as editable node properties when it probably should have been data and subject to similar safety checks I implemented for other imported types to prevent edits and corruption.
@ydeltastar The two PRs I've referenced do attempt to address two aspects I've observed in with this issue: The change to the reimport behaviour should resolve the reimported model appearing demangled (but actually is still mangeld in game or upon reloading the scene), and the reset support added to the skeleton editor will at the very least give the user a means to easily demangle a model without having to manually edit a scene file in a text editor.
The only issue that now remains is the underlying cause of the mangling which is mentioned as when bone hierarch changes and the glTF reimports.
Could more information be provided about this? Ideally, from what I understand, the system shouldn't mangle the the skeleton, even with editable children is enabled unless the bone hierarchy was modified manually. The changes to the reimport system might fix this, but I require more information.
@SaracenOne I'm not sure how it happens. My only guess is that when I reparent bones. For example, the original skeleton was imported with an upper arm and a bottom arm. Then if I add an elbow bone between them and other similar edits, the skeleton could break when reimported.
As long as I iterated between Blender and Godot, characters eventually got broken when using this multiple editable children scene setup. Now I avoid this scene setup and it hasn't happened since.
Tested versions
v4.3.dev.custom_build [c7f56d327] Test with https://github.com/godotengine/godot/pull/91122 to avoid crashes while reimporting.
System information
Windows 10 - Forward+
Issue description
Skeleton3D
can become irreversibly broken throughout the back-and-forth process of modifying the source model and reimporting when usingEditable Children
.Probably, the issue happens when bone hierarch changes and the glTF reimports. The button on the scene toolbar
Skeleton3D > Reset All Bone Poses
doesn't fix it. There are no properties in the inspector that I can modify or reset to fix it either.New instances of the glTF look right.
Steps to reproduce
x/x.gltf
whileactor_x.tscn
is the focused scene in the editor, the skeleton doesn't fix.x/x.gltf
whilemain.tscn
is the focused scene oractor_x.tscn
is closed, the skeleton looks fixed in the editor but broken at runtime.x/x.gltf
whilemain.tscn
is the focused scene and then change the focused scene toactor_x.tscn
, it also fixes at runtime. This behavior is inconsistent. It can fix it or not, depending on the order in which you open the scenes, the number of iterations, or scene complexity. In my large project, for example, this or any other method I tried doesn't work and I'm stuck with the broken skeleton.Minimal reproduction project (MRP)
broken-skeleton.zip