Cleanup: redundant poll checks

This commit is contained in:
Campbell Barton
2018-07-07 08:36:17 +02:00
parent b94222b090
commit 252207cc7a

View File

@@ -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