[Bf-blender-cvs] [b9c2f8f3c89] master: UI: Fix preview frame range drawing in sequencer and driver editors

Alessio Monti di Sopra noreply at git.blender.org
Sun Nov 3 06:56:40 CET 2019


Commit: b9c2f8f3c89c3386e50cfcfc95c17ff6366222bb
Author: Alessio Monti di Sopra
Date:   Sat Nov 2 22:34:44 2019 -0700
Branches: master
https://developer.blender.org/rBb9c2f8f3c89c3386e50cfcfc95c17ff6366222bb

UI: Fix preview frame range drawing in sequencer and driver editors

Draw preview range overlay in the video sequencer in the same way as in the other animation editors
Add color control in the theme.
Prevent overlay to be drawn in the driver editor.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D6074

===================================================================

M	release/datafiles/userdef/userdef_default_theme.c
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/space_graph/space_graph.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index 0b9e8beccc1..8fb2237c9aa 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -634,6 +634,7 @@ const bTheme U_theme_default = {
     .text_strip = RGBA(0xa29700ff),
     .gp_vertex_size = 3,
     .gp_vertex_select = RGBA(0xff8500ff),
+    .anim_preview_range = RGBA(0xa14d0066),
     .metadatatext = RGBA(0xffffffff),
   },
   .space_image = {
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 53a6b8b08cd..e8783f68bcb 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -160,6 +160,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
    * Include next version bump.
    */
   {
+    FROM_DEFAULT_V4_UCHAR(space_sequencer.anim_preview_range);
   }
 
 #undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 91e5ab61dd9..95ad56a35e6 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -303,8 +303,10 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
   }
 
   /* preview range */
-  UI_view2d_view_ortho(v2d);
-  ANIM_draw_previewrange(C, v2d, 0);
+  if (sipo->mode != SIPO_MODE_DRIVERS) {
+    UI_view2d_view_ortho(v2d);
+    ANIM_draw_previewrange(C, v2d, 0);
+  }
 
   /* callback */
   UI_view2d_view_ortho(v2d);
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 1a788237e6e..5b2ea9d4793 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1767,8 +1767,8 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
 static void seq_draw_sfra_efra(Scene *scene, View2D *v2d)
 {
   const Editing *ed = BKE_sequencer_editing_get(scene, false);
-  const int frame_sta = PSFRA;
-  const int frame_end = PEFRA + 1;
+  const int frame_sta = scene->r.sfra;
+  const int frame_end = scene->r.efra + 1;
 
   GPU_blend(true);
 
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 3df678358d8..9ecfc7f675f 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2979,6 +2979,12 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
   RNA_def_property_array(prop, 3);
   RNA_def_property_ui_text(prop, "Metadata Text", "");
   RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
+  prop = RNA_def_property(srna, "preview_range", PROP_FLOAT, PROP_COLOR_GAMMA);
+  RNA_def_property_float_sdna(prop, NULL, "anim_preview_range");
+  RNA_def_property_array(prop, 4);
+  RNA_def_property_ui_text(prop, "Preview Range", "Color of preview range overlay");
+  RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
 }
 
 static void rna_def_userdef_theme_space_action(BlenderRNA *brna)



More information about the Bf-blender-cvs mailing list