diff options
author | Jacques Lucke <jacques@blender.org> | 2020-04-23 16:10:20 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-04-23 16:10:20 +0300 |
commit | 694c0547c21aa3a5087c0dd4323624358135f4ef (patch) | |
tree | dadec7a2f05a137280bd1c18a96058821388a0ee /source/blender/blenloader/intern/versioning_280.c | |
parent | 6524aaf685638ef5f9fdca03ae682a0b4d18c6f6 (diff) |
Fix T73680: Scene and fluid modifier gravity are scaled differently
Reviewers: sebbas
Differential Revision: https://developer.blender.org/D7483
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 329767ef202..d246eadb381 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -40,6 +40,7 @@ #include "DNA_constraint_types.h" #include "DNA_curve_types.h" #include "DNA_curveprofile_types.h" +#include "DNA_fluid_types.h" #include "DNA_freestyle_types.h" #include "DNA_genfile.h" #include "DNA_gpencil_modifier_types.h" @@ -5037,6 +5038,20 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + /* Match scale of fluid modifier gravity with scene gravity. */ + if (!MAIN_VERSION_ATLEAST(bmain, 283, 15)) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { + for (ModifierData *md = ob->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_Fluid) { + FluidModifierData *fmd = (FluidModifierData *)md; + if (fmd->domain != NULL) { + mul_v3_fl(fmd->domain->gravity, 9.81f); + } + } + } + } + } + /** * Versioning code until next subversion bump goes here. * |