[Bf-blender-cvs] [b899114] master: Fix T45937: Cycles hair not rendered if children count set to zero

Sergey Sharybin noreply at git.blender.org
Thu Sep 3 16:02:59 CEST 2015


Commit: b899114a7ed222ad41c86f2408200838dd6e33ba
Author: Sergey Sharybin
Date:   Thu Sep 3 18:54:50 2015 +0500
Branches: master
https://developer.blender.org/rBb899114a7ed222ad41c86f2408200838dd6e33ba

Fix T45937: Cycles hair not rendered if children count set to zero

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

M	intern/cycles/blender/blender_curves.cpp

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

diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index dba801f..6a119081 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -145,7 +145,7 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
 				int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_part.draw_percentage() / 100.0f);
 				int totcurves = totchild;
 				
-				if(b_part.child_type() == 0)
+				if(b_part.child_type() == 0 || totchild == 0)
 					totcurves += totparts;
 
 				if(totcurves == 0)
@@ -169,7 +169,7 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
 				CData->psys_closetip.push_back(get_boolean(cpsys, "use_closetip"));
 
 				int pa_no = 0;
-				if(!(b_part.child_type() == 0))
+				if(!(b_part.child_type() == 0) && totchild != 0)
 					pa_no = totparts;
 
 				int num_add = (totparts+totchild - pa_no);
@@ -233,14 +233,14 @@ bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Parti
 				int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_part.draw_percentage() / 100.0f);
 				int totcurves = totchild;
 				
-				if(b_part.child_type() == 0)
+				if(b_part.child_type() == 0 || totchild == 0)
 					totcurves += totparts;
 
 				if(totcurves == 0)
 					continue;
 
 				int pa_no = 0;
-				if(!(b_part.child_type() == 0))
+				if(!(b_part.child_type() == 0) && totchild != 0)
 					pa_no = totparts;
 
 				int num_add = (totparts+totchild - pa_no);
@@ -287,14 +287,14 @@ bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
 				int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_part.draw_percentage() / 100.0f);
 				int totcurves = totchild;
 				
-				if(b_part.child_type() == 0)
+				if(b_part.child_type() == 0 || totchild == 0)
 					totcurves += totparts;
 
 				if(totcurves == 0)
 					continue;
 
 				int pa_no = 0;
-				if(!(b_part.child_type() == 0))
+				if(!(b_part.child_type() == 0) && totchild != 0)
 					pa_no = totparts;
 
 				int num_add = (totparts+totchild - pa_no);




More information about the Bf-blender-cvs mailing list