Skip to content

Commit

Permalink
Fix crash when there is no bones to rename when retargeting an import…
Browse files Browse the repository at this point in the history
…ed skeleton
  • Loading branch information
ydeltastar committed Feb 8, 2024
1 parent 41564aa commit 92a64cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion editor/import/3d/post_import_plugin_skeleton_renamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ void PostImportPluginSkeletonRenamer::get_internal_import_options(InternalImport
}

void PostImportPluginSkeletonRenamer::_internal_process(InternalImportCategory p_category, Node *p_base_scene, Node *p_node, Ref<Resource> p_resource, const Dictionary &p_options, const HashMap<String, String> &p_rename_map) {
if (p_rename_map.is_empty()) {
return; // There are no bones to rename
}

// Prepare objects.
Object *map = p_options["retarget/bone_map"].get_validated_object();
if (!map || !bool(p_options["retarget/bone_renamer/rename_bones"])) {
Expand Down Expand Up @@ -181,7 +185,7 @@ void PostImportPluginSkeletonRenamer::internal_process(InternalImportCategory p_
}

// Main process of renaming bones.
{
if (!pre_rename_map.is_empty()) {
// Apply pre-renaming result to prepared main rename map.
Vector<String> remove_queue;
for (HashMap<String, String>::Iterator E = main_rename_map.begin(); E; ++E) {
Expand Down

0 comments on commit 92a64cb

Please sign in to comment.