[Bf-blender-cvs] [4cb78cd] depsgraph_refactor: Automatically rebuild the new depsgraph in Scene alongside the old one.

Lukas Tönne noreply at git.blender.org
Thu May 22 15:22:17 CEST 2014


Commit: 4cb78cde0e15ea6d0501b939032bb3cf7a8ae21e
Author: Lukas Tönne
Date:   Thu May 22 15:10:39 2014 +0200
https://developer.blender.org/rB4cb78cde0e15ea6d0501b939032bb3cf7a8ae21e

Automatically rebuild the new depsgraph in Scene alongside the old one.

This may later get deprecated, e.g. by moving depsgraph outside of Scene,
but for now this is easiest to use.

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

M	source/blender/blenkernel/intern/depsgraph.c

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

diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 2e86629..8ca0225 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -891,6 +891,12 @@ DagForest *build_dag(Main *bmain, Scene *sce, short mask)
 	DagForest *dag;
 	DagAdjList *itA;
 
+	/********* new depsgraph *********/
+	if (sce->depsgraph)
+		DEG_graph_free(sce->depsgraph);
+	sce->depsgraph = DEG_graph_new();
+	/******************/
+	
 	dag = sce->theDag;
 	if (dag)
 		free_forest(dag);
@@ -1368,6 +1374,13 @@ static void dag_scene_free(Scene *sce)
 		MEM_freeN(sce->theDag);
 		sce->theDag = NULL;
 	}
+	
+	/********* new depsgraph *********/
+	if (sce->depsgraph) {
+		DEG_graph_free(sce->depsgraph);
+		sce->depsgraph = NULL;
+	}
+	/******************/
 }
 
 /* Chech whether object data needs to be evaluated before it




More information about the Bf-blender-cvs mailing list