GPencil D+W Pie: Don't show editing operators when not in editmode

These operators only operate on the selected strokes, but when not in editmode,
stroke vertices are not shown.

Safe for 2.78
This commit is contained in:
Joshua Leung
2016-09-21 15:06:39 +12:00
parent c5326958a5
commit 0b9cfbf6a8

View File

@@ -483,11 +483,13 @@ class GPENCIL_PIE_settings_palette(Menu):
layout = self.layout layout = self.layout
pie = layout.menu_pie() pie = layout.menu_pie()
# gpd = context.gpencil_data gpd = context.gpencil_data
gpl = context.active_gpencil_layer gpl = context.active_gpencil_layer
palcolor = context.active_gpencil_palettecolor palcolor = context.active_gpencil_palettecolor
brush = context.active_gpencil_brush brush = context.active_gpencil_brush
is_editmode = bool(gpd and gpd.use_stroke_edit_mode and context.editable_gpencil_strokes)
# W - Stroke draw settings # W - Stroke draw settings
col = pie.column(align=True) col = pie.column(align=True)
if palcolor is not None: if palcolor is not None:
@@ -522,6 +524,9 @@ class GPENCIL_PIE_settings_palette(Menu):
row.prop(gpl, "hide") row.prop(gpl, "hide")
col.prop(gpl, "use_onion_skinning") col.prop(gpl, "use_onion_skinning")
# NW/NE/SW/SE - These operators are only available in editmode
# as they require strokes to be selected to work
if is_editmode:
# NW - Move stroke Down # NW - Move stroke Down
col = pie.column(align=True) col = pie.column(align=True)
col.label("Arrange Strokes") col.label("Arrange Strokes")
@@ -546,8 +551,6 @@ class GPENCIL_PIE_settings_palette(Menu):
row.operator("gpencil.stroke_join", text="Join & Copy").type = 'JOINCOPY' row.operator("gpencil.stroke_join", text="Join & Copy").type = 'JOINCOPY'
col.operator("gpencil.stroke_flip", text="Flip direction") col.operator("gpencil.stroke_flip", text="Flip direction")
gpd = context.gpencil_data
if gpd:
col.prop(gpd, "show_stroke_direction", text="Show drawing direction") col.prop(gpd, "show_stroke_direction", text="Show drawing direction")