Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2007-11-07 21:52:23 +0300
committerJoseph Eagar <joeedh@gmail.com>2007-11-07 21:52:23 +0300
commitb4ec6efb41bbf05c6811da9276e7697939ed3ee1 (patch)
tree84f130679d4e3a99d0c918f1f414c8af7ea63587 /source/blender/python/api2_2x/Scene.c
parent50e5c9d1c2a4d40c43e96b5d68165d712742efd8 (diff)
=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.
Diffstat (limited to 'source/blender/python/api2_2x/Scene.c')
-rw-r--r--source/blender/python/api2_2x/Scene.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c
index 62b3a44690b..05768a1daf3 100644
--- a/source/blender/python/api2_2x/Scene.c
+++ b/source/blender/python/api2_2x/Scene.c
@@ -805,10 +805,18 @@ static PyObject *Scene_update( BPy_Scene * self, PyObject * args )
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"