[Bf-blender-cvs] [034c2c800e1] greasepencil-object: UI: Hide weight tools for non GP Objects

Antonio Vazquez noreply at git.blender.org
Thu May 31 23:09:31 CEST 2018


Commit: 034c2c800e1911b645cbabebcfb43381da5e9a39
Author: Antonio Vazquez
Date:   Thu May 31 23:09:21 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB034c2c800e1911b645cbabebcfb43381da5e9a39

UI: Hide weight tools for non GP Objects

This poll method was missing in previous commit

===================================================================

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 4ceffa869fa..344c7011b96 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1596,6 +1596,17 @@ class VIEW3D_PT_tools_grease_pencil_weight_tools(Panel):
     bl_region_type = 'TOOLS'
     bl_label = "Weight Tools"
 
+    @classmethod
+    def poll(cls, context):
+        if context.gpencil_data is None:
+            return False
+
+        if context.active_object:
+            return context.active_object.mode == 'GPENCIL_WEIGHT'
+
+        return False
+
+
     @staticmethod
     def draw(self, context):
         layout = self.layout



More information about the Bf-blender-cvs mailing list