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

Prevent automapper throwing obscure error. #96136

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prevent automapper throwing obscure error.
Add check to prevent the skeleton auto-mapper throwing a cryptic
error when neither a head or neck bone could initially be detected.
SaracenOne committed Aug 26, 2024
commit 3caba6e4fb87a729656c809b08a5d0a0f3ad18a8
8 changes: 5 additions & 3 deletions editor/plugins/bone_map_editor_plugin.cpp
Original file line number Diff line number Diff line change
@@ -1229,9 +1229,11 @@ void BoneMapper::auto_mapping_process(Ref<BoneMap> &p_bone_map) {
picklist.push_back("face");
int head = search_bone_by_name(skeleton, picklist, BONE_SEGREGATION_NONE, neck);
if (head == -1) {
search_path = skeleton->get_bone_children(neck);
if (search_path.size() == 1) {
head = search_path[0]; // Maybe only one child of the Neck is Head.
if (neck != -1) {
search_path = skeleton->get_bone_children(neck);
if (search_path.size() == 1) {
head = search_path[0]; // Maybe only one child of the Neck is Head.
}
}
}
if (head == -1) {