diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-05-19 18:31:31 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-05-19 18:31:31 +0300 |
commit | 249625971432f5ee48f93dc627af3cdedb9c9f23 (patch) | |
tree | 56ebf95485ae11c1f871a5b4fb8361f2dad80f6f /source/blender/blenkernel | |
parent | ebd7269a99c78af474fd3a3f8d5087353a4ca4ba (diff) |
Apply strand shape keys to both the base strand coordinates and the
motion state.
This means shape keys work on the goal positions for hair as well as
the simulation results (hair motion).
If the simulation is created before shape keys are applied, the
resulting sim will be mixed with the shape keys, becoming more rigid
with increased shape weights.
OTOH the shape keys can also be applied to the animation result, before
doing hair simulation. In that case the shape will only affect the goal
positions and the bending shape of the hair, but the hair is otherwise
free to move.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/cache_library.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cache_library.c b/source/blender/blenkernel/intern/cache_library.c index c0340f1c0e8..2caa0d46dd2 100644 --- a/source/blender/blenkernel/intern/cache_library.c +++ b/source/blender/blenkernel/intern/cache_library.c @@ -1530,15 +1530,21 @@ static void strandskey_process(StrandsKeyCacheModifier *skmd, CacheProcessContex shape = BKE_key_evaluate_strands(strands, skmd->key, actkb, skmd->flag & eStrandsKeyCacheModifier_Flag_ShapeLock, NULL); if (shape) { StrandsVertex *vert = strands->verts; + StrandsMotionState *state = strands->state; int totvert = strands->totverts; int i; float *fp = shape; for (i = 0; i < totvert; ++i) { copy_v3_v3(vert->co, fp); + ++vert; + + if (state) { + copy_v3_v3(state->co, fp); + ++state; + } fp += 3; - ++vert; } MEM_freeN(shape); |