Skip to content

Commit

Permalink
Merge pull request #95505 from lyuma/import_null_external_animation_l…
Browse files Browse the repository at this point in the history
…ibrary

Avoid `[]` for `external_animation_library` import option
  • Loading branch information
akien-mga committed Aug 16, 2024
2 parents 1d4303c + e7de6f8 commit 5847d36
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions editor/import/3d/scene_import_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class SceneImportSettingsData : public Object {
ERR_FAIL_NULL(settings);
if (r_option.name == "rest_pose/load_pose") {
if (!settings->has("rest_pose/load_pose") || int((*settings)["rest_pose/load_pose"]) != 2) {
(*settings)["rest_pose/external_animation_library"] = Variant();
if (settings->has("rest_pose/external_animation_library")) {
(*settings)["rest_pose/external_animation_library"] = Variant();
}
}
}
if (r_option.name == "rest_pose/selected_animation") {
Expand All @@ -134,7 +136,10 @@ class SceneImportSettingsData : public Object {
}
} break;
case 2: {
Object *res = (*settings)["rest_pose/external_animation_library"];
Object *res = nullptr;
if (settings->has("rest_pose/external_animation_library")) {
res = (*settings)["rest_pose/external_animation_library"];
}
Ref<Animation> anim(res);
Ref<AnimationLibrary> library(res);
if (anim.is_valid()) {
Expand Down

0 comments on commit 5847d36

Please sign in to comment.