Merge branch 'master' into blender28
authorCampbell Barton <ideasman42@gmail.com>
Fri, 15 Jun 2018 13:42:42 +0000 (15:42 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 15 Jun 2018 13:42:42 +0000 (15:42 +0200)
1  2 
release/scripts/addons
release/scripts/addons_contrib
source/blender/bmesh/tools/bmesh_intersect.c
source/blender/editors/mesh/editmesh_intersect.c
source/blender/modifiers/intern/MOD_boolean.c

@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 8f2fd7e23f0b5ce023440182f51c40e88d663325
 -Subproject commit 9ae033c49c1b16718eac6306bdc271a5e6e6bf38
++Subproject commit ebd058d7a6438d137522063bb3286c8acc325ca6
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 34a27a42d781d80f9f1833bad8cc5b2abcac2933
 -Subproject commit f178e6c933a25c621a5cc7d92935b66cd2ec2f5d
++Subproject commit 474702157831f1a58bb50f5240ab8b1b02b6ba37
@@@ -184,45 -186,29 +184,45 @@@ static int edbm_intersect_exec(bContex
                default:  /* ISECT_SEPARATE_NONE */
                        break;
        }
 +      ViewLayer *view_layer = CTX_data_view_layer(C);
 +      uint objects_len = 0;
 +      uint isect_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);
  
 -      has_isect = BM_mesh_intersect(
 -              bm,
 -              em->looptris, em->tottri,
 -              test_fn, NULL,
 -              use_self, use_separate_all, true, true, true, true,
 -              -1,
 -              eps);
 -
 -      if (use_separate_cut) {
 -              /* detach selected/un-selected faces */
 -              BM_mesh_separate_faces(
 -                      bm,
 -                      BM_elem_cb_check_hflag_enabled_simple(const BMFace *, BM_ELEM_SELECT));
 -      }
 +              if (em->bm->totfacesel == 0) {
 +                      continue;
 +              }
 +
 +              has_isect = BM_mesh_intersect(
-                       em->bm,
-                       em->looptris, em->tottri,
-                       test_fn, NULL,
-                       use_self, use_separate_all, true, true, true,
-                       -1,
-                       eps);
++                      em->bm,
++                      em->looptris, em->tottri,
++                      test_fn, NULL,
++                      use_self, use_separate_all, true, true, true, true,
++                      -1,
++                      eps);
 +
 +              if (use_separate_cut) {
 +                      /* detach selected/un-selected faces */
 +                      BM_mesh_separate_faces(
-                               em->bm,
-                               BM_elem_cb_check_hflag_enabled_simple(const BMFace *, BM_ELEM_SELECT));
++                              em->bm,
++                              BM_elem_cb_check_hflag_enabled_simple(const BMFace *, BM_ELEM_SELECT));
 +              }
  
 -      if (has_isect) {
 -              edbm_intersect_select(em);
 +              if (has_isect) {
 +                      edbm_intersect_select(em);
 +              }
 +              else {
 +                      isect_len++;
 +              }
        }
 -      else {
 +      MEM_freeN(objects);
 +
 +      if (isect_len == objects_len) {
                BKE_report(op->reports, RPT_WARNING, "No intersections found");
        }
 -
        return OPERATOR_FINISHED;
  }
  
@@@ -287,39 -276,23 +287,39 @@@ static int edbm_intersect_boolean_exec(
        bool has_isect;
  
        test_fn = use_swap ? bm_face_isect_pair_swap : bm_face_isect_pair;
 +      ViewLayer *view_layer = CTX_data_view_layer(C);
 +      uint objects_len = 0;
 +      uint isect_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;
 +              }
  
 -      has_isect = BM_mesh_intersect(
 -              bm,
 -              em->looptris, em->tottri,
 -              test_fn, NULL,
 -              false, false, true, true, false, true,
 -              boolean_operation,
 -              eps);
 +              has_isect = BM_mesh_intersect(
-                       em->bm,
-                       em->looptris, em->tottri,
-                       test_fn, NULL,
-                       false, false, true, true, true,
-                       boolean_operation,
-                       eps);
++                      em->bm,
++                      em->looptris, em->tottri,
++                      test_fn, NULL,
++                      false, false, true, true, false, true,
++                      boolean_operation,
++                      eps);
  
  
 -      if (has_isect) {
 -              edbm_intersect_select(em);
 +              if (has_isect) {
 +                      edbm_intersect_select(em);
 +              }
 +              else {
 +                      isect_len++;
 +              }
        }
 -      else {
 +      MEM_freeN(objects);
 +
 +      if (isect_len == objects_len) {
                BKE_report(op->reports, RPT_WARNING, "No intersections found");
        }
 -
        return OPERATOR_FINISHED;
  }