[Bf-blender-cvs] [0a140ec66e5] temp_bmesh_multires: Commit before merge

Joseph Eagar noreply at git.blender.org
Tue Dec 8 22:39:18 CET 2020


Commit: 0a140ec66e5dce5bd36af0643e3474530025670e
Author: Joseph Eagar
Date:   Mon Dec 7 11:48:32 2020 -0800
Branches: temp_bmesh_multires
https://developer.blender.org/rB0a140ec66e5dce5bd36af0643e3474530025670e

Commit before merge

===================================================================

M	source/blender/blenkernel/BKE_pbvh.h
M	source/blender/blenkernel/intern/pbvh_bmesh.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_detail.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index f1baa7db603..4faf42ad8be 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -365,7 +365,8 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *pbvh,
                                     float radius,
                                     const bool use_frontface,
                                     const bool use_projected,
-                                    int symaxis);
+                                    int symaxis,
+                                    bool updatePBVH);
 
 /* Node Access */
 
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 109013fbfb8..b857323dfa6 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -869,7 +869,7 @@ BLI_INLINE float calc_weighted_edge_split(EdgeQueueContext *eq_ctx, BMVert *v1,
   n = MAX2(n - 6.0f, 1.0f);
 
   return l * (n);
-#elif 1 //penalize 4-valence verts
+#elif 1  // penalize 4-valence verts
   float l = len_squared_v3v3(v1->co, v2->co);
   if (BM_vert_edge_count(v1) == 4 || BM_vert_edge_count(v2) == 4) {
     l *= 0.25f;
@@ -1250,7 +1250,8 @@ static void long_edge_queue_edge_add_recursive_2(
     do {
       BMLoop *l_adjacent[2] = {l_iter->next, l_iter->prev};
       for (int i = 0; i < ARRAY_SIZE(l_adjacent); i++) {
-        float len_sq_other = calc_weighted_edge_split(tdata->eq_ctx, l_adjacent[i]->e->v1, l_adjacent[i]->e->v2);
+        float len_sq_other = calc_weighted_edge_split(
+            tdata->eq_ctx, l_adjacent[i]->e->v1, l_adjacent[i]->e->v2);
         if (len_sq_other > max_ff(len_sq_cmp, limit_len_sq)) {
           //                  edge_queue_insert(eq_ctx, l_adjacent[i]->e, -len_sq_other);
           long_edge_queue_edge_add_recursive_2(
@@ -2823,7 +2824,8 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *pbvh,
                                     float radius,
                                     const bool use_frontface,
                                     const bool use_projected,
-                                    int sym_axis)
+                                    int sym_axis,
+                                    bool updatePBVH)
 {
   if (sym_axis >= 0 &&
       PIL_check_seconds_timer() - last_update_time[sym_axis] < DYNTOPO_RUN_INTERVAL) {
@@ -2913,7 +2915,9 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *pbvh,
 
         /* Recursively split nodes that have gotten too many
          * elements */
-        pbvh_bmesh_node_limit_ensure(pbvh, i);
+        if (updatePBVH) {
+          pbvh_bmesh_node_limit_ensure(pbvh, i);
+        }
       }
     }
   }
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 277d7b3c396..9c85ad2e2a9 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -6017,7 +6017,7 @@ static void sculpt_topology_update(Sculpt *sd,
                                      ss->cache->radius,
                                      (brush->flag & BRUSH_FRONTFACE) != 0,
                                      (brush->falloff_shape != PAINT_FALLOFF_SHAPE_SPHERE),
-                                     symidx);
+                                     symidx, brush->sculpt_tool != SCULPT_TOOL_DRAW_SHARP);
     }
 
     MEM_SAFE_FREE(nodes);
diff --git a/source/blender/editors/sculpt_paint/sculpt_detail.c b/source/blender/editors/sculpt_paint/sculpt_detail.c
index 87e0bf98671..9ad53feb343 100644
--- a/source/blender/editors/sculpt_paint/sculpt_detail.c
+++ b/source/blender/editors/sculpt_paint/sculpt_detail.c
@@ -126,7 +126,7 @@ static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op))
   SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_COORDS);
 
   while (BKE_pbvh_bmesh_update_topology(
-      ss->pbvh, PBVH_Collapse | PBVH_Subdivide, center, NULL, size, false, false, -1)) {
+      ss->pbvh, PBVH_Collapse | PBVH_Subdivide, center, NULL, size, false, false, -1, false)) {
     for (int i = 0; i < totnodes; i++) {
       BKE_pbvh_node_mark_topology_update(nodes[i]);
     }



More information about the Bf-blender-cvs mailing list