[Bf-blender-cvs] [95ccaed9e65] blender2.8: Depsgraph: Use explicit graph API in transform code

Sergey Sharybin noreply at git.blender.org
Fri Nov 3 15:01:05 CET 2017


Commit: 95ccaed9e652f20a97d0a4d63ac3c9825944c897
Author: Sergey Sharybin
Date:   Fri Nov 3 14:05:49 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB95ccaed9e652f20a97d0a4d63ac3c9825944c897

Depsgraph: Use explicit graph API in transform code

===================================================================

M	source/blender/editors/transform/transform_conversions.c

===================================================================

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 */



More information about the Bf-blender-cvs mailing list