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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-28 18:55:35 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-28 18:55:35 +0400
commit7baaa08211d91a721c7909c5f87f72bd22f12ad6 (patch)
tree861499e6f010813b1379ee64b8f02053f16b79ee /source/blender/blenkernel/intern
parent9f3c921957124d65aa0d2cbc4ad2aacb56411670 (diff)
Fix #29389: cycles viewport render not updating on frame changes. This sort of
worked by accident before, because of flags that weren't cleared properly. Now moved the call to update render engines into scene_update_* itself.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c36
-rw-r--r--source/blender/blenkernel/intern/scene.c15
2 files changed, 29 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index b1e39b1d768..4eaf49dc679 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -1636,17 +1636,25 @@ void graph_print_adj_list(void)
/* mechanism to allow editors to be informed of depsgraph updates,
to do their own updates based on changes... */
-static void (*EditorsUpdateCb)(Main *bmain, ID *id)= NULL;
+static void (*EditorsUpdateIDCb)(Main *bmain, ID *id)= NULL;
+static void (*EditorsUpdateSceneCb)(Main *bmain, Scene *scene, int updated)= NULL;
-void DAG_editors_update_cb(void (*func)(Main *bmain, ID *id))
+void DAG_editors_update_cb(void (*id_func)(Main *bmain, ID *id), void (*scene_func)(Main *bmain, Scene *scene, int updated))
{
- EditorsUpdateCb= func;
+ EditorsUpdateIDCb= id_func;
+ EditorsUpdateSceneCb= scene_func;
}
-static void dag_editors_update(Main *bmain, ID *id)
+static void dag_editors_id_update(Main *bmain, ID *id)
{
- if(EditorsUpdateCb)
- EditorsUpdateCb(bmain, id);
+ if(EditorsUpdateIDCb)
+ EditorsUpdateIDCb(bmain, id);
+}
+
+static void dag_editors_scene_update(Main *bmain, Scene *scene, int updated)
+{
+ if(EditorsUpdateSceneCb)
+ EditorsUpdateSceneCb(bmain, scene, updated);
}
/* groups with objects in this scene need to be put in the right order as well */
@@ -2460,7 +2468,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
/* no point in trying in this cases */
if(id && id->us <= 1) {
- dag_editors_update(bmain, id);
+ dag_editors_id_update(bmain, id);
id= NULL;
}
}
@@ -2572,7 +2580,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
}
/* update editors */
- dag_editors_update(bmain, id);
+ dag_editors_id_update(bmain, id);
}
}
@@ -2612,10 +2620,10 @@ void DAG_ids_flush_tagged(Main *bmain)
DAG_scene_flush_update(bmain, sce, lay, 0);
}
-void DAG_ids_check_recalc(Main *bmain)
+void DAG_ids_check_recalc(Main *bmain, Scene *scene, int time)
{
ListBase *lbarray[MAX_LIBARRAY];
- int a;
+ int a, updated = 0;
/* loop over all ID types */
a = set_listbasepointers(bmain, lbarray);
@@ -2627,13 +2635,13 @@ void DAG_ids_check_recalc(Main *bmain)
/* we tag based on first ID type character to avoid
looping over all ID's in case there are no tags */
if(id && bmain->id_tag_update[id->name[0]]) {
- /* do editors update */
- dag_editors_update(bmain, NULL);
- return;
+ updated= 1;
+ break;
}
}
-}
+ dag_editors_scene_update(bmain, scene, (updated || time));
+}
void DAG_ids_clear_recalc(Main *bmain)
{
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index b7aa02b2f7b..c284ed02868 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1028,15 +1028,11 @@ void scene_update_tagged(Main *bmain, Scene *scene)
if (scene->physics_settings.quick_cache_step)
BKE_ptcache_quick_cache_all(bmain, scene);
- /* notify editors about recalc */
- DAG_ids_check_recalc(bmain);
-
- /* keep this last */
+ /* notify editors and python about recalc */
BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST);
-}
+ DAG_ids_check_recalc(bmain, scene, FALSE);
-void scene_clear_tagged(Main *bmain, Scene *UNUSED(scene))
-{
+ /* clear recalc flags */
DAG_ids_clear_recalc(bmain);
}
@@ -1081,10 +1077,13 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
/* object_handle_update() on all objects, groups and sets */
scene_update_tagged_recursive(bmain, sce, sce);
- /* keep this last */
+ /* notify editors and python about recalc */
BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST);
BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_POST);
+ DAG_ids_check_recalc(bmain, sce, TRUE);
+
+ /* clear recalc flags */
DAG_ids_clear_recalc(bmain);
}