Skip to content

Commit

Permalink
fix animation name replacement logic for scene resource imports given…
Browse files Browse the repository at this point in the history
… "/" prefix scheme from "get_animation_list"
  • Loading branch information
PierceLBrooks committed Jan 31, 2025
1 parent 9ee1873 commit 0fba504
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion editor/import/3d/resource_importer_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,12 @@ Node *ResourceImporterScene::_post_fix_animations(Node *p_node, Node *p_root, co

if (saved_anim != anim) {
Ref<AnimationLibrary> al = ap->get_animation_library(ap->find_animation_library(anim));
al->add_animation(name, saved_anim); //replace
String an = String(name);
int ai = an.rfind("/");
if (ai >= 0 && ai + 1 < an.size() && an.substr(0, ai + 1) == al->get_name() + "/") {
an = an.substr(ai + 1);
}
al->add_animation(StringName(an), saved_anim); //replace
}
}
}
Expand Down

0 comments on commit 0fba504

Please # to comment.