From b53d358261a26652d510d62565f1b43035a55e67 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 31 May 2018 15:24:30 +0200 Subject: Cleanup: remove G.main from BKE modifier. --- source/blender/editors/physics/physics_fluid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/physics') diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index ce1e9d5cf6a..c050f889eee 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -48,6 +48,7 @@ #include "BKE_context.h" #include "BKE_customdata.h" #include "BKE_fluidsim.h" +#include "BKE_main.h" #include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_report.h" @@ -632,13 +633,13 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom #define FLUID_SUFFIX_SURFACE "fluidsurface" static bool fluid_init_filepaths( - ReportList *reports, FluidsimSettings *domainSettings, Object *fsDomain, + Main *bmain, ReportList *reports, FluidsimSettings *domainSettings, Object *fsDomain, char *targetDir, char *targetFile) { const char *suffixConfigTmp = FLUID_SUFFIX_CONFIG_TMP; /* prepare names... */ - const char *relbase = modifier_path_relbase(fsDomain); + const char *relbase = modifier_path_relbase(bmain, fsDomain); /* We do not accept empty paths, they can end in random places silently, see T51176. */ if (domainSettings->surfdataPath[0] == '\0') { @@ -835,6 +836,7 @@ static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *r static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, short do_job) { + Main *bmain = CTX_data_main(C); Scene *scene= CTX_data_scene(C); int i; FluidsimSettings *domainSettings; @@ -842,7 +844,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor char debugStrBuffer[256]; int gridlevels = 0; - const char *relbase= modifier_path_relbase(fsDomain); + const char *relbase= modifier_path_relbase(bmain, fsDomain); const char *strEnvName = "BLENDER_ELBEEMDEBUG"; // from blendercall.cpp const char *suffixConfigTmp = FLUID_SUFFIX_CONFIG_TMP; const char *suffixSurface = FLUID_SUFFIX_SURFACE; @@ -934,7 +936,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor /* ******** prepare output file paths ******** */ - if (!fluid_init_filepaths(reports, domainSettings, fsDomain, targetDir, targetFile)) { + if (!fluid_init_filepaths(bmain, reports, domainSettings, fsDomain, targetDir, targetFile)) { fluidbake_free_data(channels, fobjects, fsset, fb); return false; } -- cgit v1.2.3