Tool System: add node circle select tool
authorCampbell Barton <ideasman42@gmail.com>
Tue, 5 Mar 2019 12:29:49 +0000 (23:29 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 5 Mar 2019 12:29:49 +0000 (23:29 +1100)
release/scripts/presets/keyconfig/keymap_data/blender_default.py
release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

index 8235a560f4dcafc97bc314442a97abdf1ac0dc13..79afdeaf296109cf16f6aaa7e2dc44bfb38c212b 100644 (file)
@@ -5189,6 +5189,12 @@ def km_node_editor_tool_select_lasso(params):
         ]},
     )
 
+def km_node_editor_tool_select_circle(params):
+    return (
+        "Node Tool: Select Circle",
+        {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'},
+        {"items": _template_items_tool_select_actions_circle("node.select_circle", type=params.tool_mouse, value='PRESS')},
+    )
 
 def km_node_editor_tool_links_cut(params):
     return (
@@ -6110,6 +6116,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_select_circle(params),
         km_node_editor_tool_links_cut(params),
         km_3d_view_tool_cursor(params),
         km_3d_view_tool_select(params),
index 7ed1a7a49b7b33290021b13f2af2ee0e4fdb75b4..d1d2cad2c1594ebf951500dd716eb4d4ec784e03 100644 (file)
@@ -1331,6 +1331,20 @@ class _defs_node_select:
             draw_settings=draw_settings,
         )
 
+    @ToolDef.from_fn
+    def circle():
+        def draw_settings(context, layout, tool):
+            props = tool.operator_properties("node.select_circle")
+            layout.prop(props, "mode", expand=True)
+            layout.prop(props, "radius")
+        return dict(
+            text="Select Circle",
+            icon="ops.generic.select_circle",
+            widget=None,
+            keymap="Node Tool: Select Circle",
+            draw_settings=draw_settings,
+        )
+
 
 class _defs_node_edit:
 
@@ -1455,6 +1469,7 @@ class NODE_PT_tools_active(ToolSelectPanelHelper, Panel):
             _defs_node_select.select,
             _defs_node_select.box,
             _defs_node_select.lasso,
+            _defs_node_select.circle,
         ),
     )