Cleanup: use equality instead of contains for single-item sets

This commit is contained in:
2022-03-30 11:27:54 +11:00
parent 87e5c4230f
commit be8270bc76
8 changed files with 13 additions and 13 deletions

View File

@@ -41,7 +41,7 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
else: else:
layout.label(text="", translate=False, icon_value=icon) layout.label(text="", translate=False, icon_value=icon)
# 'GRID' layout type should be as compact as possible (typically a single icon!). # 'GRID' layout type should be as compact as possible (typically a single icon!).
elif self.layout_type in {'GRID'}: elif self.layout_type == 'GRID':
layout.alignment = 'CENTER' layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon) layout.label(text="", icon_value=icon)

View File

@@ -73,7 +73,7 @@ class MESH_UL_vgroups_slow(bpy.types.UIList):
layout.prop(vgroup, "name", text="", emboss=False, icon_value=icon) layout.prop(vgroup, "name", text="", emboss=False, icon_value=icon)
icon = 'LOCKED' if vgroup.lock_weight else 'UNLOCKED' icon = 'LOCKED' if vgroup.lock_weight else 'UNLOCKED'
layout.prop(vgroup, "lock_weight", text="", icon=icon, emboss=False) layout.prop(vgroup, "lock_weight", text="", icon=icon, emboss=False)
elif self.layout_type in {'GRID'}: elif self.layout_type == 'GRID':
layout.alignment = 'CENTER' layout.alignment = 'CENTER'
if flt_flag & self.VGROUP_EMPTY: if flt_flag & self.VGROUP_EMPTY:
layout.enabled = False layout.enabled = False

View File

@@ -362,7 +362,7 @@ class GPENCIL_UL_annotation_layer(UIList):
row = layout.row(align=True) row = layout.row(align=True)
icon_xray = "XRAY" if gpl.show_in_front else "FACESEL" icon_xray = 'XRAY' if gpl.show_in_front else 'FACESEL'
row.prop(gpl, "show_in_front", text="", icon=icon_xray, emboss=False) row.prop(gpl, "show_in_front", text="", icon=icon_xray, emboss=False)
row.prop(gpl, "annotation_hide", text="", emboss=False) row.prop(gpl, "annotation_hide", text="", emboss=False)

View File

@@ -55,7 +55,7 @@ class PhysicButtonsPanel:
md = context.fluid md = context.fluid
if md and (md.fluid_type == 'DOMAIN'): if md and (md.fluid_type == 'DOMAIN'):
domain = md.domain_settings domain = md.domain_settings
return domain.domain_type in {'GAS'} return domain.domain_type == 'GAS'
return False return False
@staticmethod @staticmethod
@@ -66,7 +66,7 @@ class PhysicButtonsPanel:
md = context.fluid md = context.fluid
if md and (md.fluid_type == 'DOMAIN'): if md and (md.fluid_type == 'DOMAIN'):
domain = md.domain_settings domain = md.domain_settings
return domain.domain_type in {'LIQUID'} return domain.domain_type == 'LIQUID'
return False return False
@staticmethod @staticmethod
@@ -812,7 +812,7 @@ class PHYSICS_PT_mesh(PhysicButtonsPanel, Panel):
col.separator() col.separator()
col.prop(domain, "mesh_generator", text="Mesh Generator") col.prop(domain, "mesh_generator", text="Mesh Generator")
if domain.mesh_generator in {'IMPROVED'}: if domain.mesh_generator == 'IMPROVED':
col = flow.column(align=True) col = flow.column(align=True)
col.prop(domain, "mesh_smoothen_pos", text="Smoothing Positive") col.prop(domain, "mesh_smoothen_pos", text="Smoothing Positive")
col.prop(domain, "mesh_smoothen_neg", text="Negative") col.prop(domain, "mesh_smoothen_neg", text="Negative")
@@ -1227,7 +1227,7 @@ class PHYSICS_PT_cache(PhysicButtonsPanel, Panel):
row.enabled = not is_baking_any and not has_baked_data row.enabled = not is_baking_any and not has_baked_data
row.prop(domain, "cache_data_format", text="Format Volumes") row.prop(domain, "cache_data_format", text="Format Volumes")
if md.domain_settings.domain_type in {'LIQUID'} and domain.use_mesh: if md.domain_settings.domain_type == 'LIQUID' and domain.use_mesh:
row = col.row() row = col.row()
row.enabled = not is_baking_any and not has_baked_mesh row.enabled = not is_baking_any and not has_baked_mesh
row.prop(domain, "cache_mesh_format", text="Meshes") row.prop(domain, "cache_mesh_format", text="Meshes")

