[Bf-blender-cvs] [9f004eb846d] temp-trimesh-sculpt: Remove more TM_elem_index_ensure calls that no longer are necessary

Joseph Eagar noreply at git.blender.org
Sat Oct 17 10:50:00 CEST 2020


Commit: 9f004eb846dd4ff8851691a08c704a8f257f0617
Author: Joseph Eagar
Date:   Sat Oct 17 01:49:37 2020 -0700
Branches: temp-trimesh-sculpt
https://developer.blender.org/rB9f004eb846dd4ff8851691a08c704a8f257f0617

Remove more TM_elem_index_ensure calls that no longer are necessary

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

M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/blenkernel/intern/pbvh_trimesh.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_smooth.c

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

diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 2becadf9c75..59320ca0d49 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -2451,7 +2451,7 @@ bool BKE_pbvh_node_raycast(PBVH *pbvh,
                                     face_normal);
       break;
     case PBVH_TRIMESH:
-      TM_mesh_elem_index_ensure(pbvh->tm, TM_VERTEX);
+      //TM_mesh_elem_index_ensure(pbvh->tm, TM_VERTEX);
       hit = pbvh_trimesh_node_raycast(node,
                                       ray_start,
                                       ray_normal,
diff --git a/source/blender/blenkernel/intern/pbvh_trimesh.c b/source/blender/blenkernel/intern/pbvh_trimesh.c
index 16658e2f48d..2ff3431509e 100644
--- a/source/blender/blenkernel/intern/pbvh_trimesh.c
+++ b/source/blender/blenkernel/intern/pbvh_trimesh.c
@@ -1341,7 +1341,7 @@ static void pbvh_trimesh_split_edge(EdgeQueueContext *eq_ctx, PBVH *bvh, TMEdge
     tm_edges_from_tri(bvh->tm, v_tri, e_tri, 0, false);
     f_new = pbvh_trimesh_face_create(bvh, ni, v_tri, e_tri, f_adj);
 
-    long_edge_queue_face_add(eq_ctx, f_new);
+    //long_edge_queue_face_add(eq_ctx, f_new);
 
     v_tri[0] = v_new;
     v_tri[1] = v2;
@@ -1350,7 +1350,8 @@ static void pbvh_trimesh_split_edge(EdgeQueueContext *eq_ctx, PBVH *bvh, TMEdge
     e_tri[2] = e_tri[1]; /* switched */
     e_tri[1] = TM_get_edge(bvh->tm, v_tri[1], v_tri[2], 0, false);
     f_new = pbvh_trimesh_face_create(bvh, ni, v_tri, e_tri, f_adj);
-    long_edge_queue_face_add(eq_ctx, f_new);
+
+    //long_edge_queue_face_add(eq_ctx, f_new);
 
     /* Delete original */
     pbvh_trimesh_face_remove(bvh, f_adj);
@@ -1369,7 +1370,7 @@ static void pbvh_trimesh_split_edge(EdgeQueueContext *eq_ctx, PBVH *bvh, TMEdge
         TMEdge *e2 = v_opp->edges.items[i];
 
         if (e2 != e) {
-          long_edge_queue_edge_add(eq_ctx, e2);
+          //long_edge_queue_edge_add(eq_ctx, e2);
         }
         else {
           printf("eek! %s %d\n", __FILE__, __LINE__);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index b8b2e00aa6c..49a3f04f71c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -7445,7 +7445,10 @@ bool SCULPT_cursor_geometry_info_update(bContext *C,
 
   /* Update the active vertex of the SculptSession. */
   ss->active_vertex_index = srd.active_vertex_index;
-  SCULPT_vertex_random_access_ensure(ss);
+  if (BKE_pbvh_type(ss->pbvh) != PBVH_TRIMESH) {
+    SCULPT_vertex_random_access_ensure(ss);
+  }
+
   copy_v3_v3(out->active_vertex_co, SCULPT_active_vertex_co_get(ss));
 
   switch (BKE_pbvh_type(ss->pbvh)) {
@@ -7546,10 +7549,10 @@ bool SCULPT_stroke_get_location(bContext *C, float out[3], const float mouse[2])
 
   depth = SCULPT_raycast_init(&vc, mouse, ray_start, ray_end, ray_normal, original);
 
-  if (BKE_pbvh_type(ss->pbvh) == PBVH_TRIMESH) {
+  /*if (BKE_pbvh_type(ss->pbvh) == PBVH_TRIMESH) {
     TM_mesh_elem_table_ensure(ss->tm, TM_VERTEX);
     TM_mesh_elem_index_ensure(ss->tm, TM_VERTEX);
-  }
+  }*/
 
   bool hit = false;
   {
diff --git a/source/blender/editors/sculpt_paint/sculpt_smooth.c b/source/blender/editors/sculpt_paint/sculpt_smooth.c
index 2b5abebe6a5..26f62aa917d 100644
--- a/source/blender/editors/sculpt_paint/sculpt_smooth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_smooth.c
@@ -418,7 +418,9 @@ void SCULPT_smooth(Sculpt *sd,
     return;
   }
 
-  SCULPT_vertex_random_access_ensure(ss);
+  if (type != PBVH_TRIMESH) {
+    SCULPT_vertex_random_access_ensure(ss);
+  }
   SCULPT_boundary_info_ensure(ob);
 
   for (iteration = 0; iteration <= count; iteration++) {



More information about the Bf-blender-cvs mailing list