Cleanup: redundant poll checks
This commit is contained in:
@@ -3395,11 +3395,6 @@ class VIEW3D_PT_view3d_properties(Panel):
|
|||||||
bl_region_type = 'UI'
|
bl_region_type = 'UI'
|
||||||
bl_label = "View"
|
bl_label = "View"
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def poll(cls, context):
|
|
||||||
view = context.space_data
|
|
||||||
return (view)
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
@@ -3443,11 +3438,6 @@ class VIEW3D_PT_view3d_cursor(Panel):
|
|||||||
bl_region_type = 'UI'
|
bl_region_type = 'UI'
|
||||||
bl_label = "3D Cursor"
|
bl_label = "3D Cursor"
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def poll(cls, context):
|
|
||||||
view = context.space_data
|
|
||||||
return (view is not None)
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
@@ -3462,7 +3452,7 @@ class VIEW3D_PT_view3d_name(Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return (context.space_data and context.active_object)
|
return (context.active_object is not None)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@@ -3486,11 +3476,6 @@ class VIEW3D_PT_view3d_display(Panel):
|
|||||||
bl_label = "Display"
|
bl_label = "Display"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def poll(cls, context):
|
|
||||||
view = context.space_data
|
|
||||||
return (view)
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
@@ -3553,9 +3538,7 @@ class VIEW3D_PT_view3d_stereo(Panel):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
|
return scene.render.use_multiview
|
||||||
multiview = scene.render.use_multiview
|
|
||||||
return context.space_data and multiview
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@@ -3640,11 +3623,6 @@ class VIEW3D_PT_view3d_motion_tracking(Panel):
|
|||||||
bl_label = "Motion Tracking"
|
bl_label = "Motion Tracking"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def poll(cls, context):
|
|
||||||
view = context.space_data
|
|
||||||
return (view)
|
|
||||||
|
|
||||||
def draw_header(self, context):
|
def draw_header(self, context):
|
||||||
view = context.space_data
|
view = context.space_data
|
||||||
|
|
||||||
@@ -3785,8 +3763,7 @@ class VIEW3D_PT_view3d_curvedisplay(Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
editmesh = context.mode == 'EDIT_CURVE'
|
return (context.mode == 'EDIT_CURVE')
|
||||||
return (editmesh)
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@@ -3913,11 +3890,6 @@ class VIEW3D_PT_transform_orientations(Panel):
|
|||||||
bl_label = "Transform Orientations"
|
bl_label = "Transform Orientations"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def poll(cls, context):
|
|
||||||
view = context.space_data
|
|
||||||
return (view)
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user