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:
authorCharlie Jolly <mistajolly@gmail.com>2018-12-03 17:55:57 +0300
committerCharlie Jolly <mistajolly@gmail.com>2018-12-04 01:11:38 +0300
commit2c19c9b2f646e2b28e3ad399380fe27971fe23d8 (patch)
treedeeb652385f3ce82e396853b70575c87e13f73bd /release
parentf0432e37ab06831167cf84c589fad7d5a28d54ef (diff)
GP: Draw Mode: Add Arc Primitive
This adds an elliptical arc primitive. Press CKEY for toggling closed/open arc. Press FKEY key for flipping arc. Additional changes to gpencil primitives. Increases default edges of circle to 64. Keymap changes to allow primitives to be drawn with Shift or Alt key. Allow Plus/Minus key to adjust number of edges. Missing: Toolbar icon Differential Revision: https://developer.blender.org/D4024
Diffstat (limited to 'release')
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/blender_default.py28
-rw-r--r--release/scripts/startup/bl_ui/properties_grease_pencil_common.py1
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py10
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py2
4 files changed, 40 insertions, 1 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index ddcd4242c4a..09fdd202932 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -5646,6 +5646,10 @@ def km_3d_view_tool_gpencil_paint_line(params):
{"items": [
("gpencil.primitive", {"type": params.tool_tweak, "value": 'ANY'},
{"properties": [("type", 'LINE'), ("wait_for_input", False)]}),
+ ("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
+ {"properties": [("type", 'LINE'), ("wait_for_input", False)]}),
+ ("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
+ {"properties": [("type", 'LINE'), ("wait_for_input", False)]}),
]},
)
@@ -5657,6 +5661,10 @@ def km_3d_view_tool_gpencil_paint_box(params):
{"items": [
("gpencil.primitive", {"type": params.tool_tweak, "value": 'ANY'},
{"properties": [("type", 'BOX'), ("wait_for_input", False)]}),
+ ("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
+ {"properties": [("type", 'BOX'), ("wait_for_input", False)]}),
+ ("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
+ {"properties": [("type", 'BOX'), ("wait_for_input", False)]}),
]},
)
@@ -5668,6 +5676,25 @@ def km_3d_view_tool_gpencil_paint_circle(params):
{"items": [
("gpencil.primitive", {"type": params.tool_tweak, "value": 'ANY'},
{"properties": [("type", 'CIRCLE'), ("wait_for_input", False)]}),
+ ("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
+ {"properties": [("type", 'CIRCLE'), ("wait_for_input", False)]}),
+ ("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
+ {"properties": [("type", 'CIRCLE'), ("wait_for_input", False)]}),
+ ]},
+ )
+
+
+def km_3d_view_tool_gpencil_paint_arc(params):
+ return (
+ "3D View Tool: Gpencil Paint, Arc",
+ {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
+ {"items": [
+ ("gpencil.primitive", {"type": params.tool_tweak, "value": 'ANY'},
+ {"properties": [("type", 'ARC'), ("wait_for_input", False)]}),
+ ("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
+ {"properties": [("type", 'ARC'), ("wait_for_input", False)]}),
+ ("gpencil.primitive", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
+ {"properties": [("type", 'ARC'), ("wait_for_input", False)]}),
]},
)
@@ -5944,6 +5971,7 @@ def generate_keymaps(params=None):
km_3d_view_tool_gpencil_paint_line(params),
km_3d_view_tool_gpencil_paint_box(params),
km_3d_view_tool_gpencil_paint_circle(params),
+ km_3d_view_tool_gpencil_paint_arc(params),
km_3d_view_tool_gpencil_edit_select(params),
km_3d_view_tool_gpencil_edit_select_box(params),
km_3d_view_tool_gpencil_edit_select_circle(params),
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index eed78ff26ad..5a0c2bd1e43 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -644,6 +644,7 @@ class GPENCIL_MT_gpencil_draw_specials(Menu):
layout.operator("gpencil.primitive", text="Line", icon='IPO_CONSTANT').type = 'LINE'
layout.operator("gpencil.primitive", text="Rectangle", icon='UV_FACESEL').type = 'BOX'
layout.operator("gpencil.primitive", text="Circle", icon='ANTIALIASED').type = 'CIRCLE'
+ layout.operator("gpencil.primitive", text="Arc", icon='SPHERECURVE').type = 'ARC'
class GPENCIL_MT_gpencil_draw_delete(Menu):
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 591a17db4a5..5c930b68dd9 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1067,6 +1067,15 @@ class _defs_gpencil_paint:
keymap=(),
)
+ @ToolDef.from_fn
+ def arc():
+ return dict(
+ text="Arc",
+ icon="ops.gpencil.primitive_arc",
+ cursor='CROSSHAIR',
+ widget=None,
+ keymap=(),
+ )
class _defs_gpencil_edit:
@ToolDef.from_fn
@@ -1573,6 +1582,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
_defs_gpencil_paint.line,
_defs_gpencil_paint.box,
_defs_gpencil_paint.circle,
+ _defs_gpencil_paint.arc,
],
'GPENCIL_EDIT': [
*_tools_gpencil_select,
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index f1a91d08040..af1f72fa72c 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -301,7 +301,7 @@ class _draw_left_context_mode:
return
is_paint = True
- if (tool.name in {"Line", "Box", "Circle"}):
+ if (tool.name in {"Line", "Box", "Circle", "Arc"}):
is_paint = False
elif (not tool.has_datablock):
return