[Bf-blender-cvs] [5d8e19b801f] soc-2016-pbvh-painting: Move BKE_pbvh_get_num_nodes out of node-access functions

Campbell Barton noreply at git.blender.org
Thu Apr 13 03:44:23 CEST 2017


Commit: 5d8e19b801fc95083cba098bbecaa5eceb1fd685
Author: Campbell Barton
Date:   Thu Apr 13 11:44:50 2017 +1000
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB5d8e19b801fc95083cba098bbecaa5eceb1fd685

Move BKE_pbvh_get_num_nodes out of node-access functions

Also use regular return

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

M	source/blender/blenkernel/BKE_pbvh.h
M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/editors/sculpt_paint/paint_vertex.c

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

diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index 997609d9a7d..14cb5afd022 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -148,6 +148,7 @@ struct CCGDerivedMesh *BKE_pbvh_get_ccgdm(const PBVH *bvh);
 /* Only valid for type == PBVH_BMESH */
 struct BMesh *BKE_pbvh_get_bmesh(PBVH *pbvh);
 void BKE_pbvh_bmesh_detail_size_set(PBVH *pbvh, float detail_size);
+int BKE_pbvh_get_num_nodes(const PBVH *bvh);
 
 typedef enum {
 	PBVH_Subdivide = 1,
@@ -192,7 +193,6 @@ void BKE_pbvh_node_num_verts(
 void BKE_pbvh_node_get_verts(
         PBVH *bvh, PBVHNode *node,
         const int **r_vert_indices, struct MVert **r_verts);
-void BKE_pbvh_get_num_nodes(const PBVH *bvh, int *r_totnode);
 
 void BKE_pbvh_node_get_BB(PBVHNode *node, float bb_min[3], float bb_max[3]);
 void BKE_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max[3]);
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index aa54d12f926..d2c7ba78f17 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -1343,6 +1343,12 @@ BMesh *BKE_pbvh_get_bmesh(PBVH *bvh)
 	return bvh->bm;
 }
 
+
+int BKE_pbvh_get_num_nodes(const PBVH *bvh)
+{
+	return bvh->totnode;
+}
+
 /***************************** Node Access ***********************************/
 
 void BKE_pbvh_node_mark_update(PBVHNode *node)
@@ -1413,11 +1419,6 @@ void BKE_pbvh_node_num_verts(
 	}
 }
 
-void BKE_pbvh_get_num_nodes(const PBVH *bvh, int *r_totnode)
-{
-	*r_totnode = bvh->totnode;
-}
-
 void BKE_pbvh_node_get_grids(
         PBVH *bvh, PBVHNode *node,
         int **r_grid_indices, int *r_totgrid, int *r_maxgrid, int *r_gridsize, CCGElem ***r_griddata)
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index f647015e41e..c934fc77274 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1730,9 +1730,9 @@ static void vertex_paint_init_session_average_arrays(Object *ob)
 {
 	/* Create average brush arrays */
 	if (!ob->sculpt->modes.vwpaint.tot_loops_hit) {
-		int totNode = 0;
 		/* I think the totNodes might include internal nodes, and we really only need the tot leaves. */
-		BKE_pbvh_get_num_nodes(ob->sculpt->pbvh, &totNode);
+		int totNode = BKE_pbvh_get_num_nodes(ob->sculpt->pbvh);
+
 		Mesh *me = BKE_mesh_from_object(ob);
 
 		ob->sculpt->modes.vwpaint.total_color =




More information about the Bf-blender-cvs mailing list