diff options
author | Thomas Dinges <blender@dingto.org> | 2012-04-16 01:02:08 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-04-16 01:02:08 +0400 |
commit | 5496e87eee5951345ecb2d3f503342246fd8581e (patch) | |
tree | 296cf327a299682d45dae08f5cba69506d02cd21 /source/blender/blenloader | |
parent | 86508076d8190a374bcd9c17785eb0802dd4c1ca (diff) |
Fluid Simulation:
* Replaced the hard coded viscosity presets with Python ones.
* Added version check, so older files load fine.
Loading new files into 2.62 also works fine.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 55f0ccebf95..6a40e1ebf43 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -13323,6 +13323,30 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 4)) + { + /* Read Viscosity presets from older files */ + Object *ob; + + for (ob = main->object.first; ob; ob = ob->id.next) { + ModifierData *md; + for (md = ob->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_Fluidsim) { + FluidsimModifierData *fmd = (FluidsimModifierData *)md; + if(fmd->fss->viscosityMode == 3) { + fmd->fss->viscosityValue = 5.0; + fmd->fss->viscosityExponent = 5; + } + else if(fmd->fss->viscosityMode == 4) { + fmd->fss->viscosityValue = 2.0; + fmd->fss->viscosityExponent = 3; + } + } + } + } + } + + { /* Default for old files is to save particle rotations to pointcache */ |