From 0a4fdcbb5fe3b33a276d2ab54a1e68db0fe24fd4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Mar 2022 11:03:36 +1100 Subject: Cleanup: unused Python variables & imports --- release/scripts/startup/bl_ui/space_filebrowser.py | 3 --- release/scripts/startup/bl_ui/space_image.py | 15 +++++---------- release/scripts/startup/bl_ui/space_outliner.py | 2 -- release/scripts/startup/bl_ui/space_sequencer.py | 8 +++----- release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 3 --- release/scripts/startup/bl_ui/space_topbar.py | 1 - 6 files changed, 8 insertions(+), 24 deletions(-) (limited to 'release/scripts/startup/bl_ui') diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index e8969c0aa22..53d2cdc8339 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -694,9 +694,6 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel): layout.label(text="No active asset", icon='INFO') return - asset_library_ref = context.asset_library_ref - asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library_ref) - prefs = context.preferences show_asset_debug_info = prefs.view.show_developer_ui and prefs.experimental.show_asset_debug_info diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 0aac224bc68..65d624a253d 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -759,7 +759,6 @@ class IMAGE_HT_header(Header): ima = sima.image iuser = sima.image_user tool_settings = context.tool_settings - show_region_tool_header = sima.show_region_tool_header show_render = sima.show_render show_uvedit = sima.show_uvedit @@ -772,8 +771,6 @@ class IMAGE_HT_header(Header): # UV editing. if show_uvedit: - uvedit = sima.uv_editor - layout.prop(tool_settings, "use_uv_select_sync", text="") if tool_settings.use_uv_select_sync: @@ -781,15 +778,15 @@ class IMAGE_HT_header(Header): else: row = layout.row(align=True) uv_select_mode = tool_settings.uv_select_mode[:] - row.operator("uv.select_mode", text="", icon='UV_VERTEXSEL', + row.operator("uv.select_mode", text="", icon='UV_VERTEXSEL', depress=(uv_select_mode == 'VERTEX')).type = 'VERTEX' - row.operator("uv.select_mode", text="", icon='UV_EDGESEL', + row.operator("uv.select_mode", text="", icon='UV_EDGESEL', depress=(uv_select_mode == 'EDGE')).type = 'EDGE' - row.operator("uv.select_mode", text="", icon='UV_FACESEL', + row.operator("uv.select_mode", text="", icon='UV_FACESEL', depress=(uv_select_mode == 'FACE')).type = 'FACE' - row.operator("uv.select_mode", text="", icon='UV_ISLANDSEL', + row.operator("uv.select_mode", text="", icon='UV_ISLANDSEL', depress=(uv_select_mode == 'ISLAND')).type = 'ISLAND' - + layout.prop(tool_settings, "uv_sticky_select_mode", icon_only=True) IMAGE_MT_editor_menus.draw_collapsible(context, layout) @@ -817,8 +814,6 @@ class IMAGE_HT_header(Header): sub.popover(panel="IMAGE_PT_overlay", text="") if show_uvedit: - uvedit = sima.uv_editor - mesh = context.edit_object.data layout.prop_search(mesh.uv_layers, "active", mesh, "uv_layers", text="") diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index a2fdea91a8e..9d3f20ce4a4 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -311,8 +311,6 @@ class OUTLINER_MT_asset(Menu): def draw(self, context): layout = self.layout - space = context.space_data - layout.operator("asset.mark") layout.operator("asset.clear", text="Clear Asset").set_fake_user = False layout.operator("asset.clear", text="Clear Asset (Set Fake User)").set_fake_user = True diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 76a69e878b0..96ac62fb502 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -130,7 +130,7 @@ class SEQUENCER_HT_tool_header(Header): bl_region_type = 'TOOL_HEADER' def draw(self, context): - layout = self.layout + # layout = self.layout self.draw_tool_settings(context) @@ -241,7 +241,6 @@ class SEQUENCER_PT_gizmo_display(Panel): def draw(self, context): layout = self.layout - scene = context.scene st = context.space_data col = layout.column() @@ -555,7 +554,7 @@ class SEQUENCER_MT_select(Menu): def draw(self, context): layout = self.layout st = context.space_data - has_sequencer, has_preview = _space_view_types(st) + has_sequencer, _has_preview = _space_view_types(st) layout.operator("sequencer.select_all", text="All").action = 'SELECT' layout.operator("sequencer.select_all", text="None").action = 'DESELECT' @@ -891,7 +890,7 @@ class SEQUENCER_MT_strip(Menu): def draw(self, context): layout = self.layout st = context.space_data - has_sequencer, has_preview = _space_view_types(st) + has_sequencer, _has_preview = _space_view_types(st) layout.menu("SEQUENCER_MT_strip_transform") layout.separator() @@ -1134,7 +1133,6 @@ class SEQUENCER_MT_pivot_pie(Menu): layout = self.layout pie = layout.menu_pie() - tool_settings = context.tool_settings sequencer_tool_settings = context.tool_settings.sequencer_tool_settings pie.prop_enum(sequencer_tool_settings, "pivot_point", value='CENTER') diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index f4aa4c50d76..aec3ec63a0c 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1065,11 +1065,8 @@ class _defs_edit_mesh: show_extra = False props = tool.operator_properties("mesh.knife_tool") if not extra: - row = layout.row() layout.prop(props, "use_occlude_geometry") - row = layout.row() layout.prop(props, "only_selected") - row = layout.row() layout.prop(props, "xray") region_is_header = bpy.context.region.type == 'TOOL_HEADER' if region_is_header: diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 3b6bdd01efa..3355b30dd61 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -796,7 +796,6 @@ class TOPBAR_PT_name(Panel): return row mode = context.mode - scene = context.scene space = context.space_data space_type = None if (space is None) else space.type found = False -- cgit v1.2.3