diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-12 18:57:24 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-12 18:57:24 +0300 |
commit | 27882024176a3015e36305d19a763571e1a8c731 (patch) | |
tree | 29464f9cdeed9828c5c5f3de497e00fea25a3bb8 /source/blender/blenkernel | |
parent | f27ecd56ef1a2d7f7464bbafb8f3625729a355e3 (diff) |
Cleanup: moar G.main removal from BKE area.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_anim.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h index 902331f4649..05717e3c8af 100644 --- a/source/blender/blenkernel/BKE_anim.h +++ b/source/blender/blenkernel/BKE_anim.h @@ -54,7 +54,7 @@ void animviz_free_motionpath(struct bMotionPath *mpath); struct bMotionPath *animviz_verify_motionpaths(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan); void animviz_get_object_motionpaths(struct Object *ob, ListBase *targets); -void animviz_calc_motionpaths(struct Scene *scene, ListBase *targets); +void animviz_calc_motionpaths(struct Main *bmain, struct Scene *scene, ListBase *targets); /* ---------------------------------------------------- */ /* Curve Paths */ diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index a09065f8b5d..84a8a5d6e29 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -281,7 +281,7 @@ void animviz_get_object_motionpaths(Object *ob, ListBase *targets) */ /* tweak the object ordering to trick depsgraph into making MotionPath calculations run faster */ -static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets) +static void motionpaths_calc_optimise_depsgraph(Main *bmain, Scene *scene, ListBase *targets) { Base *base, *baseNext; MPathTarget *mpt; @@ -308,23 +308,23 @@ static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets) } /* "brew me a list that's sorted a bit faster now depsy" */ - DAG_scene_relations_rebuild(G.main, scene); + DAG_scene_relations_rebuild(bmain, scene); } /* update scene for current frame */ -static void motionpaths_calc_update_scene(Scene *scene) +static void motionpaths_calc_update_scene(Main *bmain, Scene *scene) { #if 1 // 'production' optimizations always on /* rigid body simulation needs complete update to work correctly for now */ /* RB_TODO investigate if we could avoid updating everything */ if (BKE_scene_check_rigidbody_active(scene)) { - BKE_scene_update_for_newframe(G.main->eval_ctx, G.main, scene, scene->lay); + BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene, scene->lay); } else { /* otherwise we can optimize by restricting updates */ Base *base, *last = NULL; /* only stuff that moves or needs display still */ - DAG_scene_update_flags(G.main, scene, scene->lay, true, false); + DAG_scene_update_flags(bmain, scene, scene->lay, true, false); /* find the last object with the tag * - all those afterwards are assumed to not be relevant for our calculations @@ -340,7 +340,7 @@ static void motionpaths_calc_update_scene(Scene *scene) * is animated but not attached to/updatable from objects */ for (base = scene->base.first; base; base = base->next) { /* update this object */ - BKE_object_handle_update(G.main, G.main->eval_ctx, scene, base->object); + BKE_object_handle_update(bmain, bmain->eval_ctx, scene, base->object); /* if this is the last one we need to update, let's stop to save some time */ if (base == last) @@ -353,7 +353,7 @@ static void motionpaths_calc_update_scene(Scene *scene) * that doesn't force complete update, but for now, this is the * most accurate way! */ - BKE_scene_update_for_newframe(G.main->eval_ctx, G.main, scene, scene->lay); /* XXX this is the best way we can get anything moving */ + BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene, scene->lay); /* XXX this is the best way we can get anything moving */ #endif } @@ -404,7 +404,7 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) * - recalc: whether we need to */ /* TODO: include reports pointer? */ -void animviz_calc_motionpaths(Scene *scene, ListBase *targets) +void animviz_calc_motionpaths(Main *bmain, Scene *scene, ListBase *targets) { MPathTarget *mpt; int sfra, efra; @@ -430,12 +430,12 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets) /* optimize the depsgraph for faster updates */ /* TODO: whether this is used should depend on some setting for the level of optimizations used */ - motionpaths_calc_optimise_depsgraph(scene, targets); + motionpaths_calc_optimise_depsgraph(bmain, scene, targets); /* calculate path over requested range */ for (CFRA = sfra; CFRA <= efra; CFRA++) { /* update relevant data for new frame */ - motionpaths_calc_update_scene(scene); + motionpaths_calc_update_scene(bmain, scene); /* perform baking for targets */ motionpaths_calc_bake_targets(scene, targets); @@ -443,7 +443,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets) /* reset original environment */ CFRA = cfra; - motionpaths_calc_update_scene(scene); + motionpaths_calc_update_scene(bmain, scene); /* clear recalc flags from targets */ for (mpt = targets->first; mpt; mpt = mpt->next) { |