Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Wed, 26 Sep 2018 00:29:16 +0000 (10:29 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 26 Sep 2018 00:30:34 +0000 (10:30 +1000)
1  2 
source/blender/bmesh/intern/bmesh_opdefines.c
source/blender/editors/mesh/editmesh_extrude_spin.c

index 4f9aab165d0b81575ddb44f2eb3cbda744fa3f36,88407576ec081d15248886d665511d020e1a65ec..c1187da38d58bf9dd733b3012c2328fe45ced1b4
@@@ -79,35 -79,26 +84,38 @@@ static int edbm_spin_exec(bContext *C, 
                return OPERATOR_CANCELLED;
        }
  
 -      /* keep the values in worldspace since we're passing the obmat */
 -      if (!EDBM_op_init(
 -                  em, &spinop, op,
 -                  "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f space=%m4 "
 -                  "use_normal_flip=%b use_duplicate=%b use_merge=%b",
 -                  BM_ELEM_SELECT, cent, axis, d, steps, -angle, obedit->obmat,
 -                  use_normal_flip, dupli, use_auto_merge))
 -      {
 -              return OPERATOR_CANCELLED;
 -      }
 -      BMO_op_exec(bm, &spinop);
 -      if (use_auto_merge == false) {
 -              EDBM_flag_disable_all(em, BM_ELEM_SELECT);
 -              BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
 -      }
 -      if (!EDBM_op_finish(em, &spinop, op, true)) {
 -              return OPERATOR_CANCELLED;
 +      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;
 +              BMOperator spinop;
 +
 +              /* keep the values in worldspace since we're passing the obmat */
 +              if (!EDBM_op_init(
 +                          em, &spinop, op,
 +                          "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f space=%m4 "
-                           "use_normal_flip=%b use_duplicate=%b",
-                           BM_ELEM_SELECT, cent, axis, d, steps, -angle, obedit->obmat, use_normal_flip, dupli))
++                          "use_normal_flip=%b use_duplicate=%b use_merge=%b",
++                          BM_ELEM_SELECT, cent, axis, d, steps, -angle, obedit->obmat,
++                          use_normal_flip, dupli, use_auto_merge))
 +              {
 +                      continue;
 +              }
 +              BMO_op_exec(bm, &spinop);
-               EDBM_flag_disable_all(em, BM_ELEM_SELECT);
-               BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
++              if (use_auto_merge == false) {
++                      EDBM_flag_disable_all(em, BM_ELEM_SELECT);
++                      BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
++              }
 +              if (!EDBM_op_finish(em, &spinop, op, true)) {
 +                      continue;
 +              }
 +
 +              EDBM_update_generic(em, true, true);
        }
  
 -      EDBM_update_generic(em, true, true);
 +      MEM_freeN(objects);
  
        return OPERATOR_FINISHED;
  }