[Bf-blender-cvs] [72eb4aff7bc] tracking_tools: Attempt to migrate Movie Clip Editor to new tool system

Sebastian Koenig noreply at git.blender.org
Tue Jul 13 17:53:40 CEST 2021


Commit: 72eb4aff7bc7ed0ef11b563943b61c8d9b8da5f7
Author: Sebastian Koenig
Date:   Tue Jul 13 17:27:08 2021 +0200
Branches: tracking_tools
https://developer.blender.org/rB72eb4aff7bc7ed0ef11b563943b61c8d9b8da5f7

Attempt to migrate Movie Clip Editor to new tool system

Here's my monkey-code like attempt to migrate the current clip editor to the tool system we use in the rest of Blender.
I am trying to implement what is suggested here: https://developer.blender.org/T83612
It's a work in progress, but some things are working already.

{F9602862}
{F9602876}

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

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

M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib
M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/startup/bl_ui/space_clip.py
M	release/scripts/startup/bl_ui/space_toolsystem_common.py
M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/editors/space_clip/clip_intern.h
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_clip/tracking_select.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_workspace.c
M	source/blender/windowmanager/WM_toolsystem.h
M	source/blender/windowmanager/intern/wm_toolsystem.c
M	source/tools

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

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 4833954c0ac..5ab29b1331d 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 4833954c0ac85cc407e1d5a153aa11b1d1823ec0
+Subproject commit 5ab29b1331d2103dae634b987f121c4599459d7f
diff --git a/release/scripts/addons b/release/scripts/addons
index f86f25e6221..26c4357e0bf 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit f86f25e62217264495d05f116ccb09d575fe9841
+Subproject commit 26c4357e0bfaf2b9f148efdeab18b6447fd565d9
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 5a82baad9f9..8970953d4a8 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 5a82baad9f986722104280e8354a4427d8e9eab1
+Subproject commit 8970953d4a8a4ea3bf77c66370c817ed0cf1308a
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 0af7493ed47..b7d667711ed 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -1381,8 +1381,8 @@ def km_mask_editing(params):
         op_menu("MASK_MT_add", {"type": 'A', "value": 'PRESS', "shift": True}),
         *_template_items_proportional_editing(
             params, connected=False, toggle_data_path='tool_settings.use_proportional_edit_mask'),
