godotengine / godotengine/godot

Editor Skeleton3D CreatePhysicalSkeleton skips bones if multiple children

Open
#87,357 1 comment 1 reaction 0 assignees View on GitHub
discussion topic:3d topic:editor
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:
![PhysicalBone_Select](https://github.com/godotengine/godot/assets/57929251/8e57b1af-fb58-432b-a2fe-6ce7b628a7b8)
![PhysicalBone_View](https://github.com/godotengine/godot/assets/57929251/3c663879-bc83-4233-ae0e-31632e253921)

Selecting skeleton bone highlights child bones in main view:
![Bone_Select](https://github.com/godotengine/godot/assets/57929251/a00d86d1-0c95-4b1e-a89a-d41afa77502e)
![Bone_View](https://github.com/godotengine/godot/assets/57929251/af5bdffa-7d60-4d14-9651-8b3c25c2d833)

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.