diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 17:44:05 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 17:44:05 +0300 |
commit | da11e33b26b6579ef36c97de1b6fbc0eb02a0b69 (patch) | |
tree | da13c4b1971e26c0659c2dd218eeb6f42887178a /source/blender/blenkernel | |
parent | 16100f8261770e367b0892bb38c778699ed609fe (diff) |
Cleanup: remove G.main from BKE mball code.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_mball.h | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mball.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_convert.c | 2 |
5 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h index f02704ba903..c73dd7260c4 100644 --- a/source/blender/blenkernel/BKE_mball.h +++ b/source/blender/blenkernel/BKE_mball.h @@ -32,6 +32,7 @@ * \since March 2001 * \author nzc */ +struct EvaluationContext; struct Main; struct MetaBall; struct Object; @@ -48,12 +49,12 @@ void BKE_mball_make_local(struct Main *bmain, struct MetaBall *mb, const bool li bool BKE_mball_is_basis_for(struct Object *ob1, struct Object *ob2); bool BKE_mball_is_basis(struct Object *ob); -struct Object *BKE_mball_basis_find(struct Scene *scene, struct Object *ob); +struct Object *BKE_mball_basis_find(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob); void BKE_mball_texspace_calc(struct Object *ob); float *BKE_mball_make_orco(struct Object *ob, struct ListBase *dispbase); -void BKE_mball_properties_copy(struct Scene *scene, struct Object *active_object); +void BKE_mball_properties_copy(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *active_object); bool BKE_mball_minmax(struct MetaBall *mb, float min[3], float max[3]); bool BKE_mball_minmax_ex(struct MetaBall *mb, float min[3], float max[3], diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index c29dc6c9311..80275324da6 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -740,7 +740,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O } case OB_MBALL: { - Object *mom = BKE_mball_basis_find(scene, ob); + Object *mom = BKE_mball_basis_find(G.main->eval_ctx, scene, ob); if (mom != ob) { node2 = dag_get_node(dag, mom); diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 8433634f749..00e319efb7a 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -731,7 +731,7 @@ void BKE_displist_make_mball(EvaluationContext *eval_ctx, Scene *scene, Object * if (!ob || ob->type != OB_MBALL) return; - if (ob == BKE_mball_basis_find(scene, ob)) { + if (ob == BKE_mball_basis_find(eval_ctx, scene, ob)) { if (ob->curve_cache) { BKE_displist_free(&(ob->curve_cache->disp)); } diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index dfc49c996b1..3609fde7711 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -316,7 +316,7 @@ bool BKE_mball_is_basis_for(Object *ob1, Object *ob2) * are copied to all metaballs in same "group" (metaballs with same base name: MBall, * MBall.001, MBall.002, etc). The most important is to copy properties to the base metaball, * because this metaball influence polygonisation of metaballs. */ -void BKE_mball_properties_copy(Scene *scene, Object *active_object) +void BKE_mball_properties_copy(EvaluationContext *eval_ctx, Scene *scene, Object *active_object) { Scene *sce_iter = scene; Base *base; @@ -325,7 +325,6 @@ void BKE_mball_properties_copy(Scene *scene, Object *active_object) int basisnr, obnr; char basisname[MAX_ID_NAME], obname[MAX_ID_NAME]; SceneBaseIter iter; - EvaluationContext *eval_ctx = G.main->eval_ctx; BLI_split_name_num(basisname, &basisnr, active_object->id.name + 2, '.'); @@ -360,7 +359,7 @@ void BKE_mball_properties_copy(Scene *scene, Object *active_object) * * warning!, is_basis_mball() can fail on returned object, see long note above. */ -Object *BKE_mball_basis_find(Scene *scene, Object *basis) +Object *BKE_mball_basis_find(EvaluationContext *eval_ctx, Scene *scene, Object *basis) { Scene *sce_iter = scene; Base *base; @@ -368,7 +367,6 @@ Object *BKE_mball_basis_find(Scene *scene, Object *basis) int basisnr, obnr; char basisname[MAX_ID_NAME], obname[MAX_ID_NAME]; SceneBaseIter iter; - EvaluationContext *eval_ctx = G.main->eval_ctx; BLI_split_name_num(basisname, &basisnr, basis->id.name + 2, '.'); diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index 17071b6d7ea..81aeabd2f5c 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -876,7 +876,7 @@ Mesh *BKE_mesh_new_from_object( case OB_MBALL: { /* metaballs don't have modifiers, so just convert to mesh */ - Object *basis_ob = BKE_mball_basis_find(sce, ob); + Object *basis_ob = BKE_mball_basis_find(bmain->eval_ctx, sce, ob); /* todo, re-generatre for render-res */ /* metaball_polygonize(scene, ob) */ |