Commit: 7771049641631dadba7f4fd31cc1d82ebc1e6f3a
Author: Antonio Vazquez
Date:   Tue Mar 13 16:11:16 2018 +0100
Branches: greasepencil-object

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/


diff --git a/release/scripts/startup/bl_ui/ 
index a65713eff99..922431bc69d 100644
--- a/release/scripts/startup/bl_ui/
+++ b/release/scripts/startup/bl_ui/
@@ -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")

Bf-blender-cvs mailing list

Reply via email to