diff options
author | Campbell Barton <campbell@blender.org> | 2022-04-06 02:40:14 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-04-06 02:40:14 +0300 |
commit | 11b0824d89a43602e635e690f24c5d05df72616b (patch) | |
tree | 0b13abdf831922438ceca38913ea82872a8d2f4f /release | |
parent | a776385b265e699db3af148c6124d131f4172824 (diff) |
Cleanup: line wrapping, remove unused args, variables in UI scripts
Diffstat (limited to 'release')
5 files changed, 16 insertions, 18 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 399c4519635..a1913945364 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -3041,7 +3041,7 @@ def km_sequencer_channels(params): # Rename. ("sequencer.rename_channel", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None), ("sequencer.rename_channel", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), - ]) + ]) return keymap diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 929953dd411..1a3f19eaba8 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -69,7 +69,7 @@ class MESH_MT_shape_key_context_menu(Menu): class MESH_MT_attribute_context_menu(Menu): bl_label = "Attribute Specials" - def draw(self, context): + def draw(self, _context): layout = self.layout layout.operator("geometry.attribute_convert") @@ -581,15 +581,16 @@ class MESH_UL_color_attributes(UIList): 'CORNER': "Face Corner", } - def filter_items(self, context, data, property): + def filter_items(self, _context, data, property): attrs = getattr(data, property) ret = [] idxs = [] for idx, item in enumerate(attrs): - skip = item.domain not in {"POINT", "CORNER"} - skip = skip or item.data_type not in {"FLOAT_COLOR", "BYTE_COLOR"} - + skip = ( + (item.domain not in {"POINT", "CORNER"}) or + (item.data_type not in {"FLOAT_COLOR", "BYTE_COLOR"}) + ) ret.append(self.bitflag_filter_item if not skip else 0) idxs.append(idx) @@ -606,9 +607,11 @@ class MESH_UL_color_attributes(UIList): active_render = _index == data.color_attributes.render_color_index - props = split.operator("geometry.color_attribute_render_set", text="", icon = 'RESTRICT_RENDER_OFF'if \ - active_render else 'RESTRICT_RENDER_ON' - ) + props = split.operator( + "geometry.color_attribute_render_set", + text="", + icon='RESTRICT_RENDER_OFF' if active_render else 'RESTRICT_RENDER_ON', + ) props.name = attribute.name @@ -643,7 +646,7 @@ class DATA_PT_vertex_colors(DATA_PT_mesh_attributes, Panel): col = row.column(align=True) col.operator("geometry.color_attribute_add", icon='ADD', text="") col.operator("geometry.color_attribute_remove", icon='REMOVE', text="") - + self.draw_attribute_warnings(context, layout) classes = ( diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index 53d2cdc8339..4144cf8c8f8 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -748,7 +748,7 @@ class ASSETBROWSER_PT_metadata_preview(asset_utils.AssetMetaDataPanel, Panel): class ASSETBROWSER_MT_metadata_preview_menu(bpy.types.Menu): bl_label = "Preview" - def draw(self, context): + def draw(self, _context): layout = self.layout layout.operator("ed.lib_id_generate_preview_from_object", text="Render Active Object") diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index eff8ad8e8b3..f953095b9bb 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -135,7 +135,7 @@ class OUTLINER_MT_context_menu_view(Menu): class OUTLINER_MT_view_pie(Menu): bl_label = "View" - def draw(self, context): + def draw(self, _context): layout = self.layout pie = layout.menu_pie() @@ -314,7 +314,7 @@ class OUTLINER_MT_object(Menu): class OUTLINER_MT_asset(Menu): bl_label = "Assets" - def draw(self, context): + def draw(self, _context): layout = self.layout layout.operator("asset.mark") diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index b8d30f06193..270d0e9b288 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1307,17 +1307,12 @@ class _defs_sculpt: @staticmethod def generate_from_brushes(context): - exclude_filter = {} - # Use 'bpy.context' instead of 'context' since it can be None. - prefs = bpy.context.preferences - return generate_from_enum_ex( context, idname_prefix="builtin_brush.", icon_prefix="brush.sculpt.", type=bpy.types.Brush, attr="sculpt_tool", - exclude_filter=exclude_filter, ) @ToolDef.from_fn |