diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-14 14:29:19 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 11:30:11 +0300 |
commit | 2fe96f3f88c080cbb5433f5d9d0322a12e2bc539 (patch) | |
tree | 1e00c3f5f916731bdbbc1e35162cc16406986ee0 /source/blender/blenkernel/intern/particle_child.c | |
parent | 96981822277f38f4ed3a97c072022d5fcc3a8111 (diff) |
New texture influence option for particle kink amplitude (as opposed to
frequency).
Diffstat (limited to 'source/blender/blenkernel/intern/particle_child.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_child.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c index d79dd91d9dd..5bc79d132d5 100644 --- a/source/blender/blenkernel/intern/particle_child.c +++ b/source/blender/blenkernel/intern/particle_child.c @@ -204,6 +204,7 @@ static void do_kink_spiral(ParticleThreadContext *ctx, ParticleTexture *ptex, co float kink_base[3]; if (ptex) { + kink_amp *= ptex->kink_amp; kink_freq *= ptex->kink_freq; rough1 *= ptex->rough1; rough2 *= ptex->rough2; @@ -670,6 +671,8 @@ void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *ptex, cons int i = cpa - sim->psys->child; int guided = 0; + float kink_amp = part->kink_amp; + float kink_amp_clump = part->kink_amp_clump; float kink_freq = part->kink_freq; float rough1 = part->rough1; float rough2 = part->rough2; @@ -677,6 +680,7 @@ void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *ptex, cons const bool smooth_start = (sim->psys->part->childtype == PART_CHILD_FACES); if (ptex) { + kink_amp *= ptex->kink_amp; kink_freq *= ptex->kink_freq; rough1 *= ptex->rough1; rough2 *= ptex->rough2; @@ -696,13 +700,8 @@ void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *ptex, cons part->child_flag & PART_CHILD_USE_CLUMP_NOISE, part->clump_noise_size, part->clumpcurve); if (kink_freq != 0.f) { - float kink_amp; - /* seriously ... */ - if (ELEM(part->kink, PART_KINK_SPIRAL)) - kink_amp = part->kink_amp; - else - kink_amp = part->kink_amp * (1.f - part->kink_amp_clump * clump); - + kink_amp *= (1.f - kink_amp_clump * clump); + do_kink(state, par_co, par_vel, par_rot, t, kink_freq, part->kink_shape, kink_amp, part->kink_flat, part->kink, part->kink_axis, sim->ob->obmat, smooth_start); |