[Bf-blender-cvs] [48d0dd9] alembic: Fix for cycles rendering of shortened hair curves.

Lukas Tönne noreply at git.blender.org
Sun May 24 12:46:20 CEST 2015


Commit: 48d0dd9b3a80816daf8048684990569ea0aa300a
Author: Lukas Tönne
Date:   Sun May 24 12:44:51 2015 +0200
Branches: alembic
https://developer.blender.org/rB48d0dd9b3a80816daf8048684990569ea0aa300a

Fix for cycles rendering of shortened hair curves.

The strands data can now contain more vertices than are supposed to be
rendered (if cutoff < numverts).

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

M	intern/cycles/blender/blender_curves.cpp

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

diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 8d23003..4ed0b91 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -373,14 +373,15 @@ static bool ObtainCacheStrandsData(Mesh *mesh, BL::Scene /*b_scene*/, BL::Object
 	int ivert = 0;
 	for(; icurve < totcurves; ++icurve) {
 		CurveT b_curve = b_strands.curves[icurve];
-		int numverts = b_curve.render_size();
+		int numverts = b_curve.size();
+		int showverts = b_curve.render_size();
 		int usedverts = 0;
 		CData->curve_firstkey.push_back(keyno);
 		
 		float curve_length = 0.0f;
 		float3 pcKey;
-		for(int cvert = 0; cvert < numverts; ++cvert, ++ivert) {
-			float3 cKey = traits::get_location(b_strands, ivert);
+		for(int cvert = 0; cvert < showverts; ++cvert) {
+			float3 cKey = traits::get_location(b_strands, ivert + cvert);
 			
 			if(cvert > 0) {
 				float step_length = len(cKey - pcKey);
@@ -394,6 +395,7 @@ static bool ObtainCacheStrandsData(Mesh *mesh, BL::Scene /*b_scene*/, BL::Object
 			usedverts++;
 		}
 		keyno += usedverts;
+		ivert += numverts;
 
 		CData->curve_keynum.push_back(usedverts);
 		CData->curve_length.push_back(curve_length);




More information about the Bf-blender-cvs mailing list