Edit Mesh: multi-object duplicate_move support
This commit is contained in:
@@ -1562,10 +1562,20 @@ void MESH_OT_edge_split(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int edbm_duplicate_exec(bContext *C, wmOperator *op)
|
static int edbm_duplicate_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Object *ob = CTX_data_edit_object(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
BMEditMesh *em = BKE_editmesh_from_object(ob);
|
uint objects_len = 0;
|
||||||
BMesh *bm = em->bm;
|
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 *obedit = objects[ob_index];
|
||||||
|
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
||||||
|
if (em->bm->totvertsel == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
BMOperator bmop;
|
BMOperator bmop;
|
||||||
|
BMesh *bm = em->bm;
|
||||||
|
|
||||||
EDBM_op_init(
|
EDBM_op_init(
|
||||||
em, &bmop, op,
|
em, &bmop, op,
|
||||||
@@ -1585,10 +1595,11 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op)
|
|||||||
BM_SELECT_HISTORY_RESTORE(bm);
|
BM_SELECT_HISTORY_RESTORE(bm);
|
||||||
|
|
||||||
if (!EDBM_op_finish(em, &bmop, op, true)) {
|
if (!EDBM_op_finish(em, &bmop, op, true)) {
|
||||||
return OPERATOR_CANCELLED;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
EDBM_update_generic(em, true, true);
|
EDBM_update_generic(em, true, true);
|
||||||
|
}
|
||||||
|
MEM_freeN(objects);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user