Cleanup: remove redundant checks from space_view3d.py

The context's mode implies having an active object in the mode
being checked.
This commit is contained in:
Campbell Barton
2023-09-15 10:44:43 +10:00
parent 3c6731969e
commit 0ed14c813f
+4 -7
View File
@@ -976,9 +976,9 @@ class VIEW3D_HT_header(Header):
sub.popover(panel="VIEW3D_PT_overlay_edit_mesh", text="", icon='EDITMODE_HLT')
if context.mode == 'EDIT_CURVE':
sub.popover(panel="VIEW3D_PT_overlay_edit_curve", text="", icon='EDITMODE_HLT')
elif context.mode == 'SCULPT' and context.sculpt_object:
elif context.mode == 'SCULPT':
sub.popover(panel="VIEW3D_PT_overlay_sculpt", text="", icon='SCULPTMODE_HLT')
elif context.mode == 'SCULPT_CURVES' and context.object:
elif context.mode == 'SCULPT_CURVES':
sub.popover(panel="VIEW3D_PT_overlay_sculpt_curves", text="", icon='SCULPTMODE_HLT')
elif context.mode == 'PAINT_WEIGHT':
sub.popover(panel="VIEW3D_PT_overlay_weight_paint", text="", icon='WPAINT_HLT')
@@ -7113,10 +7113,7 @@ class VIEW3D_PT_overlay_sculpt(Panel):
@classmethod
def poll(cls, context):
return (
context.mode == 'SCULPT' and
context.sculpt_object
)
return context.mode == 'SCULPT'
def draw(self, context):
layout = self.layout
@@ -7147,7 +7144,7 @@ class VIEW3D_PT_overlay_sculpt_curves(Panel):
@classmethod
def poll(cls, context):
return context.mode == 'SCULPT_CURVES' and (context.object)
return context.mode == 'SCULPT_CURVES'
def draw(self, context):
layout = self.layout