[Bf-blender-cvs] [5abee2392f5] greasepencil-object: Fix for py errors in console, caused by bad poll callback for the "Animation" panel

Joshua Leung noreply at git.blender.org
Mon Jul 2 16:02:39 CEST 2018


Commit: 5abee2392f584148133a84636ae949128f50e134
Author: Joshua Leung
Date:   Tue Jul 3 01:41:38 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB5abee2392f584148133a84636ae949128f50e134

Fix for py errors in console, caused by bad poll callback for the "Animation" panel

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 9e0ae2c7860..f61e0aa363e 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -332,12 +332,8 @@ class GreasePencilAnimationPanel:
 
     @classmethod
     def poll(cls, context):
-        if context.gpencil_data is None:
-            return False
-        elif context.active_object.mode == 'OBJECT':
-            return False
-
-        return True
+        ob = context.active_object
+        return ob and ob.type == 'GPENCIL' and ob.mode != 'OBJECT'
 
     @staticmethod
     def draw(self, context):



More information about the Bf-blender-cvs mailing list