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
This commit is contained in:
Pratik Borhade 2023-12-22 12:31:52 +01:00 committed by Pratik Borhade
parent 7a8e349b73
commit 239d3bb04b
1 changed files with 2 additions and 10 deletions

View File

@ -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;
}