[Bf-blender-cvs] [209a64111e] master: Fix part of T50634: Hair Primitive as Triangles + Hair shader with a texture = crash

Sergey Sharybin noreply at git.blender.org
Mon Feb 27 15:21:20 CET 2017


Commit: 209a64111e31a644fd39a0d918c0fafb12e7fbda
Author: Sergey Sharybin
Date:   Mon Feb 27 13:39:23 2017 +0100
Branches: master
https://developer.blender.org/rB209a64111e31a644fd39a0d918c0fafb12e7fbda

Fix part of T50634: Hair Primitive as Triangles + Hair shader with a texture = crash

Wrong formula was used to calculate needed verts and tris to be reserved.

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

M	intern/cycles/blender/blender_curves.cpp

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

diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 9214882bb9..7365f39aaa 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -434,8 +434,8 @@ static void ExportCurveTriangleGeometry(Mesh *mesh,
 			if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
 				continue;
 
-			numverts += (CData->curve_keynum[curve] - 2)*2*resolution + resolution;
-			numtris += (CData->curve_keynum[curve] - 2)*resolution;
+			numverts += (CData->curve_keynum[curve] - 1)*resolution + resolution;
+			numtris += (CData->curve_keynum[curve] - 1)*2*resolution;
 		}
 	}




More information about the Bf-blender-cvs mailing list