diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-07-30 07:46:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-07-30 08:14:26 +0300 |
commit | 362b3bbe58ae378d5e154dd1a27d55d913594a1a (patch) | |
tree | b3e9f3258623ed91abb11755f3808deff4d17323 /source/blender/blenkernel/intern/cloth.c | |
parent | 7a4353160cc5b5e71dde234c7db95302b4233918 (diff) |
Cloth Simulation: add time scale property
This setting can also be animated, to create a "time warp" effect.
D2122 by @LucaRood
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 22d7cbafe41..681b93172b2 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -97,6 +97,7 @@ void cloth_init(ClothModifierData *clmd ) clmd->sim_parms->avg_spring_len = 0.0; clmd->sim_parms->presets = 2; /* cotton as start setting */ clmd->sim_parms->timescale = 1.0f; /* speed factor, describes how fast cloth moves */ + clmd->sim_parms->time_scale = 1.0f; /* multiplies cloth speed */ clmd->sim_parms->reset = 0; clmd->sim_parms->vel_damping = 1.0f; /* 1.0 = no damping, 0.0 = fully dampened */ @@ -411,7 +412,7 @@ void clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, Derived BKE_ptcache_id_from_cloth(&pid, ob, clmd); BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, ×cale); - clmd->sim_parms->timescale= timescale; + clmd->sim_parms->timescale= timescale * clmd->sim_parms->time_scale; if (clmd->sim_parms->reset || (clmd->clothObject && dm->getNumVerts(dm) != clmd->clothObject->mvert_num)) { clmd->sim_parms->reset = 0; |