Skip to content

Commit

Permalink
Avoid [] for external_animation_library import option
Browse files Browse the repository at this point in the history
Some uses of operator[] were causing "rest_pose/external_animation_library": null to be added to the .import file.
  • Loading branch information
lyuma committed Aug 14, 2024
1 parent 06fbc83 commit 4fef5af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion editor/import/3d/resource_importer_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,7 @@ bool ResourceImporterScene::get_internal_option_visibility(InternalImportCategor
return false;
}
} else if (int(p_options["rest_pose/load_pose"]) == 2) {
Object *res = p_options["rest_pose/external_animation_library"];
Object *res = p_options.get("rest_pose/external_animation_library", Variant());

Check failure on line 2209 in editor/import/3d/resource_importer_scene.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

no matching function for call to 'HashMap<StringName, Variant>::get(const char [37], Variant) const'

Check failure on line 2209 in editor/import/3d/resource_importer_scene.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

'HashMap<StringName,Variant,HashMapHasherDefault,HashMapComparatorDefault<TKey>,DefaultTypedAllocator<HashMapElement<TKey,TValue>>>::get': no overloaded function takes 2 arguments

Check failure on line 2209 in editor/import/3d/resource_importer_scene.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

no matching function for call to 'HashMap<StringName, Variant>::get(const char [37], Variant) const'

Check failure on line 2209 in editor/import/3d/resource_importer_scene.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

no matching member function for call to 'get'

Check failure on line 2209 in editor/import/3d/resource_importer_scene.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

no matching member function for call to 'get'
Ref<Animation> anim(res);
if (anim.is_valid() && p_option == "rest_pose/selected_animation") {
return false;
Expand Down
6 changes: 4 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,7 @@ class SceneImportSettingsData : public Object {
}
} break;
case 2: {
Object *res = (*settings)["rest_pose/external_animation_library"];
Object *res = (*settings).get("rest_pose/external_animation_library", Variant());

Check failure on line 139 in editor/import/3d/scene_import_settings.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

no matching function for call to 'HashMap<StringName, Variant>::get(const char [37], Variant)'

Check failure on line 139 in editor/import/3d/scene_import_settings.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

'HashMap<StringName,Variant,HashMapHasherDefault,HashMapComparatorDefault<TKey>,DefaultTypedAllocator<HashMapElement<TKey,TValue>>>::get': no overloaded function takes 2 arguments

Check failure on line 139 in editor/import/3d/scene_import_settings.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

no matching function for call to 'HashMap<StringName, Variant>::get(const char [37], Variant)'

Check failure on line 139 in editor/import/3d/scene_import_settings.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

no matching member function for call to 'get'

Check failure on line 139 in editor/import/3d/scene_import_settings.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

no matching member function for call to 'get'
Ref<Animation> anim(res);
Ref<AnimationLibrary> library(res);
if (anim.is_valid()) {
Expand Down

0 comments on commit 4fef5af

Please sign in to comment.