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/makesrna | |
parent | 28369f725c10f167e504f0acd695a0f9d3c2a709 (diff) |
Cleanup: remove G.main from BKE modifier.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_fluidsim.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index c7cfde18723..d1ba034d91a 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -86,14 +86,14 @@ 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(Object *ob, FluidsimSettings *fss) +static int fluidsim_find_lastframe(Main *bmain, Object *ob, FluidsimSettings *fss) { char targetFileTest[FILE_MAX]; char targetFile[FILE_MAX]; int curFrame = 1; BLI_join_dirfile(targetFile, sizeof(targetFile), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME); - BLI_path_abs(targetFile, modifier_path_relbase(ob)); + BLI_path_abs(targetFile, modifier_path_relbase(bmain, ob)); do { BLI_strncpy(targetFileTest, targetFile, sizeof(targetFileTest)); @@ -109,7 +109,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(ob, fluidmd->fss); + fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(bmain, ob, fluidmd->fss); } else { fluidmd->fss->lastgoodframe = -1; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 2710a184367..f3828d8ddf2 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -612,7 +612,8 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, R } } -static void rna_ParticleSystem_set_resolution(ParticleSystem *particlesystem, Scene *scene, Object *object, int resolution) +static void rna_ParticleSystem_set_resolution( + ParticleSystem *particlesystem, Main *bmain, Scene *scene, Object *object, int resolution) { if (resolution == eModifierMode_Render) { ParticleSystemModifierData *psmd = psys_get_modifier(object, particlesystem); @@ -622,7 +623,7 @@ static void rna_ParticleSystem_set_resolution(ParticleSystem *particlesystem, Sc psys_render_set(object, particlesystem, mat, mat, 1, 1, 0.f); psmd->flag &= ~eParticleSystemFlag_psys_updated; - particle_system_update(scene, object, particlesystem, true); + particle_system_update(bmain, scene, object, particlesystem, true); } else { ParticleSystemModifierData *psmd = psys_get_modifier(object, particlesystem); @@ -632,7 +633,7 @@ static void rna_ParticleSystem_set_resolution(ParticleSystem *particlesystem, Sc } psmd->flag &= ~eParticleSystemFlag_psys_updated; - particle_system_update(scene, object, particlesystem, false); + particle_system_update(bmain, scene, object, particlesystem, false); } } @@ -3604,6 +3605,7 @@ static void rna_def_particle_system(BlenderRNA *brna) /* set viewport or render resolution */ func = RNA_def_function(srna, "set_resolution", "rna_ParticleSystem_set_resolution"); RNA_def_function_ui_description(func, "Set the resolution to use for the number of particles"); + RNA_def_function_flag(func, FUNC_USE_MAIN); RNA_def_pointer(func, "scene", "Scene", "", "Scene"); RNA_def_pointer(func, "object", "Object", "", "Object"); RNA_def_enum(func, "resolution", resolution_items, 0, "", "Resolution settings to apply"); |