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")

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to