[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12513] trunk/blender/source/blender/ python/api2_2x/Scene.c: =Python API bugfix=

Joseph Eagar joeedh at gmail.com
Wed Nov 7 19:52:24 CET 2007


Revision: 12513
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12513
Author:   joeedh
Date:     2007-11-07 19:52:23 +0100 (Wed, 07 Nov 2007)

Log Message:
-----------
=Python API bugfix=

Scene.update(full=1) was pretty useless as it didn't actually evaluate the
depsgraph DAG.  This meant, for example, that re-evaluating the parenting
tree for an armature pose could only be done by redrawing the view (which
evaluates the depsgraph). scene_update_for_newframe() is now called when Scene.update is in "full" mode; to prevent firing off newframe scriptlink events, scriptlinks are
temporarily disabled while scene_update_for_newframe() is being called.

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Scene.c

Modified: trunk/blender/source/blender/python/api2_2x/Scene.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Scene.c	2007-11-07 17:09:26 UTC (rev 12512)
+++ trunk/blender/source/blender/python/api2_2x/Scene.c	2007-11-07 18:52:23 UTC (rev 12513)
@@ -805,10 +805,18 @@
 	if( !full )
 		DAG_scene_sort( scene );
 
-	else if( full == 1 )
+	else if( full == 1 ) {
+		int enablescripts = G.f & G_DOSCRIPTLINKS;
+		
+		/*Disable scriptlinks to prevent firing off newframe scriptlink
+		  events.*/
+		G.f &= ~G_DOSCRIPTLINKS;
 		set_scene_bg( scene );
-
-	else
+		scene_update_for_newframe( scene, scene->lay );
+		
+		/*re-enabled scriptlinks if necassary.*/
+		if (enablescripts) G.f |= G_DOSCRIPTLINKS;
+	} else
 		return EXPP_ReturnPyObjError( PyExc_ValueError,
 					      "in method scene.update(full), full should be:\n"
 					      "0: to only sort scene elements (old behavior); or\n"





More information about the Bf-blender-cvs mailing list