From 239d3bb04b32e223e67e21833e975ba126877bb2 Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Fri, 22 Dec 2023 12:31:52 +0100 Subject: [PATCH] Fix #116320: Crash assigning bone to collection of other armature `Move to collection` popup shows collections of active armature. So when bone of "non-active" armature is selected, crash will be triggered after assigning it a bone-collection of active armature. To fix the crash, remove multi-object editing code since it's only possible to operate on active armature/object Pull Request: https://projects.blender.org/blender/blender/pulls/116328 --- source/blender/editors/armature/bone_collections.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/armature/bone_collections.cc b/source/blender/editors/armature/bone_collections.cc index 8c054654d2d..ec67b09c1ac 100644 --- a/source/blender/editors/armature/bone_collections.cc +++ b/source/blender/editors/armature/bone_collections.cc @@ -311,17 +311,9 @@ static bool bone_collection_assign_mode_specific(bContext *C, } case CTX_MODE_EDIT_ARMATURE: { - uint objects_len = 0; - Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data( - CTX_data_scene(C), CTX_data_view_layer(C), CTX_wm_view3d(C), &objects_len); + bone_collection_assign_editbones( + C, ob, bcoll, assign_ebone_func, made_any_changes, had_bones_to_assign); - for (uint ob_index = 0; ob_index < objects_len; ob_index++) { - Object *ob = objects[ob_index]; - bone_collection_assign_editbones( - C, ob, bcoll, assign_ebone_func, made_any_changes, had_bones_to_assign); - } - - MEM_freeN(objects); ED_outliner_select_sync_from_edit_bone_tag(C); return true; }