forked from bartvdbraak/blender
Cleanup: use equality instead of contains for single-item sets
This commit is contained in:
parent
87e5c4230f
commit
be8270bc76
@ -41,7 +41,7 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
|
||||
else:
|
||||
layout.label(text="", translate=False, icon_value=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.label(text="", icon_value=icon)
|
||||
|
||||
|
@ -73,7 +73,7 @@ class MESH_UL_vgroups_slow(bpy.types.UIList):
|
||||
layout.prop(vgroup, "name", text="", emboss=False, icon_value=icon)
|
||||
icon = 'LOCKED' if vgroup.lock_weight else 'UNLOCKED'
|
||||
layout.prop(vgroup, "lock_weight", text="", icon=icon, emboss=False)
|
||||
elif self.layout_type in {'GRID'}:
|
||||
elif self.layout_type == 'GRID':
|
||||
layout.alignment = 'CENTER'
|
||||
if flt_flag & self.VGROUP_EMPTY:
|
||||
layout.enabled = False
|
||||
|
@ -362,7 +362,7 @@ class GPENCIL_UL_annotation_layer(UIList):
|
||||
|
||||
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, "annotation_hide", text="", emboss=False)
|
||||
|
@ -55,7 +55,7 @@ class PhysicButtonsPanel:
|
||||
md = context.fluid
|
||||
if md and (md.fluid_type == 'DOMAIN'):
|
||||
domain = md.domain_settings
|
||||
return domain.domain_type in {'GAS'}
|
||||
return domain.domain_type == 'GAS'
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
@ -66,7 +66,7 @@ class PhysicButtonsPanel:
|
||||
md = context.fluid
|
||||
if md and (md.fluid_type == 'DOMAIN'):
|
||||
domain = md.domain_settings
|
||||
return domain.domain_type in {'LIQUID'}
|
||||
return domain.domain_type == 'LIQUID'
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
@ -812,7 +812,7 @@ class PHYSICS_PT_mesh(PhysicButtonsPanel, Panel):
|
||||
col.separator()
|
||||
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.prop(domain, "mesh_smoothen_pos", text="Smoothing Positive")
|
||||
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.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.enabled = not is_baking_any and not has_baked_mesh
|
||||
row.prop(domain, "cache_mesh_format", text="Meshes")
|
||||
|
@ -351,7 +351,7 @@ class OUTLINER_PT_filter(Panel):
|
||||
col = layout.column(align=True)
|
||||
col.prop(space, "use_sort_alpha")
|
||||
|
||||
if display_mode not in {'LIBRARY_OVERRIDES'}:
|
||||
if display_mode != 'LIBRARY_OVERRIDES':
|
||||
row = layout.row(align=True)
|
||||
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_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()
|
||||
row = col.row()
|
||||
row.label(icon='LIBRARY_DATA_OVERRIDE')
|
||||
row.prop(space, "use_filter_lib_override_system", text="System Overrides")
|
||||
|
||||
if display_mode not in {'VIEW_LAYER'}:
|
||||
if display_mode != 'VIEW_LAYER':
|
||||
return
|
||||
|
||||
layout.separator()
|
||||
|
@ -5301,7 +5301,7 @@ class VIEW3D_MT_pivot_pie(Menu):
|
||||
pie.prop_enum(context.scene.tool_settings, "transform_pivot_point", value='ACTIVE_ELEMENT')
|
||||
if (obj is None) or (mode in {'OBJECT', 'POSE', 'WEIGHT_PAINT'}):
|
||||
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")
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ class MESH_UL_mylist(bpy.types.UIList):
|
||||
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
||||
pass
|
||||
# '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
|
||||
|
||||
# Called once to draw filtering/reordering options.
|
||||
|
@ -29,7 +29,7 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
|
||||
else:
|
||||
layout.label(text="", translate=False, icon_value=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.label(text="", icon_value=icon)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user