Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-05-08 11:39:06 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-05-08 11:40:30 +0300
commitf309c34cfe050c4567e1af7825bed4eacb0d8302 (patch)
tree5c068271970fe72672e58438a7ffb01e7688bf79
parenta0a78f6da4650e4ec5730b5042656e3ec653dc7a (diff)
Multi-Object-Editing : Support for MESH_OT_solidify by Lucas Boutrot
Maniphest Tasks: T54641, T54643 Differential Revision: https://developer.blender.org/D3218
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c53
1 files changed, 31 insertions, 22 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 4ca1c8fc324..676e9cc8c5d 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -3052,39 +3052,48 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot)
static int edbm_solidify_exec(bContext *C, wmOperator *op)
{
- Object *obedit = CTX_data_edit_object(C);
- Mesh *me = obedit->data;
- BMEditMesh *em = me->edit_btmesh;
- BMesh *bm = em->bm;
- BMOperator bmop;
-
const float thickness = RNA_float_get(op->ptr, "thickness");
- if (!EDBM_op_init(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) {
- return OPERATOR_CANCELLED;
- }
+ 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);
+ BMesh *bm = em->bm;
- /* deselect only the faces in the region to be solidified (leave wire
- * edges and loose verts selected, as there will be no corresponding
- * geometry selected below) */
- BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "geom", BM_FACE, BM_ELEM_SELECT, true);
+ if (em->bm->totfacesel == 0) {
+ continue;
+ }
- /* run the solidify operator */
- BMO_op_exec(bm, &bmop);
+ BMOperator bmop;
- /* select the newly generated faces */
- BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "geom.out", BM_FACE, BM_ELEM_SELECT, true);
+ if (!EDBM_op_init(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) {
+ continue;
+ }
- if (!EDBM_op_finish(em, &bmop, op, true)) {
- return OPERATOR_CANCELLED;
- }
+ /* deselect only the faces in the region to be solidified (leave wire
+ * edges and loose verts selected, as there will be no corresponding
+ * geometry selected below) */
+ BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "geom", BM_FACE, BM_ELEM_SELECT, true);
- EDBM_update_generic(em, true, true);
+ /* run the solidify operator */
+ BMO_op_exec(bm, &bmop);
+
+ /* select the newly generated faces */
+ BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "geom.out", BM_FACE, BM_ELEM_SELECT, true);
+ if (!EDBM_op_finish(em, &bmop, op, true)) {
+ continue;
+ }
+
+ EDBM_update_generic(em, true, true);
+ }
+
+ MEM_freeN(objects);
return OPERATOR_FINISHED;
}
-
void MESH_OT_solidify(wmOperatorType *ot)
{
PropertyRNA *prop;