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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-20 18:38:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-20 18:38:11 +0400
commitf1eb66aa68105ac27f371f4f708d8abf3b7da38b (patch)
tree77ce3c813f25702880e330740e06ae60a0aadca8 /source/blender/makesrna/intern/rna_fluidsim.c
parentbe701c7336a3f967a3a2807f8a7a0c511cb76815 (diff)
share code for fluidsim, ocean & dynamic paint file paths.
- use BLI_join_dirfile for joining all paths (no need to ensure slash is appended). - paths from linked library files now supported.
Diffstat (limited to 'source/blender/makesrna/intern/rna_fluidsim.c')
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index a7eedf5f062..09f339fa7db 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -83,18 +83,19 @@ static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
}
-static int fluidsim_find_lastframe(FluidsimSettings *fss)
+static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss)
{
- char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR];
+ char targetFileTest[FILE_MAX];
+ char targetFile[FILE_MAX];
int curFrame = 1;
- BLI_snprintf(targetDir, sizeof(targetDir), "%sfluidsurface_final_####.bobj.gz", fss->surfdataPath);
- BLI_path_abs(targetDir, G.main->name);
+ BLI_join_dirfile(targetFile, sizeof(targetFile), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME);
+ BLI_path_abs(targetFile, modifier_path_relbase(ob));
do {
- BLI_strncpy(targetFile, targetDir, sizeof(targetFile));
- BLI_path_frame(targetFile, curFrame++, 0);
- } while(BLI_exists(targetFile));
+ BLI_strncpy(targetFileTest, targetFile, sizeof(targetFileTest));
+ BLI_path_frame(targetFileTest, curFrame++, 0);
+ } while(BLI_exists(targetFileTest));
return curFrame - 1;
}
@@ -105,7 +106,7 @@ static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr)
FluidsimModifierData *fluidmd= (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
if(fluidmd->fss->flag & OB_FLUIDSIM_REVERSE) {
- fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(fluidmd->fss);
+ fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(ob, fluidmd->fss);
}
else {
fluidmd->fss->lastgoodframe = -1;