Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-09-21 22:20:02 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2008-09-21 22:20:02 +0400
commit8471184dc5a726903329bc37040e051e9ec0f5d4 (patch)
tree03312b48c93c5f2acb25e5280ce5a586244dd54e /source/blender/blenloader/intern/readfile.c
parentafe851b6d194ad93f85a66ea5866a3709708089d (diff)
parent518b8fe01834b6379614f65f7c611645e5ad4bd5 (diff)
Merging fluidcontrol to trunk from rev16649 fluidcontrol branch. Code provided by Nils Thuerey.
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c55
1 files changed, 43 insertions, 12 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a538cfe5fa4..8d998016667 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -37,6 +37,9 @@
#ifdef WIN32
#include "winsock2.h"
#include "BLI_winstuff.h"
+#ifndef INT_MAX
+#include "limits.h"
+#endif
#endif
#include <stdio.h> // for printf fopen fwrite fclose sprintf FILE
@@ -3063,9 +3066,12 @@ static void lib_link_object(FileData *fd, Main *main)
}
act= act->next;
}
-
- if(ob->fluidsimSettings) {
- ob->fluidsimSettings->ipo = newlibadr_us(fd, ob->id.lib, ob->fluidsimSettings->ipo);
+
+ {
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
+
+ if(fluidmd && fluidmd->fss)
+ fluidmd->fss->ipo = newlibadr_us(fd, ob->id.lib, fluidmd->fss->ipo);
}
/* texture field */
@@ -3140,6 +3146,11 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
}
}
+ else if (md->type==eModifierType_Fluidsim) {
+ FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
+
+ fluidmd->fss= newdataadr(fd, fluidmd->fss);
+ }
else if (md->type==eModifierType_Collision) {
CollisionModifierData *collmd = (CollisionModifierData*) md;
@@ -3326,13 +3337,6 @@ static void direct_link_object(FileData *fd, Object *ob)
direct_link_pointcache(fd, sb->pointcache);
}
ob->fluidsimSettings= newdataadr(fd, ob->fluidsimSettings); /* NT */
- if(ob->fluidsimSettings) {
- // reinit mesh pointers
- ob->fluidsimSettings->orgMesh = NULL; //ob->data;
- ob->fluidsimSettings->meshSurface = NULL;
- ob->fluidsimSettings->meshBB = NULL;
- ob->fluidsimSettings->meshSurfNormals = NULL;
- }
link_list(fd, &ob->particlesystem);
direct_link_particlesystems(fd,&ob->particlesystem);
@@ -7629,8 +7633,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- if(ob->fluidsimSettings && ob->fluidsimSettings->type == OB_FLUIDSIM_PARTICLE)
- part->type = PART_FLUID;
+
+ {
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
+ if(fluidmd && fluidmd->fss && fluidmd->fss->type == OB_FLUIDSIM_PARTICLE)
+ part->type = PART_FLUID;
+ }
free_effects(&ob->effect);
@@ -7775,6 +7783,29 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
la->sun_intensity = 1.0;
}
}
+
+ // convert fluids to modifier
+ if(main->versionfile <= 246 && main->subversionfile < 1)
+ {
+ Object *ob;
+
+ for(ob = main->object.first; ob; ob= ob->id.next) {
+ if(ob->fluidsimSettings)
+ {
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifier_new(eModifierType_Fluidsim);
+ BLI_addhead(&ob->modifiers, (ModifierData *)fluidmd);
+
+ MEM_freeN(fluidmd->fss);
+ fluidmd->fss = MEM_dupallocN(ob->fluidsimSettings);
+ fluidmd->fss->ipo = newlibadr_us(fd, ob->id.lib, ob->fluidsimSettings->ipo);
+ MEM_freeN(ob->fluidsimSettings);
+
+ fluidmd->fss->lastgoodframe = INT_MAX;
+ fluidmd->fss->flag = 0;
+ }
+ }
+ }
+
if(main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1)) {
Mesh *me;