Tools: Add Radius tool to Grease Pencil toolbar
authorWilliam Reynish <billrey@me.com>
Thu, 7 Mar 2019 10:12:30 +0000 (11:12 +0100)
committerWilliam Reynish <billrey@me.com>
Thu, 7 Mar 2019 10:12:30 +0000 (11:12 +0100)
Icon pending.

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

index e3a6f25f101786225c1abc395865777b587faaa7..3377dea4a9735cb506d2f53c27407a2a316037aa 100644 (file)
@@ -5906,6 +5906,17 @@ def km_3d_view_tool_edit_gpencil_select_lasso(params):
     )
 
 
+def km_3d_view_tool_edit_gpencil_radius(params):
+    return (
+        "3D View Tool: Edit Gpencil, Radius",
+        {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
+        {"items": [
+            ("transform.transform", {"type": params.tool_tweak, "value": 'ANY'},
+             {"properties": [("mode", 'CURVE_SHRINKFATTEN'), ("release_confirm", True)]}),
+        ]},
+    )
+
+
 def km_3d_view_tool_edit_gpencil_bend(params):
     return (
         "3D View Tool: Edit Gpencil, Bend",
@@ -6189,6 +6200,7 @@ def generate_keymaps(params=None):
         km_3d_view_tool_edit_gpencil_select_box(params),
         km_3d_view_tool_edit_gpencil_select_circle(params),
         km_3d_view_tool_edit_gpencil_select_lasso(params),
+        km_3d_view_tool_edit_gpencil_radius(params),
         km_3d_view_tool_edit_gpencil_bend(params),
         km_3d_view_tool_edit_gpencil_shear(params),
         km_3d_view_tool_edit_gpencil_to_sphere(params),
index ce9a7361d7d7a671c24a4159f816d33ddf33ea3b..4ba53778dc9649dac3e58f4b816b6816ce9f40ed 100644 (file)
@@ -1253,6 +1253,19 @@ class _defs_gpencil_edit:
             draw_settings=draw_settings,
         )
 
+    @ToolDef.from_fn
+    def radius():
+        return dict(
+            text="Radius",
+            description=(
+                "Expand or contract the radius of the selected points"
+            ),
+            icon="ops.gpencil.radius",
+
+            widget=None,
+            keymap=(),
+        )
+
     @ToolDef.from_fn
     def shear():
         return dict(
@@ -1750,9 +1763,12 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
             *_tools_transform,
             None,
             _defs_gpencil_edit.extrude,
+            _defs_gpencil_edit.radius,
             _defs_gpencil_edit.bend,
-            _defs_gpencil_edit.shear,
-            _defs_gpencil_edit.tosphere,
+            (
+                _defs_gpencil_edit.shear,
+                _defs_gpencil_edit.tosphere,
+            ),
 
         ],
         'SCULPT_GPENCIL': [