-        ("mask.add_vertex_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
-        ("mask.add_feather_vertex_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None),
+        # ("mask.add_vertex_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
+        # ("mask.add_feather_vertex_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None),
         ("mask.delete", {"type": 'X', "value": 'PRESS'}, None),
         ("mask.delete", {"type": 'DEL', "value": 'PRESS'}, None),
         ("mask.select", {"type": params.select_mouse, "value": 'PRESS', "shift": True},
@@ -1409,8 +1409,8 @@ def km_mask_editing(params):
         ("clip.select", {"type": params.select_mouse, "value": 'PRESS', "ctrl": True},
          {"properties": [("extend", False)]}),
         ("mask.cyclic_toggle", {"type": 'C', "value": 'PRESS', "alt": True}, None),
-        ("mask.slide_point", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
-        ("mask.slide_spline_curvature", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+        # ("mask.slide_point", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+        # ("mask.slide_spline_curvature", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
         ("mask.handle_type_set", {"type": 'V', "value": 'PRESS'}, None),
         ("mask.normals_make_consistent", {"type": 'N', "value": 'PRESS', "ctrl" if params.legacy else "shift": True}, None),
         ("mask.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None),
@@ -2876,17 +2876,17 @@ def km_clip_editor(params):
         ("clip.select", {"type": params.select_mouse, "value": 'PRESS', "shift": True},
          {"properties": [("extend", True)]}),
         *_template_items_select_actions(params, "clip.select_all"),
-        ("clip.select_box", {"type": 'B', "value": 'PRESS'}, None),
-        ("clip.select_circle", {"type": 'C', "value": 'PRESS'}, None),
-        op_menu("CLIP_MT_select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}),
-        ("clip.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True},
-         {"properties": [("mode", 'ADD')]}),
-        ("clip.select_lasso", {"type": params.action_tweak, "value": 'ANY', "shift": True, "ctrl": True, "alt": True},
-         {"properties": [("mode", 'SUB')]}),
-        ("clip.add_marker_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
+        # ("clip.select_box", {"type": 'B', "value": 'PRESS'}, None),
+        # ("clip.select_circle", {"type": 'C', "value": 'PRESS'}, None),
+        # op_menu("CLIP_MT_select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}),
+        # ("clip.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True},
+         # {"properties": [("mode", 'ADD')]}),
+        # ("clip.select_lasso", {"type": params.action_tweak, "value": 'ANY', "shift": True, "ctrl": True, "alt": True},
+         # {"properties": [("mode", 'SUB')]}),
+        # ("clip.add_marker_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
         ("clip.delete_marker", {"type": 'X', "value": 'PRESS', "shift": True}, None),
         ("clip.delete_marker", {"type": 'DEL', "value": 'PRESS', "shift": True}, None),
-        ("clip.slide_marker", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+        # ("clip.slide_marker", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
         ("clip.disable_markers", {"type": 'D', "value": 'PRESS', "shift": True},
          {"properties": [("action", 'TOGGLE')]}),
         ("clip.delete_track", {"type": 'X', "value": 'PRESS'}, None),
@@ -5942,6 +5942,144 @@ def km_image_editor_tool_uv_scale(params):
     )
 
 
+def km_clip_editor_tool_select(params):
+    return (
+        "Clip Editor: Tweak",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": [
+            ("clip.select", {"type": params.select_mouse, "value": 'PRESS'},
+             {"properties": [("extend", False), ("deselect_all", not params.legacy)]}),
+        ]},
+    )
+
+
+def km_clip_editor_tool_select_box(params):
+    return (
+        "Clip Editor: Select Box",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": _template_items_tool_select_actions_simple(
+            "clip.select_box", type=params.tool_tweak, value='ANY',
+        )},
+    )
+
+def km_clip_editor_tool_select_lasso(params):
+    return (
+        "Clip Editor: Select Lasso",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": _template_items_tool_select_actions_simple(
+            "clip.select_lasso", type=params.tool_mouse, value='PRESS',
+        )},
+    )
+
+def km_clip_editor_tool_select_circle(params):
+    return (
+        "Clip Editor: Select Circle",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": _template_items_tool_select_actions_simple(
+            "clip.select_circle", type=params.tool_mouse, value='PRESS',
+            properties=[("wait_for_input", False)],
+        )},
+    )
+
+def km_clip_editor_tool_add_marker_tweak(params):
+    return (
+        "Clip Editor: Add Marker and Tweak",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": [
+            ("clip.select", {"type": params.select_mouse, "value": 'PRESS'},
+             {"properties": [("extend", False), ("deselect_all", not params.legacy)]}),
+            ("clip.select", {"type": params.select_mouse, "value": 'PRESS', "shift": True},
+             {"properties": [("extend", True)]}),
+            ("clip.add_marker_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
+            ("clip.slide_marker", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+            ("clip.slide_plane_marker", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'}, None),
+        ]},
+    )
+
+def km_clip_editor_tool_add_marker_slide(params):
+    return (
+        "Clip Editor: Add Marker and Slide",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": [
+            # ("clip.select", {"type": params.select_mouse, "value": 'PRESS'},
+             # {"properties": [("extend", False), ("deselect_all", not params.legacy)]}),
+            # ("clip.select", {"type": params.select_mouse, "value": 'PRESS', "shift": True},
+             # {"properties": [("extend", True)]}),
+            ("clip.add_marker_slide", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+            ("clip.slide_marker", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+            ("clip.slide_plane_marker", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'}, None),
+        ]},
+    )
+
+def km_clip_editor_tool_mask_select(params):
+    return (
+        "Mask Editing: Tweak",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": [
+            ("mask.select", {"type": params.select_mouse, "value": 'PRESS'},
+             {"properties": [("extend", False), ("deselect_all", not params.legacy)]}),
+        ]},
+    )
+
+
+def km_clip_editor_tool_mask_select_box(params):
+    return (
+        "Mask Editing: Select Box",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": _template_items_tool_select_actions_simple(
+            "mask.select_box", type=params.tool_tweak, value='ANY',
+        )},
+    )
+
+def km_clip_editor_tool_mask_select_lasso(params):
+    return (
+        "Mask Editing: Select Lasso",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": _template_items_tool_select_actions_simple(
+            "mask.select_lasso", type=params.tool_mouse, value='PRESS',
+        )},
+    )
+
+def km_clip_editor_tool_mask_select_circle(params):
+    return (
+        "Mask Editing: Select Circle",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": _template_items_tool_select_actions_simple(
+            "mask.select_circle", type=params.tool_mouse, value='PRESS',
+            properties=[("wait_for_input", False)],
+        )},
+    )
+def km_clip_editor_tool_mask_add_vertex(params):
+    return (
+        "Mask Editing: Add Vertex and Slide",
+        {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'},
+        {"items": [
+            ("mask.add_vertex_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
+            ("mask.slide_point", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+            ("mask.slide_spline_curvature", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+        ]},
+    )
+
+def km_clip_editor_tool_mask_delete_vertex(params):
+    return (
+        "Mask Editing: Delete",
+        {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list