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:
authorLukas Tönne <lukas.toenne@gmail.com>2015-01-19 15:32:53 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:30:32 +0300
commit8ac20d1dee6f0a7f9781a0b1270db5104fce2064 (patch)
tree265de2045f954898d400c4240bf4fe14c8528e19 /source/blender/blenkernel/intern/particle.c
parent1a918cb66e45d2bfa1ac2153c08f81b09429695a (diff)
Use separate flags to enable/disable clump and roughness curves for
child hairs. This allows disabling the curves temporarily without losing the setup. Conflicts: source/blender/blenkernel/BKE_blender.h
Diffstat (limited to 'source/blender/blenkernel/intern/particle.c')
-rw-r--r--source/blender/blenkernel/intern/particle.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index b146a40db63..c489dced9df 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1754,6 +1754,8 @@ void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
int do_guides(ParticleSettings *part, ListBase *effectors, ParticleKey *state, int index, float time)
{
+ CurveMapping *clumpcurve = (part->child_flag & PART_CHILD_USE_CLUMP_CURVE) ? part->clumpcurve : NULL;
+ CurveMapping *roughcurve = (part->child_flag & PART_CHILD_USE_ROUGH_CURVE) ? part->roughcurve : NULL;
EffectorCache *eff;
PartDeflect *pd;
Curve *cu;
@@ -1821,10 +1823,10 @@ int do_guides(ParticleSettings *part, ListBase *effectors, ParticleKey *state, i
}
}
- if (part->clumpcurve)
- curvemapping_changed_all(part->clumpcurve);
- if (part->roughcurve)
- curvemapping_changed_all(part->roughcurve);
+ if (clumpcurve)
+ curvemapping_changed_all(clumpcurve);
+ if (roughcurve)
+ curvemapping_changed_all(roughcurve);
{
ParticleKey key;
@@ -1836,7 +1838,7 @@ int do_guides(ParticleSettings *part, ListBase *effectors, ParticleKey *state, i
copy_v3_v3(key.co, vec_to_point);
do_kink(&key, par_co, par_vel, par_rot, guidetime, pd->kink_freq, pd->kink_shape, pd->kink_amp, 0.f, pd->kink, pd->kink_axis, 0, 0);
do_clump(&key, par_co, guidetime, orco_offset, pd->clump_fac, pd->clump_pow, 1.0f,
- part->child_flag & PART_CHILD_USE_CLUMP_NOISE, part->clump_noise_size, part->clumpcurve);
+ part->child_flag & PART_CHILD_USE_CLUMP_NOISE, part->clump_noise_size, clumpcurve);
copy_v3_v3(vec_to_point, key.co);
}
@@ -2041,9 +2043,9 @@ static bool psys_thread_context_init_path(ParticleThreadContext *ctx, ParticleSi
ctx->vg_effector = psys_cache_vgroup(ctx->dm, psys, PSYS_VG_EFFECTOR);
/* prepare curvemapping tables */
- if (part->clumpcurve)
+ if ((part->child_flag & PART_CHILD_USE_CLUMP_CURVE) && part->clumpcurve)
curvemapping_changed_all(part->clumpcurve);
- if (part->roughcurve)
+ if ((part->child_flag & PART_CHILD_USE_ROUGH_CURVE) && part->roughcurve)
curvemapping_changed_all(part->roughcurve);
return true;