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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-07-23 00:09:20 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-08-02 18:11:58 +0300
commit1062649b5e686a128c27552f40a912d1ab28e55d (patch)
treed8016c853b9902c2a45a1376256304bacb57d867 /source/blender/editors
parent3ff5d8f719f592c2ea17533532708e883a8baa96 (diff)
Fix T87041: Driver Editor not updated in realtime
Caused by {rBbbb2e0614fc3} Since above commit only the playhead is updated as an overlay in animation playback (was moved out of drawing of the main region for perfomance reasons). The driver value "debug" visualization is very useful to have during playback though but was left in main region drawing as part of `draw_fcurve` (thus does not update in realtime anymore). Moving `graph_draw_driver_debug` into the overlay is not feasible because it requires animation filtering which has significant overhead which needs to be avoided in the overlay which is redrawn on every UI interaction. Now tag the whole main region for updates in the Driver Editor during playback instead (which will make the Drivers Editor as slow during playback as before rBbbb2e0614fc3 -- but with realtime updates of the debug visualization). Maniphest Tasks: T87041 Differential Revision: https://developer.blender.org/D12003
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/screen/screen_ops.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 9534be3509b..f172e22ea56 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4488,10 +4488,8 @@ static bool match_region_with_redraws(const ScrArea *area,
return false;
}
-static void screen_animation_region_tag_redraw(ScrArea *area,
- ARegion *region,
- const Scene *scene,
- eScreen_Redraws_Flag redraws)
+static void screen_animation_region_tag_redraw(
+ bContext *C, ScrArea *area, ARegion *region, const Scene *scene, eScreen_Redraws_Flag redraws)
{
/* Do follow time here if editor type supports it */
if ((redraws & TIME_FOLLOW) &&
@@ -4515,10 +4513,29 @@ static void screen_animation_region_tag_redraw(ScrArea *area,
* We do need to redraw when this area is in full screen as no other areas
* will be tagged for redrawing. */
if (region->regiontype == RGN_TYPE_WINDOW && !area->full) {
- if (ELEM(area->spacetype, SPACE_GRAPH, SPACE_NLA, SPACE_ACTION)) {
+ if (ELEM(area->spacetype, SPACE_NLA, SPACE_ACTION)) {
return;
}
+ /* Drivers Editor needs a full redraw on playback for graph_draw_driver_debug().
+ * This will make it slower than regular graph editor during playback, but drawing this in
+ * graph_main_region_draw_overlay() is not feasible because it requires animation filtering
+ * which has significant overhead which needs to be avoided in the overlay which is redrawn on
+ * every UI interaction. */
+ if (area->spacetype == SPACE_GRAPH) {
+ const SpaceGraph *sipo = area->spacedata.first;
+ if (sipo->mode != SIPO_MODE_DRIVERS) {
+ return;
+ }
+ bAnimContext ac;
+ if (ANIM_animdata_get_context(C, &ac) == false) {
+ return;
+ }
+ if (ac.datatype != ANIMCONT_DRIVERS) {
+ return;
+ }
+ }
+
if (area->spacetype == SPACE_SEQ) {
const SpaceSeq *sseq = area->spacedata.first;
if (!ED_space_sequencer_has_playback_animation(sseq, scene)) {
@@ -4712,7 +4729,7 @@ static int screen_animation_step_invoke(bContext *C, wmOperator *UNUSED(op), con
}
if (redraw) {
- screen_animation_region_tag_redraw(area, region, scene, sad->redraws);
+ screen_animation_region_tag_redraw(C, area, region, scene, sad->redraws);
}
}
}