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:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-11-03 16:05:49 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-11-03 16:05:49 +0300
commit95ccaed9e652f20a97d0a4d63ac3c9825944c897 (patch)
treed5fdbc0a6eb86e71ee7500acc56e6c6d7c23094c /source/blender/editors/transform
parent57ec2156770a87c1a8f7b4b60e29ce4fa4cd4454 (diff)
Depsgraph: Use explicit graph API in transform code
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform_conversions.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 7a41272332f..852c2b1941c 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -5536,7 +5536,11 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
/* it deselects Bases, so we have to call the clear function always after */
static void set_trans_object_base_flags(TransInfo *t)
{
+ /* TODO(sergey): Get rid of global, use explicit main. */
+ Main *bmain = G.main;
SceneLayer *sl = t->scene_layer;
+ Scene *scene = t->scene;
+ Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, sl);
/*
* if Base selected and has parent selected:
@@ -5552,7 +5556,7 @@ static void set_trans_object_base_flags(TransInfo *t)
BKE_scene_base_flag_to_objects(t->scene_layer);
/* Make sure depsgraph is here. */
- DEG_scene_relations_update(G.main, t->scene);
+ DEG_graph_relations_update(depsgraph, bmain, scene);
/* handle pending update events, otherwise they got copied below */
EvaluationContext eval_ctx;
@@ -5603,7 +5607,7 @@ static void set_trans_object_base_flags(TransInfo *t)
}
/* all recalc flags get flushed to all layers, so a layer flip later on works fine */
- DEG_graph_flush_update(G.main, t->scene->depsgraph_legacy);
+ DEG_graph_flush_update(bmain, depsgraph);
/* and we store them temporal in base (only used for transform code) */
/* this because after doing updates, the object->recalc is cleared */
@@ -5633,7 +5637,11 @@ static bool mark_children(Object *ob)
static int count_proportional_objects(TransInfo *t)
{
int total = 0;
+ /* TODO(sergey): Get rid of global, use explicit main. */
+ Main *bmain = G.main;
SceneLayer *sl = t->scene_layer;
+ Scene *scene = t->scene;
+ Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, sl);
Base *base;
/* rotations around local centers are allowed to propagate, so we take all objects */
@@ -5682,8 +5690,8 @@ static int count_proportional_objects(TransInfo *t)
/* all recalc flags get flushed to all layers, so a layer flip later on works fine */
- DEG_scene_relations_update(G.main, t->scene);
- DEG_graph_flush_update(G.main, t->scene->depsgraph_legacy);
+ DEG_graph_relations_update(depsgraph, bmain, scene);
+ DEG_graph_flush_update(bmain, depsgraph);
/* and we store them temporal in base (only used for transform code) */
/* this because after doing updates, the object->recalc is cleared */