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/blenloader/intern/versioning_270.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/blenloader/intern/versioning_270.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index a254a854c66..3e6b0d34ba6 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1231,5 +1231,24 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) br->flag |= BRUSH_ACCUMULATE; } } + + if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "float", "time_scale")) { + Object *ob; + ModifierData *md; + for (ob = main->object.first; ob; ob = ob->id.next) { + for (md = ob->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_Cloth) { + ClothModifierData *clmd = (ClothModifierData *)md; + clmd->sim_parms->time_scale = 1.0f; + } + else if (md->type == eModifierType_ParticleSystem) { + ParticleSystemModifierData *pmd = (ParticleSystemModifierData *)md; + if (pmd->psys->clmd) { + pmd->psys->clmd->sim_parms->time_scale = 1.0f; + } + } + } + } + } } } |