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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-31 16:24:30 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-31 16:24:30 +0300
commitb53d358261a26652d510d62565f1b43035a55e67 (patch)
treeb952fa8fa04aee19d7ae6ebd6555e2220d2dbe31 /source/blender/blenkernel
parent28369f725c10f167e504f0acd695a0f9d3c2a709 (diff)
Cleanup: remove G.main from BKE modifier.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_modifier.h2
-rw-r--r--source/blender/blenkernel/BKE_particle.h2
-rw-r--r--source/blender/blenkernel/intern/modifier.c6
-rw-r--r--source/blender/blenkernel/intern/object_update.c2
-rw-r--r--source/blender/blenkernel/intern/particle_system.c9
5 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index f5c5b74a2ae..aacd2f99ff5 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -430,7 +430,7 @@ void test_object_modifiers(struct Object *ob);
void modifier_mdef_compact_influences(struct ModifierData *md);
void modifier_path_init(char *path, int path_maxlen, const char *name);
-const char *modifier_path_relbase(struct Object *ob);
+const char *modifier_path_relbase(struct Main *bmain, struct Object *ob);
/* wrappers for modifier callbacks */
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 0cda7dceb33..f09aa17ea92 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -389,7 +389,7 @@ void psys_check_boid_data(struct ParticleSystem *psys);
void psys_get_birth_coords(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, float dtime, float cfra);
-void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, const bool use_render_params);
+void particle_system_update(struct Main *bmain, struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, const bool use_render_params);
/* Callback format for performing operations on ID-pointers for particle systems */
typedef void (*ParticleSystemIDFunc)(struct ParticleSystem *psys, struct ID **idpoin, void *userdata, int cb_flag);
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 19c0a083703..50923901a36 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -58,6 +58,7 @@
#include "BLT_translation.h"
#include "BKE_appdir.h"
+#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_library_query.h"
@@ -65,7 +66,6 @@
#include "BKE_DerivedMesh.h"
/* may move these, only for modifier_path_relbase */
-#include "BKE_global.h" /* ugh, G.main->name only */
#include "BKE_main.h"
/* end */
@@ -765,10 +765,10 @@ void test_object_modifiers(Object *ob)
* - else if the file has been saved return the blend file path.
* - else if the file isn't saved and the ID isn't from a library, return the temp dir.
*/
-const char *modifier_path_relbase(Object *ob)
+const char *modifier_path_relbase(Main *bmain, Object *ob)
{
if (G.relbase_valid || ID_IS_LINKED(ob)) {
- return ID_BLEND_PATH(G.main, &ob->id);
+ return ID_BLEND_PATH(bmain, &ob->id);
}
else {
/* last resort, better then using "" which resolves to the current
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index e2e28d4b251..8ab3028c935 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -260,7 +260,7 @@ void BKE_object_handle_data_update(EvaluationContext *eval_ctx,
ob->transflag |= OB_DUPLIPARTS;
}
- particle_system_update(scene, ob, psys, (eval_ctx->mode == DAG_EVAL_RENDER));
+ particle_system_update(G.main, scene, ob, psys, (eval_ctx->mode == DAG_EVAL_RENDER));
psys = psys->next;
}
else if (psys->flag & PSYS_DELETE) {
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 94c1dd0c7c3..d8d59e9d2ac 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -75,6 +75,7 @@
#include "BKE_colortools.h"
#include "BKE_effect.h"
#include "BKE_library_query.h"
+#include "BKE_main.h"
#include "BKE_particle.h"
#include "BKE_DerivedMesh.h"
@@ -3796,7 +3797,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
}
}
-static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra), const bool use_render_params)
+static void particles_fluid_step(Main *bmain, ParticleSimulationData *sim, int UNUSED(cfra), const bool use_render_params)
{
ParticleSystem *psys = sim->psys;
if (psys->particles) {
@@ -3827,7 +3828,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra),
// ok, start loading
BLI_join_dirfile(filename, sizeof(filename), fss->surfdataPath, OB_FLUIDSIM_SURF_PARTICLES_FNAME);
- BLI_path_abs(filename, modifier_path_relbase(sim->ob));
+ BLI_path_abs(filename, modifier_path_relbase(bmain, sim->ob));
BLI_path_frame(filename, curFrame, 0); // fixed #frame-no
@@ -4205,7 +4206,7 @@ static int hair_needs_recalc(ParticleSystem *psys)
/* main particle update call, checks that things are ok on the large scale and
* then advances in to actual particle calculations depending on particle type */
-void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys, const bool use_render_params)
+void particle_system_update(Main *bmain, Scene *scene, Object *ob, ParticleSystem *psys, const bool use_render_params)
{
ParticleSimulationData sim= {0};
ParticleSettings *part = psys->part;
@@ -4301,7 +4302,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys, cons
}
case PART_FLUID:
{
- particles_fluid_step(&sim, (int)cfra, use_render_params);
+ particles_fluid_step(bmain, &sim, (int)cfra, use_render_params);
break;
}
default: