[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38059] branches/soc-2011-pepper/source/ blender/blenkernel/intern/depsgraph.c: Experimental depsgraph tweak:

Joshua Leung aligorith at gmail.com
Sun Jul 3 13:56:24 CEST 2011


Revision: 38059
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38059
Author:   aligorith
Date:     2011-07-03 11:56:24 +0000 (Sun, 03 Jul 2011)
Log Message:
-----------
Experimental depsgraph tweak:
Objects with drivers are now treated as needing updates when the
current frame changes. This assumption has been documented in the
code, and should at least mean that users who try to use drivers for
creating simple time-based expressions that this should work.

Note:
- It is still recommended to create a "cfra" driver variable instead
of actually inlining bpy.context.scene.frame_current into the
expressions. Not only does the latter look rather nasty to type/have
in the expression, but it is also less future-proof for when I get
around to actually working on a beefed-up depsgraph (nothing official
on that front yet...)

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/blenkernel/intern/depsgraph.c

Modified: branches/soc-2011-pepper/source/blender/blenkernel/intern/depsgraph.c
===================================================================
--- branches/soc-2011-pepper/source/blender/blenkernel/intern/depsgraph.c	2011-07-03 11:35:30 UTC (rev 38058)
+++ branches/soc-2011-pepper/source/blender/blenkernel/intern/depsgraph.c	2011-07-03 11:56:24 UTC (rev 38059)
@@ -2061,6 +2061,12 @@
 			return 1;
 	}
 	
+	/* experimental check: if we have drivers, more likely than not, on a frame change
+	 * they'll need updating because their owner changed
+	 */
+	if (adt->drivers.first)
+		return 1;
+	
 	return 0;
 }
 




More information about the Bf-blender-cvs mailing list