[Bf-blender-cvs] [dc80ff9] master: Fix T45541 crash when mixing flat and smooth shaded faces in sculpt mode.

Antony Riakiotakis noreply at git.blender.org
Fri Jul 24 16:28:56 CEST 2015


Commit: dc80ff9b56df7a509b62031f9e638347072ab927
Author: Antony Riakiotakis
Date:   Fri Jul 24 16:28:18 2015 +0200
Branches: master
https://developer.blender.org/rBdc80ff9b56df7a509b62031f9e638347072ab927

Fix T45541 crash when mixing flat and smooth shaded faces in sculpt
mode.

Issue from looptri merge.

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

M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/gpu/intern/gpu_buffers.c

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

diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 9ec9f2f..e6579a3 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -209,7 +209,7 @@ static int partition_indices_material(PBVH *bvh, int lo, int hi)
 	int i = lo, j = hi;
 
 	if (bvh->looptri)
-		first = &looptri[bvh->prim_indices[lo]];
+		first = &mpoly[looptri[bvh->prim_indices[lo]].poly];
 	else
 		first = &flagmats[bvh->prim_indices[lo]];
 
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 7c71b32..b2bfb0b 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1317,7 +1317,7 @@ GPU_PBVH_Buffers *GPU_build_mesh_pbvh_buffers(
 
 	buffers = MEM_callocN(sizeof(GPU_PBVH_Buffers), "GPU_Buffers");
 	buffers->index_type = GL_UNSIGNED_SHORT;
-	buffers->smooth = mpoly[face_indices[0]].flag & ME_SMOOTH;
+	buffers->smooth = mpoly[looptri[face_indices[0]].poly].flag & ME_SMOOTH;
 
 	buffers->show_diffuse_color = false;
 	buffers->use_matcaps = false;




More information about the Bf-blender-cvs mailing list