diff options
author | Thomas Beck <software@plasmasolutions.de> | 2018-04-19 00:55:27 +0300 |
---|---|---|
committer | Thomas Beck <software@plasmasolutions.de> | 2018-04-19 00:55:27 +0300 |
commit | 07774d48605f6208d9fb4994eb227934030a5ebf (patch) | |
tree | 6a175ab3f726b3498c4165f61612314c2ef12d14 /source/blender/editors | |
parent | d8f70a26fdce552c6982d6e4574c997c62abf87d (diff) |
Edit Mesh: multi-object support for 'Individual Faces' extrusion (Alt+E)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index ba19025b496..6541f56de56 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -530,12 +530,23 @@ void MESH_OT_extrude_edges_indiv(wmOperatorType *ot) static int edbm_extrude_faces_exec(bContext *C, wmOperator *op) { - Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = BKE_editmesh_from_object(obedit); + ViewLayer *view_layer = CTX_data_view_layer(C); + 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 *obedit = objects[ob_index]; + BMEditMesh *em = BKE_editmesh_from_object(obedit); + if (em->bm->totfacesel == 0) { + continue; + } - edbm_extrude_discrete_faces(em, op, BM_ELEM_SELECT); + edbm_extrude_discrete_faces(em, op, BM_ELEM_SELECT); - EDBM_update_generic(em, true, true); + EDBM_update_generic(em, true, true); + } + MEM_freeN(objects); return OPERATOR_FINISHED; } |