[Bf-blender-cvs] [10bf7f6] gooseberry: Ignore paths with segments == -1, this is used to indicated hidden children.

Lukas Tönne noreply at git.blender.org
Thu Jan 22 19:51:25 CET 2015


Commit: 10bf7f6d3d41b9b0ed4a7df9406faaf08474afce
Author: Lukas Tönne
Date:   Thu Jan 22 18:41:55 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB10bf7f6d3d41b9b0ed4a7df9406faaf08474afce

Ignore paths with segments == -1, this is used to indicated hidden
children.

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

M	source/blender/blenkernel/intern/particle.c
M	source/blender/editors/space_view3d/drawobject.c

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

diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 7070a3a..d5af21b 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2242,7 +2242,6 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp
 	psys_calc_child_parent_weights(task, cpa, orco, ornor, hairmat, &cpa_num, &cpa_fuv, &cpa_from, key, weight, off1);
 
 	child_keys->segments = ctx->segments;
-	child_keys->hull_parent = cpa->hull_parent;
 
 	/* get different child parameters from textures & vgroups */
 	get_child_modifier_parameters(part, ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex);
@@ -2254,6 +2253,8 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp
 
 	/* create the child path */
 	for (k = 0, child = child_keys; k <= ctx->segments; k++, child++) {
+		child->hull_parent = cpa->hull_parent;
+		
 		if (ctx->between) {
 			int w = 0;
 
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 4fece10..40d96e8 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -4535,12 +4535,15 @@ static void draw_particle_hair_hull(Scene *UNUSED(scene), View3D *v3d, RegionVie
 			int segments, k;
 			
 			path = cache[p];
-			if (path->hull_parent < 0) {
+			/* note: hidden hacks in particles: segments == -1 means the child path is hidden (preview feature) ... */
+			if (path->segments < 0 || path->hull_parent < 0) {
 				pstart = p+1;
 				continue;
 			}
 			
 			npath = p+1 < totchild ? cache[p+1] : NULL;
+			if (npath && npath->segments < 0)
+				npath = NULL;
 			
 			if (npath && npath->hull_parent == path->hull_parent) {
 				segments = max_ii(path->segments, npath->segments);




More information about the Bf-blender-cvs mailing list