View File

@@ -351,7 +351,7 @@ class OUTLINER_PT_filter(Panel):
col = layout.column(align=True) col = layout.column(align=True)
col.prop(space, "use_sort_alpha") col.prop(space, "use_sort_alpha")
if display_mode not in {'LIBRARY_OVERRIDES'}: if display_mode != 'LIBRARY_OVERRIDES':
row = layout.row(align=True) row = layout.row(align=True)
row.prop(space, "use_sync_select", text="Sync Selection") row.prop(space, "use_sync_select", text="Sync Selection")
@@ -364,13 +364,13 @@ class OUTLINER_PT_filter(Panel):
col.prop(space, "use_filter_complete", text="Exact Match") col.prop(space, "use_filter_complete", text="Exact Match")
col.prop(space, "use_filter_case_sensitive", text="Case Sensitive") col.prop(space, "use_filter_case_sensitive", text="Case Sensitive")
if display_mode in {'LIBRARY_OVERRIDES'} and bpy.data.libraries: if display_mode == 'LIBRARY_OVERRIDES' and bpy.data.libraries:
col.separator() col.separator()
row = col.row() row = col.row()
row.label(icon='LIBRARY_DATA_OVERRIDE') row.label(icon='LIBRARY_DATA_OVERRIDE')
row.prop(space, "use_filter_lib_override_system", text="System Overrides") row.prop(space, "use_filter_lib_override_system", text="System Overrides")
if display_mode not in {'VIEW_LAYER'}: if display_mode != 'VIEW_LAYER':
return return
layout.separator() layout.separator()

View File

@@ -5301,7 +5301,7 @@ class VIEW3D_MT_pivot_pie(Menu):
pie.prop_enum(context.scene.tool_settings, "transform_pivot_point", value='ACTIVE_ELEMENT') pie.prop_enum(context.scene.tool_settings, "transform_pivot_point", value='ACTIVE_ELEMENT')
if (obj is None) or (mode in {'OBJECT', 'POSE', 'WEIGHT_PAINT'}): if (obj is None) or (mode in {'OBJECT', 'POSE', 'WEIGHT_PAINT'}):
pie.prop(context.scene.tool_settings, "use_transform_pivot_point_align") pie.prop(context.scene.tool_settings, "use_transform_pivot_point_align")
if mode in {'EDIT_GPENCIL'}: if mode == 'EDIT_GPENCIL':
pie.prop(context.scene.tool_settings.gpencil_sculpt, "use_scale_thickness") pie.prop(context.scene.tool_settings.gpencil_sculpt, "use_scale_thickness")

View File

@@ -18,7 +18,7 @@ class MESH_UL_mylist(bpy.types.UIList):
if self.layout_type in {'DEFAULT', 'COMPACT'}: if self.layout_type in {'DEFAULT', 'COMPACT'}:
pass pass
# 'GRID' layout type should be as compact as possible (typically a single icon!). # 'GRID' layout type should be as compact as possible (typically a single icon!).
elif self.layout_type in {'GRID'}: elif self.layout_type == 'GRID':
pass pass
# Called once to draw filtering/reordering options. # Called once to draw filtering/reordering options.

View File

@@ -29,7 +29,7 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
else: else:
layout.label(text="", translate=False, icon_value=icon) layout.label(text="", translate=False, icon_value=icon)
# 'GRID' layout type should be as compact as possible (typically a single icon!). # 'GRID' layout type should be as compact as possible (typically a single icon!).
elif self.layout_type in {'GRID'}: elif self.layout_type == 'GRID':
layout.alignment = 'CENTER' layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon) layout.label(text="", icon_value=icon)