GPencil UI: Streamline the data panel workflow
Restored the "New Layer" button in the NKEY Grease Pencil panel (as was found pre-2.73) for two cases: 1) When no Grease Pencil datablock is active - This shortcut makes it possible to add a new layer to start drawing in with a single click again (instead of two clicks - one to add a datablock, and a second to add the layer) 2) When there are no layers - There is no need to display the UI list in this case, thus saving a bit more space in the rare cases where this applies.
This commit is contained in:
parent
376e729de0
commit
b9ce21fd0f
|
@ -303,6 +303,8 @@ class GPENCIL_PIE_tools_more(Menu):
|
|||
pie.operator("wm.call_menu_pie", text="Back to Main Palette...").name = "GPENCIL_PIE_tool_palette"
|
||||
|
||||
|
||||
###############################
|
||||
|
||||
class GPENCIL_UL_layer(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
||||
# assert(isinstance(item, bpy.types.GPencilLayer)
|
||||
|
@ -354,7 +356,9 @@ class GreasePencilDataPanel:
|
|||
layout.template_ID(gpd_owner, "grease_pencil", new="gpencil.data_add", unlink="gpencil.data_unlink")
|
||||
|
||||
# Grease Pencil data...
|
||||
if gpd:
|
||||
if (gpd is None) or len(gpd.layers) == 0:
|
||||
layout.operator("gpencil.layer_add", text="New Layer")
|
||||
else:
|
||||
self.draw_layers(context, layout, gpd)
|
||||
|
||||
def draw_layers(self, context, layout, gpd):
|
||||
|
|
Loading…
Reference in New Issue