GPencil: Object data UI updates

Some tweaks for the Grease Pencil object data UI:
- Update main layers controls for consistency (Opacity, Blend mode).
- Move "Show only On Keyframed" checkbox to Display section.
- Change "Duplicate Layer" icon in Layer menu.

{F7695928}

Reviewers: antoniov, pepeland, billreynish

Reviewed By: billreynish

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5571
This commit is contained in:
2019-08-23 23:01:06 +02:00
committed by Antonio Vazquez
parent f16a28c4af
commit d795dd1fa7

View File

@@ -84,7 +84,7 @@ class GPENCIL_MT_layer_context_menu(Menu):
ob = context.object
gpd = ob.data
layout.operator("gpencil.layer_duplicate", icon='ADD') # XXX: needs a dedicated icon
layout.operator("gpencil.layer_duplicate", icon='DUPLICATE')
layout.separator()
@@ -123,29 +123,16 @@ class DATA_PT_gpencil_layers(DataButtonsPanel, Panel):
def draw_layers(self, _context, layout, gpd):
row = layout.row()
gpl = gpd.layers.active
col = row.column()
row = layout.row()
layer_rows = 7
col = row.column()
col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index",
rows=layer_rows, sort_reverse=True, sort_lock=True)
gpl = gpd.layers.active
if gpl:
srow = col.row(align=True)
srow.prop(gpl, "blend_mode", text="Blend")
srow = col.row(align=True)
srow.prop(gpl, "opacity", text="Opacity", slider=True)
srow.prop(gpl, "mask_layer", text="",
icon='MOD_MASK' if gpl.mask_layer else 'LAYER_ACTIVE')
srow = col.row(align=True)
srow.prop(gpl, "use_solo_mode", text="Show Only On Keyframed")
col = row.column()
sub = col.column(align=True)
sub.operator("gpencil.layer_add", icon='ADD', text="")
sub.operator("gpencil.layer_remove", icon='REMOVE', text="")
@@ -165,7 +152,23 @@ class DATA_PT_gpencil_layers(DataButtonsPanel, Panel):
sub = col.column(align=True)
sub.operator("gpencil.layer_isolate", icon='LOCKED', text="").affect_visibility = False
sub.operator("gpencil.layer_isolate", icon='RESTRICT_VIEW_ON', text="").affect_visibility = True
# Layer main properties
row = layout.row()
col = layout.column(align=True)
if gpl:
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = True
col = layout.column(align=True)
col = layout.row(align=True)
col.prop(gpl, "blend_mode", text="Blend")
col = layout.row(align=True)
col.prop(gpl, "opacity", text="Opacity", slider=True)
class DATA_PT_gpencil_layer_adjustments(LayerDataButtonsPanel, Panel):
bl_label = "Adjustments"
@@ -201,7 +204,6 @@ class DATA_PT_gpencil_layer_adjustments(LayerDataButtonsPanel, Panel):
col = layout.row(align=True)
col.prop(gpl, "lock_material")
class DATA_PT_gpencil_layer_relations(LayerDataButtonsPanel, Panel):
bl_label = "Relations"
bl_parent_id = 'DATA_PT_gpencil_layers'
@@ -241,6 +243,8 @@ class DATA_PT_gpencil_layer_display(LayerDataButtonsPanel, Panel):
col = layout.row(align=True)
col.prop(gpl, "channel_color")
col = layout.row(align=True)
col.prop(gpl, "use_solo_mode", text="Show Only On Keyframed")
class DATA_PT_gpencil_onion_skinning(DataButtonsPanel, Panel):
bl_label = "Onion Skinning"