godotengine / godotengine/godot
Editor Skeleton3D CreatePhysicalSkeleton skips bones if multiple children
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
* Reproduced in:
- 4.2.1-stable
- 4.3-dev2
### System information
Godot v4.2.1.stable.mono - Windows 10.0.22000 - Vulkan (Forward+) - dedicated AMD Radeon(TM) Graphics () - Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz (4 Threads)
### Issue description
When creating physical bones for a skeleton via the editor, a bone is only created for a single child. Any remaining children are skipped. (See `Skeleton3DEditor::create_physical_skeleton()` where only single parent bone is created for each child)
I also noticed some rotation errors due to target and up vector being parallel, likely because the required cross check in `create_physical_skeleton()` is done on the non-normalised vector. (See `Basis::looking_at()` where the cross check is performed on normalised vector). I was able to work around this by creating my own import script.
I also noticed that selecting a skeleton bone in the property inspector (ie, not the physics bone) seems to select the child bone(s) rather than the named bone. So in the case of a bone with multiple children, all child bones are selected.
Physical Bones with multiple children are missing all but first:


Selecting skeleton bone highlights child bones in main view:


### Steps to reproduce
Load Project
Open Scene
### Minimal reproduction project (MRP)
[BonesTest_4.2.1-stable.zip](https://github.com/godotengine/godot/files/13984410/BonesTest_4.2.1-stable.zip)
Contributor guide
Research direction
Start in Skeleton3DEditor::create_physical_skeleton() and inspect the reported child-bone creation and vector checks, then compare the behavior with Basis::looking_at(). Reproduce the issue using the linked BonesTest_4.2.1-stable.zip project. Done means physical bones are created for every child, rotations avoid the reported errors, and selecting a skeleton bone highlights the named bone rather than its children.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100