diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-08-06 16:46:06 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-08-06 16:48:27 +0300 |
commit | b9ce21fd0fda385bcafa0e1f17385db97da60c83 (patch) | |
tree | 0cf8c0b4b1133e08b7a10013bd7ffcd75b134e07 /release/scripts/startup/bl_ui/properties_grease_pencil_common.py | |
parent | 376e729de02a42f1a853c4e6d241a4a6dc1894f9 (diff) |
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.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_grease_pencil_common.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_grease_pencil_common.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 e86fc79e343..9a46e6fa7a4 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -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): |