[Bf-blender-cvs] [0afe1032695] master: Particles: Interpolate size for interpolated children

Sergey Sharybin noreply at git.blender.org
Wed Apr 18 10:56:56 CEST 2018


Commit: 0afe1032695f427c2b1358981eb493370e2f63fd
Author: Sergey Sharybin
Date:   Wed Apr 18 10:52:27 2018 +0200
Branches: master
https://developer.blender.org/rB0afe1032695f427c2b1358981eb493370e2f63fd

Particles: Interpolate size for interpolated children

This finally allows us to use Random factor to add variations to the
interpolated children. This feature never worked since 2007L there was
random factor slider in the interface, but it was only used by simple
children. Now it has affect on interpolated children as well.

Technically, this will break compatibility if older file had random
factor set to something else than 0 (default value is 0 though). But
we are leaving 2.7 series, so can accept such breackage in the name
of supported features.

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

M	source/blender/blenkernel/intern/particle.c

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

diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 04c365eee76..7602523b97c 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3724,10 +3724,17 @@ float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float UNUSED
 	ParticleSettings *part = psys->part;
 	float size; // time XXX
 	
-	if (part->childtype == PART_CHILD_FACES)
-		size = part->size;
-	else
+	if (part->childtype == PART_CHILD_FACES) {
+		int w = 0;
+		size = 0.0;
+		while (w < 4 && cpa->pa[w] >= 0) {
+			size += cpa->w[w] * (psys->particles + cpa->pa[w])->size;
+			w++;
+		}
+	}
+	else {
 		size = psys->particles[cpa->parent].size;
+	}
 
 	size *= part->childsize;



More information about the Bf-blender-cvs mailing list