[Bf-blender-cvs] [252207cc7a8] master: Cleanup: redundant poll checks

Campbell Barton noreply at git.blender.org
Sat Jul 7 08:48:54 CEST 2018


Commit: 252207cc7a808bf70f8ef398eb578b58a3f1099d
Author: Campbell Barton
Date:   Sat Jul 7 08:36:17 2018 +0200
Branches: master
https://developer.blender.org/rB252207cc7a808bf70f8ef398eb578b58a3f1099d

Cleanup: redundant poll checks

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

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

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index c8f113f558d..0a365c6a20c 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3395,11 +3395,6 @@ class VIEW3D_PT_view3d_properties(Panel):
     bl_region_type = 'UI'
     bl_label = "View"
 
-    @classmethod
-    def poll(cls, context):
-        view = context.space_data
-        return (view)
-
     def draw(self, context):
         layout = self.layout
 
@@ -3443,11 +3438,6 @@ class VIEW3D_PT_view3d_cursor(Panel):
     bl_region_type = 'UI'
     bl_label = "3D Cursor"
 
-    @classmethod
-    def poll(cls, context):
-        view = context.space_data
-        return (view is not None)
-
     def draw(self, context):
         layout = self.layout
 
@@ -3462,7 +3452,7 @@ class VIEW3D_PT_view3d_name(Panel):
 
     @classmethod
     def poll(cls, context):
-        return (context.space_data and context.active_object)
+        return (context.active_object is not None)
 
     def draw(self, context):
         layout = self.layout
@@ -3486,11 +3476,6 @@ class VIEW3D_PT_view3d_display(Panel):
     bl_label = "Display"
     bl_options = {'DEFAULT_CLOSED'}
 
-    @classmethod
-    def poll(cls, context):
-        view = context.space_data
-        return (view)
-
     def draw(self, context):
         layout = self.layout
 
@@ -3553,9 +3538,7 @@ class VIEW3D_PT_view3d_stereo(Panel):
     @classmethod
     def poll(cls, context):
         scene = context.scene
-
-        multiview = scene.render.use_multiview
-        return context.space_data and multiview
+        return scene.render.use_multiview
 
     def draw(self, context):
         layout = self.layout
@@ -3640,11 +3623,6 @@ class VIEW3D_PT_view3d_motion_tracking(Panel):
     bl_label = "Motion Tracking"
     bl_options = {'DEFAULT_CLOSED'}
 
-    @classmethod
-    def poll(cls, context):
-        view = context.space_data
-        return (view)
-
     def draw_header(self, context):
         view = context.space_data
 
@@ -3785,8 +3763,7 @@ class VIEW3D_PT_view3d_curvedisplay(Panel):
 
     @classmethod
     def poll(cls, context):
-        editmesh = context.mode == 'EDIT_CURVE'
-        return (editmesh)
+        return (context.mode == 'EDIT_CURVE')
 
     def draw(self, context):
         layout = self.layout
@@ -3913,11 +3890,6 @@ class VIEW3D_PT_transform_orientations(Panel):
     bl_label = "Transform Orientations"
     bl_options = {'DEFAULT_CLOSED'}
 
-    @classmethod
-    def poll(cls, context):
-        view = context.space_data
-        return (view)
-
     def draw(self, context):
         layout = self.layout



More information about the Bf-blender-cvs mailing list