Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-05-30 14:28:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-30 14:31:42 +0300
commitdc0c490b7601b4dced13be6a9877f68ee9712736 (patch)
treeec670738f2a0481bccc8f691c5ffccd23d11573a
parent2991713722465c7f0fdbf61214fb20a07fa964a7 (diff)
Tool System: Use circle cursor for non-3D circle select
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 20bba30bb08..240d17b4816 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1192,6 +1192,13 @@ class _defs_image_uv_select:
row.use_property_split = False
row.prop(props, "mode", text="", expand=True, icon_only=True)
layout.prop(props, "radius")
+
+ def draw_cursor(_context, tool, xy):
+ from gpu_extras.presets import draw_circle_2d
+ props = tool.operator_properties("uv.select_circle")
+ radius = props.radius
+ draw_circle_2d(xy, (1.0,) * 4, radius, 32)
+
return dict(
idname="builtin.select_circle",
label="Select Circle",
@@ -1199,6 +1206,7 @@ class _defs_image_uv_select:
widget=None,
keymap=(),
draw_settings=draw_settings,
+ draw_cursor=draw_cursor,
)
@@ -1385,6 +1393,13 @@ class _defs_gpencil_edit:
row.prop(props, "mode", text="", expand=True, icon_only=True)
layout.prop(props, "radius")
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
+
+ def draw_cursor(_context, tool, xy):
+ from gpu_extras.presets import draw_circle_2d
+ props = tool.operator_properties("gpencil.select_circle")
+ radius = props.radius
+ draw_circle_2d(xy, (1.0,) * 4, radius, 32)
+
return dict(
idname="builtin.select_circle",
label="Select Circle",
@@ -1392,6 +1407,7 @@ class _defs_gpencil_edit:
widget=None,
keymap=(),
draw_settings=draw_settings,
+ draw_cursor=draw_cursor,
)
@ToolDef.from_fn
@@ -1522,6 +1538,13 @@ class _defs_node_select:
row.use_property_split = False
row.prop(props, "mode", text="", expand=True, icon_only=True)
layout.prop(props, "radius")
+
+ def draw_cursor(_context, tool, xy):
+ from gpu_extras.presets import draw_circle_2d
+ props = tool.operator_properties("node.select_circle")
+ radius = props.radius
+ draw_circle_2d(xy, (1.0,) * 4, radius, 32)
+
return dict(
idname="builtin.select_circle",
label="Select Circle",
@@ -1529,6 +1552,7 @@ class _defs_node_select:
widget=None,
keymap="Node Tool: Select Circle",
draw_settings=draw_settings,
+ draw_cursor=draw_cursor,
)