diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 16:24:30 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 16:24:30 +0300 |
commit | b53d358261a26652d510d62565f1b43035a55e67 (patch) | |
tree | b952fa8fa04aee19d7ae6ebd6555e2220d2dbe31 /source/blender/modifiers | |
parent | 28369f725c10f167e504f0acd695a0f9d3c2a709 (diff) |
Cleanup: remove G.main from BKE modifier.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_fluidsim_util.c | 7 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 8 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_particlesystem.c | 3 |
3 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 1aed6309359..964a1bb8c34 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -48,6 +48,7 @@ #include "BKE_fluidsim.h" /* ensure definitions here match */ #include "BKE_cdderivedmesh.h" +#include "BKE_main.h" #ifdef WITH_MOD_FLUID # include "BKE_global.h" #endif @@ -427,7 +428,7 @@ static void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh * } static DerivedMesh *fluidsim_read_cache( - Object *ob, DerivedMesh *orgdm, + Main *bmain, Object *ob, DerivedMesh *orgdm, FluidsimModifierData *fluidmd, int framenr, int useRenderParams) { int curFrame = framenr /* - 1 */ /*scene->r.sfra*/; /* start with 0 at start frame */ @@ -462,7 +463,7 @@ static DerivedMesh *fluidsim_read_cache( /* offset baked frame */ curFrame += fss->frameOffset; - BLI_path_abs(targetFile, modifier_path_relbase(ob)); + BLI_path_abs(targetFile, modifier_path_relbase(bmain, ob)); BLI_path_frame(targetFile, curFrame, 0); // fixed #frame-no /* assign material + flags to new dm @@ -545,7 +546,7 @@ DerivedMesh *fluidsimModifier_do( /* try to read from cache */ /* if the frame is there, fine, otherwise don't do anything */ - if ((result = fluidsim_read_cache(ob, dm, fluidmd, framenr, useRenderParams))) + if ((result = fluidsim_read_cache(G.main, ob, dm, fluidmd, framenr, useRenderParams))) return result; return dm; diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index d001917fce8..9a60e8e1fbd 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -41,15 +41,17 @@ #include "BLI_utildefines.h" #include "BKE_cdderivedmesh.h" +#include "BKE_global.h" +#include "BKE_main.h" #include "BKE_modifier.h" #include "BKE_ocean.h" #include "MOD_modifiertypes.h" #ifdef WITH_OCEANSIM -static void init_cache_data(Object *ob, struct OceanModifierData *omd) +static void init_cache_data(Main *bmain, Object *ob, struct OceanModifierData *omd) { - const char *relbase = modifier_path_relbase(ob); + const char *relbase = modifier_path_relbase(bmain, ob); omd->oceancache = BKE_ocean_init_cache(omd->cachepath, relbase, omd->bakestart, omd->bakeend, omd->wave_scale, @@ -447,7 +449,7 @@ static DerivedMesh *doOcean( /* do ocean simulation */ if (omd->cached == true) { if (!omd->oceancache) { - init_cache_data(ob, omd); + init_cache_data(G.main, ob, omd); } BKE_ocean_simulate_cache(omd->oceancache, md->scene->r.cfra); } diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c index 9549290e5cc..04aec23e38c 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.c +++ b/source/blender/modifiers/intern/MOD_particlesystem.c @@ -42,6 +42,7 @@ #include "BKE_cdderivedmesh.h" +#include "BKE_global.h" #include "BKE_modifier.h" #include "BKE_particle.h" @@ -189,7 +190,7 @@ static void deformVerts( if (!(ob->transflag & OB_NO_PSYS_UPDATE)) { psmd->flag &= ~eParticleSystemFlag_psys_updated; - particle_system_update(md->scene, ob, psys, (flag & MOD_APPLY_RENDER) != 0); + particle_system_update(G.main, md->scene, ob, psys, (flag & MOD_APPLY_RENDER) != 0); psmd->flag |= eParticleSystemFlag_psys_updated; } } |