[Bf-blender-cvs] [229245f] temp-derivedmesh-looptri: Merge branch 'master' into temp-derivedmesh-looptri

Campbell Barton noreply at git.blender.org
Sat Jul 11 20:11:03 CEST 2015


Commit: 229245fe1abfdd0cc6861dc84822a76a30db3ccd
Author: Campbell Barton
Date:   Sun Jul 12 03:51:14 2015 +1000
Branches: temp-derivedmesh-looptri
https://developer.blender.org/rB229245fe1abfdd0cc6861dc84822a76a30db3ccd

Merge branch 'master' into temp-derivedmesh-looptri

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



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

diff --cc source/blender/blenkernel/intern/pbvh.c
index 4d277dc,3615576..fb3a1a2
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@@ -288,27 -289,29 +290,30 @@@ static void build_mesh_leaf_node(PBVH *
  	/* reserve size is rough guess */
  	map = BLI_ghash_int_new_ex("build_mesh_leaf_node gh", 2 * totface);
  
- 	node->face_vert_indices = MEM_callocN(sizeof(int) * 4 * totface,
- 	                                      "bvh node face vert indices");
+ 	face_vert_indices = MEM_callocN(sizeof(int[4]) * totface,
+ 	                                "bvh node face vert indices");
+ 
+ 	node->face_vert_indices = (const int (*)[4])face_vert_indices;
  
  	for (i = 0; i < totface; ++i) {
 -		const MFace *f = &bvh->faces[node->prim_indices[i]];
 -		int sides = f->v4 ? 4 : 3;
 +		const MLoopTri *lt = &bvh->looptri[node->prim_indices[i]];
 +		int sides = 3;
  
  		for (j = 0; j < sides; ++j) {
- 			node->face_vert_indices[i][j] =
+ 			face_vert_indices[i][j] =
  			        map_insert_vert(bvh, map, &node->face_verts,
 -			                        &node->uniq_verts, (&f->v1)[j]);
 +			                        &node->uniq_verts, bvh->mloop[lt->tri[j]].v);
  		}
  
 -		if (!paint_is_face_hidden(f, bvh->verts))
 +		if (!paint_is_face_hidden(lt, bvh->verts, bvh->mloop)) {
  			has_visible = true;
 +		}
  	}
  
- 	node->vert_indices = MEM_callocN(sizeof(int) *
- 	                                 (node->uniq_verts + node->face_verts),
- 	                                 "bvh node vert indices");
+ 	vert_indices = MEM_callocN(sizeof(int) *
+ 	                           (node->uniq_verts + node->face_verts),
+ 	                           "bvh node vert indices");
+ 	node->vert_indices = vert_indices;
  
  	/* Build the vertex list, unique verts first */
  	GHASH_ITER (gh_iter, map) {
@@@ -323,12 -326,13 +328,12 @@@
  	}
  
  	for (i = 0; i < totface; ++i) {
 -		const MFace *f = &bvh->faces[node->prim_indices[i]];
 -		int sides = f->v4 ? 4 : 3;
 -		
 +		int sides = 3;
 +
  		for (j = 0; j < sides; ++j) {
- 			if (node->face_vert_indices[i][j] < 0)
- 				node->face_vert_indices[i][j] =
- 				        -node->face_vert_indices[i][j] +
+ 			if (face_vert_indices[i][j] < 0)
+ 				face_vert_indices[i][j] =
+ 				        -face_vert_indices[i][j] +
  				        node->uniq_verts - 1;
  		}
  	}




More information about the Bf-blender-cvs mailing list