Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-04-18 11:52:27 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-04-18 11:52:27 +0300
commit0afe1032695f427c2b1358981eb493370e2f63fd (patch)
tree0d80e6047af8dece9108fdbd90c25dc173c7289b
parentbc9e05599de025dbcaa5cd006c332c9d343d49d1 (diff)
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.
-rw-r--r--source/blender/blenkernel/intern/particle.c13
1 files changed, 10 insertions, 3 deletions
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;