[Bf-blender-cvs] [b1d67e6aab0] blender2.8: Tool System: add node links cut tool

Campbell Barton noreply at git.blender.org
Wed Nov 28 07:43:44 CET 2018


Commit: b1d67e6aab084b2a24db44fb4d3b0b62c13db9a7
Author: Campbell Barton
Date:   Wed Nov 28 17:37:40 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBb1d67e6aab084b2a24db44fb4d3b0b62c13db9a7

Tool System: add node links cut tool

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

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

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

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 706eade89f1..904e38098e6 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -5090,6 +5090,18 @@ def km_node_editor_tool_select_lasso(params):
     )
 
 
+def km_node_editor_tool_links_cut(params):
+    return (
+        "Node Tool: Links Cut",
+        {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'},
+        {"items": (
+            ("node.links_cut", {"type": params.tool_mouse, "value": 'PRESS'}, None),
+        ),
+        },
+    )
+
+
+
 def km_3d_view_tool_object_cursor(params):
     return (
         "3D View Tool: Object, Cursor",
@@ -5945,6 +5957,7 @@ def generate_keymaps(params=None):
         km_node_editor_tool_select(params),
         km_node_editor_tool_select_box(params),
         km_node_editor_tool_select_lasso(params),
+        km_node_editor_tool_links_cut(params),
         km_3d_view_tool_object_cursor(params),
         km_3d_view_tool_object_select(params),
         km_3d_view_tool_object_select_box(params),
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index cefc900b8b3..2274069be41 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1207,6 +1207,18 @@ class _defs_node_select:
         )
 
 
+class _defs_node_edit:
+
+    @ToolDef.from_fn
+    def links_cut():
+        return dict(
+            text="Links Cut",
+            icon="ops.mesh.knife_tool",
+            widget=None,
+            keymap="Node Tool: Links Cut",
+        )
+
+
 class IMAGE_PT_tools_active(ToolSelectPanelHelper, Panel):
     bl_space_type = 'IMAGE_EDITOR'
     bl_region_type = 'TOOLS'
@@ -1335,6 +1347,8 @@ class NODE_PT_tools_active(ToolSelectPanelHelper, Panel):
             *_tools_select,
             None,
             *_tools_annotate,
+            None,
+            _defs_node_edit.links_cut,
         ],
     }



More information about the Bf-blender-cvs mailing list