[Bf-blender-cvs] [77710496416] greasepencil-object: UI: Add a text for not linked palettes
Antonio Vazquez
noreply at git.blender.org
Tue Mar 13 16:11:26 CET 2018
Commit: 7771049641631dadba7f4fd31cc1d82ebc1e6f3a
Author: Antonio Vazquez
Date: Tue Mar 13 16:11:16 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB7771049641631dadba7f4fd31cc1d82ebc1e6f3a
UI: Add a text for not linked palettes
I had to use a trick with a disabled button because the template_id collapse when nothing is selected.
Here the operator new is not logic, so we cannot add the common "+ new" button.
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index a65713eff99..922431bc69d 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2098,6 +2098,10 @@ class VIEW3D_PT_tools_grease_pencil_brush(Panel):
row = layout.row(align=True)
row.template_ID(brush, "palette")
+ if brush.palette is None:
+ subrow = row.row(align=True)
+ subrow.enabled = False
+ subrow.operator("palette.new_gpencil", text="Unlinked")
if brush.palette:
row = layout.row(align=True)
row.prop_search(brush, "colorname", brush.palette, "colors", text="Color", icon="LAYER_ACTIVE")
More information about the Bf-blender-cvs
mailing list