[Bf-blender-cvs] [890b6179196] blender2.8: Fix Python errors in weight paint mode.

Brecht Van Lommel noreply at git.blender.org
Fri Sep 21 20:22:04 CEST 2018


Commit: 890b617919670ea43ae11730a3cb621c85682840
Author: Brecht Van Lommel
Date:   Fri Sep 21 19:24:29 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB890b617919670ea43ae11730a3cb621c85682840

Fix Python errors in weight paint mode.

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

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

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

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 72886880cf3..d249a9aa966 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1052,8 +1052,8 @@ class _defs_vertex_paint:
 
     @staticmethod
     def poll_select_mask(context):
-        mesh = context.object.data
-        return mesh.use_paint_mask
+        ob = context.active_object
+        return ob.type == 'MESH' and ob.data.use_paint_mask
 
     @staticmethod
     def generate_from_brushes(context):
@@ -1100,8 +1100,10 @@ class _defs_weight_paint:
 
     @staticmethod
     def poll_select_mask(context):
-        mesh = context.object.data
-        return (mesh.use_paint_mask or mesh.use_paint_mask_vertex)
+        ob = context.active_object
+        return (ob.type == 'MESH' and
+                (ob.data.use_paint_mask or
+                 ob.data.use_paint_mask_vertex))
 
     @staticmethod
     def generate_from_brushes(context):



More information about the Bf-blender-cvs mailing list