[Bf-blender-cvs] [a591eabe94a] temp-gpencil-bezier-v2: GPencil: Set Stroke Type UI

Falk David noreply at git.blender.org
Fri Mar 12 20:14:11 CET 2021


Commit: a591eabe94a4c257a5aeee6abec90193b95c9c54
Author: Falk David
Date:   Fri Mar 12 20:14:02 2021 +0100
Branches: temp-gpencil-bezier-v2
https://developer.blender.org/rBa591eabe94a4c257a5aeee6abec90193b95c9c54

GPencil: Set Stroke Type UI

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_view3d.py

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

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 c23cc838e51..1650202942f 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -381,6 +381,14 @@ class GPENCIL_MT_cleanup(Menu):
         if ob.mode != 'PAINT_GPENCIL':
             layout.operator("gpencil.reproject")
 
+class GPENCIL_MT_stroke_type(Menu):
+    bl_label = "Set Stroke Type"
+
+    def draw(self, contect):
+        layout = self.layout
+        layout.operator("gpencil.stroke_set_type", text="Poly", icon='OUTLINER_DATA_GREASEPENCIL').type = 'POLY'
+        layout.operator("gpencil.stroke_set_type", text="Bézier", icon='HANDLE_ALIGNED').type = 'BEZIER'
+
 
 class GPENCIL_UL_annotation_layer(UIList):
     def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index):
@@ -922,6 +930,7 @@ classes = (
     GPENCIL_MT_move_to_layer,
     GPENCIL_MT_layer_active,
     GPENCIL_MT_material_active,
+    GPENCIL_MT_stroke_type,
 
     GPENCIL_MT_gpencil_draw_delete,
     GPENCIL_MT_layer_mask_menu,
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index ff6005e4d39..97730953d50 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -5012,6 +5012,7 @@ class VIEW3D_MT_edit_gpencil_stroke(Menu):
         layout.operator_menu_enum("gpencil.stroke_caps_set", text="Toggle Caps", property="type")
         layout.operator("gpencil.stroke_flip", text="Switch Direction")
         layout.prop(settings, "use_scale_thickness", text="Scale Thickness")
+        layout.menu("GPENCIL_MT_stroke_type")
 
         layout.separator()
         layout.operator("gpencil.reset_transform_fill", text="Reset Fill Transform")
@@ -7087,6 +7088,10 @@ class VIEW3D_MT_gpencil_edit_context_menu(Menu):
 
             col.separator()
 
+            col.menu("GPENCIL_MT_stroke_type")
+
+            col.separator()
+
             # Duplicate operators
             col.operator("gpencil.duplicate_move", text="Duplicate")
             col.operator("gpencil.copy", text="Copy", icon='COPYDOWN')



More information about the Bf-blender-cvs mailing list