Better collider alignment to bones when using Create Physical Skeleton option #13054
yosimba2000
started this conversation in
3D
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem: Godot's default Create Physical Skeleton option creates unusable colliders that are out of alignment and size from the Skeleton3D.
Solution: I have created an editor script that fixes this, but I don't know how to make the relevant source code changes. The script makes colliders from a bone's head to all of its children bone heads, so some of the created colliders will overlap. This requires manual deletion, but much faster than current workflow. Automatic detection will require filtering out already used child bone head positions.
For example, imagine a Calf Bone leading to 5 Toe Bones. The 5 Toe Bones have the same Head position. So, the script will make a collider from the Calf Bone Head to Toe Bone 1 Head. It will also make a collider from Calf Bone Head to the Toe Bone 2 Head, and so on.
Because all Toe Bones have the same Head position, there will be 5 exactly overlapping colliders going from Calf Bone Head to Toe Bone Heads.
The relevant source code parts seem to be:
https://github.com/godotengine/godot/blob/3defc856b0f1c727b4346e60615b2b2451916837/editor/scene/3d/skeleton_3d_editor_plugin.cpp#L499
https://github.com/godotengine/godot/blob/3defc856b0f1c727b4346e60615b2b2451916837/editor/scene/3d/skeleton_3d_editor_plugin.cpp#L562C35-L562C55
BetterRagdollEditorScript.zip
Beta Was this translation helpful? Give feedback.
All reactions