diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-06-12 21:33:38 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2020-06-19 12:17:02 +0300 |
commit | 9e7012995249281b041d55607e7e7408857aa8c4 (patch) | |
tree | c798c27f235113ed4909fb6e11f68d84653ed8c6 /source/blender/blenloader/intern/versioning_280.c | |
parent | f382109f3885fc48d7becc526796d3324ab0aa42 (diff) |
Cloth: allow forces to act parallel to cloth.
Currently all force effectors can only act on cloth when the force is
perpendicular to the surface. This makes sense for wind, but not for
other forces; and the user may want even wind to have some friction.
This changes effector code to output two force vectors - although
you of course can pass the same pointer for both. The force is split
between the two outputs based on a new per-effector setting.
Differential Revision: https://developer.blender.org/D8017
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 6211c58d7d4..0648264466d 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -5075,6 +5075,23 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) * \note Keep this message at the bottom of the function. */ { + /* Set the cloth wind factor to 1 for old forces. */ + if (!DNA_struct_elem_find(fd->filesdna, "PartDeflect", "float", "f_wind_factor")) { + LISTBASE_FOREACH (Object *, ob, &bmain->objects) { + if (ob->pd) { + ob->pd->f_wind_factor = 1.0f; + } + } + LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) { + if (part->pd) { + part->pd->f_wind_factor = 1.0f; + } + if (part->pd2) { + part->pd2->f_wind_factor = 1.0f; + } + } + } + /* Keep this block, even when empty. */ } } |