[Bf-blender-cvs] [a737966] alembic_basic_io: Avoid updating the whole scene when updating cache file dependencies.

Kévin Dietrich noreply at git.blender.org
Wed Jul 20 20:02:34 CEST 2016


Commit: a737966a4436d873cc816e6146b6790c81eb3317
Author: Kévin Dietrich
Date:   Wed Jul 20 19:45:10 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBa737966a4436d873cc816e6146b6790c81eb3317

Avoid updating the whole scene when updating cache file dependencies.

This is only effective when enabling the new dependency graph, for the
old depsgraph, we still update the whole scene.

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

M	source/blender/makesrna/intern/rna_cachefile.c

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

diff --git a/source/blender/makesrna/intern/rna_cachefile.c b/source/blender/makesrna/intern/rna_cachefile.c
index 703e3d0..9b4ae59 100644
--- a/source/blender/makesrna/intern/rna_cachefile.c
+++ b/source/blender/makesrna/intern/rna_cachefile.c
@@ -37,6 +37,8 @@
 #include "BKE_cachefile.h"
 #include "BKE_depsgraph.h"
 
+#include "DEG_depsgraph.h"
+
 #include "WM_api.h"
 #include "WM_types.h"
 
@@ -48,8 +50,16 @@ static void rna_CacheFile_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
 	CacheFile *cache_file = (CacheFile *)ptr->data;
 
-	DAG_id_tag_update(&cache_file->id, 0);
-	WM_main_add_notifier(NC_SCENE | ND_FRAME, scene);
+	if (!DEG_depsgraph_use_legacy()) {
+		DAG_id_tag_update(&cache_file->id, 0);
+		/* XXX - how to tag the whole scene for redraw?
+		 * (NC_OBJECT | ND_DRAW, scene) doesn't seem to work. */
+		WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
+	}
+	else {
+		/* TODO(kevin): implement in old dependency graph. */
+		WM_main_add_notifier(NC_SCENE | ND_FRAME, scene);
+	}
 
 	UNUSED_VARS(bmain);
 }




More information about the Bf-blender-cvs mailing list