[Bf-blender-cvs] [f2b7582b27f] master: UI: Animation editor scrubbing area

Jacques Lucke noreply at git.blender.org
Tue May 7 15:20:50 CEST 2019


Commit: f2b7582b27fa1235a013b2d92af72428c0fc1623
Author: Jacques Lucke
Date:   Tue May 7 15:09:14 2019 +0200
Branches: master
https://developer.blender.org/rBf2b7582b27fa1235a013b2d92af72428c0fc1623

UI: Animation editor scrubbing area

The main reason for this change is to allow setting the
active frame with the left mouse button, while still being
able to select e.g. keyframes with the same mouse button.

The solution is to introduce a new scrubbing region with
a specialized keymap. There are a couple of related todos,
that will be handled in separate commits.
Those are listed in D4654.

This solves T63193.

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

Reviewers: brecht, billreynish

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

M	release/datafiles/userdef/userdef_default_theme.c
M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/startup/bl_ui/space_dopesheet.py
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/animation/CMakeLists.txt
M	source/blender/editors/animation/anim_channels_defines.c
M	source/blender/editors/animation/anim_channels_edit.c
A	source/blender/editors/animation/anim_scrubbing.c
M	source/blender/editors/include/ED_anim_api.h
M	source/blender/editors/include/ED_screen.h
A	source/blender/editors/include/ED_scrubbing.h
M	source/blender/editors/include/UI_resources.h
M	source/blender/editors/include/UI_view2d.h
M	source/blender/editors/interface/resources.c
M	source/blender/editors/interface/view2d.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/space_action/action_select.c
M	source/blender/editors/space_action/space_action.c
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_graph/space_graph.c
M	source/blender/editors/space_nla/nla_channels.c
M	source/blender/editors/space_nla/nla_draw.c
M	source/blender/editors/space_nla/nla_edit.c
M	source/blender/editors/space_nla/nla_select.c
M	source/blender/editors/space_nla/space_nla.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/editors/space_sequencer/space_sequencer.c
M	source/blender/makesdna/DNA_userdef_types.h
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 d1e2fa876d8..c93e4847c15 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -397,7 +397,7 @@ const bTheme U_theme_default = {
 	.space_graph = {
 		.back = RGBA(0x42424200),
 		.title = RGBA(0xffffffff),
-		.text = RGBA(0x000000ff),
+		.text = RGBA(0xa6a6a6ff),
 		.text_hi = RGBA(0xffffffff),
 		.header = RGBA(0x2e2e2eff),
 		.header_text = RGBA(0xeeeeeeff),
@@ -427,6 +427,7 @@ const bTheme U_theme_default = {
 		.vertex = RGBA(0x000000ff),
 		.vertex_select = RGBA(0xff8500ff),
 		.cframe = RGBA(0x5680c2ff),
+		.scrubbing_background = RGBA(0x29292999),
 		.lastsel_point = RGBA(0xffffffff),
 		.handle_auto = RGBA(0x909000ff),
 		.handle_vect = RGBA(0x409030ff),
@@ -482,7 +483,7 @@ const bTheme U_theme_default = {
 	.space_action = {
 		.back = RGBA(0x42424200),
 		.title = RGBA(0xeeeeeeff),
-		.text = RGBA(0x000000ff),
+		.text = RGBA(0xa6a6a6ff),
 		.text_hi = RGBA(0xffffffff),
 		.header = RGBA(0x424242ff),
 		.header_text = RGBA(0xeeeeeeff),
@@ -513,6 +514,7 @@ const bTheme U_theme_default = {
 		.strip = RGBA(0x1a151580),
 		.strip_select = RGBA(0xff8c00cc),
 		.cframe = RGBA(0x5680c2ff),
+		.scrubbing_background = RGBA(0x29292999),
 		.ds_channel = RGBA(0x0f2c4d24),
 		.ds_subchannel = RGBA(0x143e6624),
 		.ds_ipoline = RGBA(0x94e575cc),
@@ -539,7 +541,7 @@ const bTheme U_theme_default = {
 	.space_nla = {
 		.back = RGBA(0x42424200),
 		.title = RGBA(0xffffffff),
-		.text = RGBA(0x000000ff),
+		.text = RGBA(0xa6a6a6ff),
 		.text_hi = RGBA(0xffffffff),
 		.header = RGBA(0x424242ff),
 		.header_text = RGBA(0xeeeeeeff),
@@ -566,6 +568,7 @@ const bTheme U_theme_default = {
 		.strip = RGBA(0x0c0a0a80),
 		.strip_select = RGBA(0xff8c00ff),
 		.cframe = RGBA(0x5680c2ff),
+		.scrubbing_background = RGBA(0x29292999),
 		.ds_channel = RGBA(0x5a85b2ff),
 		.ds_subchannel = RGBA(0x7d98b3ff),
 		.keyborder = RGBA(0x000000ff),
@@ -589,7 +592,7 @@ const bTheme U_theme_default = {
 	.space_sequencer = {
 		.back = RGBA(0x42424200),
 		.title = RGBA(0xeeeeeeff),
-		.text = RGBA(0x000000ff),
+		.text = RGBA(0xa6a6a6ff),
 		.text_hi = RGBA(0xffffffff),
 		.header = RGBA(0x424242ff),
 		.header_text = RGBA(0xeeeeeeff),
@@ -612,6 +615,7 @@ const bTheme U_theme_default = {
 		.vertex_select = RGBA(0xff8500ff),
 		.bone_pose = RGBA(0x50c8ff50),
 		.cframe = RGBA(0x5680c2ff),
+		.scrubbing_background = RGBA(0x29292999),
 		.vertex_size = 3,
 		.outline_width = 1,
 		.facedot_size = 4,
@@ -861,7 +865,7 @@ const bTheme U_theme_default = {
 	.space_clip = {
 		.back = RGBA(0x42424200),
 		.title = RGBA(0xeeeeeeff),
-		.text = RGBA(0xe6e6e6ff),
+		.text = RGBA(0xa6a6a6ff),
 		.text_hi = RGBA(0xffffffff),
 		.header = RGBA(0x424242ff),
 		.header_text = RGBA(0xeeeeeeff),
@@ -885,6 +889,7 @@ const bTheme U_theme_default = {
 		.strip = RGBA(0x0c0a0a80),
 		.strip_select = RGBA(0xff8c00ff),
 		.cframe = RGBA(0x5680c2ff),
+		.scrubbing_background = RGBA(0x29292999),
 		.handle_auto = RGBA(0x909000ff),
 		.handle_align = RGBA(0x803060ff),
 		.handle_sel_auto = RGBA(0xf0ff40ff),
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 376e27ddae2..b0c5ec7cb93 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -1307,6 +1307,22 @@ def km_markers(params):
     return keymap
 
 
+def km_scrubbing(params):
+    items = []
+    keymap = (
+        "Scrubbing",
+        {"space_type": 'EMPTY', "region_type": 'WINDOW'},
+        {"items": items},
+    )
+
+    items.extend([
+        ("anim.change_frame", {"type": "LEFTMOUSE", "value": 'PRESS'}, None),
+        ("graph.cursor_set", {"type": "LEFTMOUSE", "value": 'PRESS'}, None),
+    ])
+
+    return keymap
+
+
 def km_graph_editor_generic(_params):
     items = []
     keymap = (
@@ -6105,6 +6121,7 @@ def generate_keymaps(params=None):
         km_view3d(params),
         km_mask_editing(params),
         km_markers(params),
+        km_scrubbing(params),
         km_graph_editor_generic(params),
         km_graph_editor(params),
         km_image_generic(params),
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 70d37c971a5..db69a99b9df 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -31,7 +31,7 @@ from bpy.types import (
 # used for DopeSheet, NLA, and Graph Editors
 
 
-def dopesheet_filter(layout, context, generic_filters_only=False):
+def dopesheet_filter(layout, context):
     dopesheet = context.space_data.dopesheet
     is_nla = context.area.type == 'NLA_EDITOR'
 
@@ -44,18 +44,6 @@ def dopesheet_filter(layout, context, generic_filters_only=False):
     else:  # graph and dopesheet editors - F-Curves and drivers only
         row.prop(dopesheet, "show_only_errors", text="")
 
-    if not generic_filters_only:
-        if bpy.data.collections:
-            row = layout.row(align=True)
-            row.prop(dopesheet, "filter_collection", text="")
-
-    if not is_nla:
-        row = layout.row(align=True)
-        row.prop(dopesheet, "filter_fcurve_name", text="")
-    else:
-        row = layout.row(align=True)
-        row.prop(dopesheet, "filter_text", text="")
-
 #######################################
 # Dopesheet Filtering Popovers
 
@@ -260,9 +248,7 @@ class DOPESHEET_HT_editor_buttons(Header):
         if st.mode == 'DOPESHEET':
             dopesheet_filter(layout, context)
         elif st.mode == 'ACTION':
-            # 'generic_filters_only' limits the options to only the relevant 'generic' subset of
-            # filters which will work here and are useful (especially for character animation)
-            dopesheet_filter(layout, context, generic_filters_only=True)
+            dopesheet_filter(layout, context)
         elif st.mode == 'GPENCIL':
             row = layout.row(align=True)
             row.prop(st.dopesheet, "show_gpencil_3d_only", text="Active Only")
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 46fd58e59c1..6638e8c98bc 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -120,6 +120,18 @@ static void do_versions_theme(UserDef *userdef, bTheme *btheme)
     if (btheme->space_view3d.obcenter_dia == 0) {
       btheme->space_view3d.obcenter_dia = U_theme_default.space_view3d.obcenter_dia;
     }
+
+    FROM_DEFAULT_V4_UCHAR(space_graph.text);
+    FROM_DEFAULT_V4_UCHAR(space_action.text);
+    FROM_DEFAULT_V4_UCHAR(space_nla.text);
+    FROM_DEFAULT_V4_UCHAR(space_sequencer.text);
+    FROM_DEFAULT_V4_UCHAR(space_clip.text);
+
+    FROM_DEFAULT_V4_UCHAR(space_graph.scrubbing_background);
+    FROM_DEFAULT_V4_UCHAR(space_action.scrubbing_background);
+    FROM_DEFAULT_V4_UCHAR(space_nla.scrubbing_background);
+    FROM_DEFAULT_V4_UCHAR(space_sequencer.scrubbing_background);
+    FROM_DEFAULT_V4_UCHAR(space_clip.scrubbing_background);
   }
 
 #undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/editors/animation/CMakeLists.txt b/source/blender/editors/animation/CMakeLists.txt
index 978bd772b6f..098c871823e 100644
--- a/source/blender/editors/animation/CMakeLists.txt
+++ b/source/blender/editors/animation/CMakeLists.txt
@@ -44,6 +44,7 @@ set(SRC
   anim_markers.c
   anim_motion_paths.c
   anim_ops.c
+  anim_scrubbing.c
   drivers.c
   fmodifier_ui.c
   keyframes_draw.c
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 6d1ee08d5e9..00025112835 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -485,16 +485,10 @@ static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float ymi
 static void acf_summary_name(bAnimListElem *UNUSED(ale), char *name)
 {
   if (name) {
-    BLI_strncpy(name, IFACE_("Dope Sheet Summary"), ANIM_CHAN_NAME_SIZE);
+    BLI_strncpy(name, IFACE_("Summary"), ANIM_CHAN_NAME_SIZE);
   }
 }
 
-// FIXME: this is really a temp icon I think
-static int acf_summary_icon(bAnimListElem *UNUSED(ale))
-{
-  return ICON_BORDERMOVE;
-}
-
 /* check if some setting exists for this channel */
 static bool acf_summary_setting_valid(bAnimContext *UNUSED(ac),
                                       bAnimListElem *UNUSED(ale),
@@ -557,7 +551,7 @@ static bAnimChannelType ACF_SUMMARY = {
 
     acf_summary_name, /* name */
     NULL,             /* name prop */
-    acf_summary_icon, /* icon */
+    NULL,             /* icon */
 
     acf_summary_setting_valid, /* has setting */
     acf_summary_setting_flag,  /* flag for setting */
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index adc6ec3f6be..9e09fc485a6 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -55,6 +55,7 @@
 #include "DEG_depsgraph_build.h"
 
 #include "UI_view2d.h"
+#include "UI_interface.h"
 
 #include "ED_anim_api.h"
 #include "ED_armature.h"
@@ -2542,7 +2543,7 @@ static void box_select_anim_channels(bAnimContext *ac, rcti *rect, short selectm
 
   float ymax;
   if (ac->datatype == ANIMCONT_NLA) {
-    ymax = NLACHANNEL_FIRST_TOP(snla);
+    ymax = NLACHANNEL_FIRST_TOP(ac);
   }
   else {
     ymax = ACHANNEL_FIRST_TOP(ac);
@@ -2735,7 +2736,7 @@ static int animchannels_channel_get(bAnimContext *ac, const int mval[2])
     UI_view2d_listview_view_to_cell(NLACHANNEL_NAMEWIDTH,
                                     NLACHANNEL_STEP(snla),
                                     0,
-                                    NLACHANNEL_FIRST_TOP(snla),
+                                    NLACHANNEL_FIRST_TOP(ac),
                                     x,
                                     y,
                                     NULL

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list