Multi-Objects: ARMATURE_OT_select_mirror
This commit is contained in:
@@ -1338,12 +1338,18 @@ void ARMATURE_OT_select_hierarchy(wmOperatorType *ot)
|
|||||||
*/
|
*/
|
||||||
static int armature_select_mirror_exec(bContext *C, wmOperator *op)
|
static int armature_select_mirror_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
ViewLayer * view_layer = CTX_data_view_layer(C);
|
||||||
bArmature *arm = obedit->data;
|
|
||||||
EditBone *ebone, *ebone_mirror_act = NULL;
|
|
||||||
const bool active_only = RNA_boolean_get(op->ptr, "only_active");
|
const bool active_only = RNA_boolean_get(op->ptr, "only_active");
|
||||||
const bool extend = RNA_boolean_get(op->ptr, "extend");
|
const bool extend = RNA_boolean_get(op->ptr, "extend");
|
||||||
|
|
||||||
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object * ob = objects[ob_index];
|
||||||
|
bArmature * arm = ob->data;
|
||||||
|
|
||||||
|
EditBone *ebone, *ebone_mirror_act = NULL;
|
||||||
|
|
||||||
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
|
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
|
||||||
const int flag = ED_armature_ebone_selectflag_get(ebone);
|
const int flag = ED_armature_ebone_selectflag_get(ebone);
|
||||||
EBONE_PREV_FLAG_SET(ebone, flag);
|
EBONE_PREV_FLAG_SET(ebone, flag);
|
||||||
@@ -1380,7 +1386,9 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
ED_armature_edit_sync_selection(arm->edbo);
|
ED_armature_edit_sync_selection(arm->edbo);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
|
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
|
||||||
|
}
|
||||||
|
MEM_freeN(objects);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user