You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
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.
This commit is contained in:
@@ -1229,11 +1229,13 @@ void BoneMapper::auto_mapping_process(Ref<BoneMap> &p_bone_map) {
|
|||||||
picklist.push_back("face");
|
picklist.push_back("face");
|
||||||
int head = search_bone_by_name(skeleton, picklist, BONE_SEGREGATION_NONE, neck);
|
int head = search_bone_by_name(skeleton, picklist, BONE_SEGREGATION_NONE, neck);
|
||||||
if (head == -1) {
|
if (head == -1) {
|
||||||
|
if (neck != -1) {
|
||||||
search_path = skeleton->get_bone_children(neck);
|
search_path = skeleton->get_bone_children(neck);
|
||||||
if (search_path.size() == 1) {
|
if (search_path.size() == 1) {
|
||||||
head = search_path[0]; // Maybe only one child of the Neck is Head.
|
head = search_path[0]; // Maybe only one child of the Neck is Head.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (head == -1) {
|
if (head == -1) {
|
||||||
if (neck != -1) {
|
if (neck != -1) {
|
||||||
head = neck; // The head animation should have more movement.
|
head = neck; // The head animation should have more movement.
|
||||||
|
|||||||
Reference in New Issue
Block a user