Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when there is no bones to rename when retargeting an imported skeleton #88109

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading