diff options
18 files changed, 20 insertions, 30 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index 4e7c278f196..f2e799f1760 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -470,7 +470,7 @@ def reset_all(*, reload_scripts=False): for path in paths_list: _bpy.utils._sys_path_ensure(path) - for mod_name, mod_path in _bpy.path.module_names(path): + for mod_name, _mod_path in _bpy.path.module_names(path): is_enabled, is_loaded = check(mod_name) # first check if reload is needed before changing state. diff --git a/release/scripts/modules/bl_keymap_utils/io.py b/release/scripts/modules/bl_keymap_utils/io.py index 531c620348d..d8ac647608c 100644 --- a/release/scripts/modules/bl_keymap_utils/io.py +++ b/release/scripts/modules/bl_keymap_utils/io.py @@ -156,7 +156,7 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False): fw = fh.write fw("keyconfig_data = \\\n[") - for km, kc_x in export_keymaps: + for km, _kc_x in export_keymaps: km = km.active() fw("(") fw(f"\"{km.name:s}\",\n") diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py index f7e0f6e8a4f..804bf248a4b 100644 --- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py +++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py @@ -284,7 +284,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): camera = bpy.data.objects[render_context.camera, None] light = bpy.data.objects[render_context.light, None] if render_context.light is not None else None cos = objects_bbox_calc(camera, objects, offset_matrix) - loc, ortho_scale = camera.camera_fit_coords(bpy.context.depsgraph, cos) + loc, _ortho_scale = camera.camera_fit_coords(bpy.context.depsgraph, cos) camera.location = loc # Set camera clipping accordingly to computed bbox. min_dist = 1e24 @@ -298,7 +298,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): camera.data.clip_start = min_dist / 2 camera.data.clip_end = max_dist * 2 if light: - loc, ortho_scale = light.camera_fit_coords(bpy.context.depsgraph, cos) + loc, _ortho_scale = light.camera_fit_coords(bpy.context.depsgraph, cos) light.location = loc scene.update() diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index 81b62b59fa6..7d4909fc7bc 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -137,7 +137,7 @@ def modules_from_path(path, loaded_modules): """ modules = [] - for mod_name, mod_path in _bpy.path.module_names(path): + for mod_name, _mod_path in _bpy.path.module_names(path): mod = _test_import(mod_name, loaded_modules) if mod: modules.append(mod) @@ -868,7 +868,6 @@ def unregister_tool(tool_cls): del tool_list[-1] while tool_list and tool_list[0] is None: del tool_list[0] - is_none_prev = False # Remove duplicate separators. for i in range(len(tool_list) - 1, -1, -1): is_none = tool_list[i] is None diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index 63850b63b57..03864d652e4 100644 --- a/release/scripts/modules/bpy_extras/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py @@ -138,7 +138,7 @@ def load_image(imagepath, def _recursive_search(paths, filename_check): for path in paths: - for dirpath, dirnames, filenames in os.walk(path): + for dirpath, _dirnames, filenames in os.walk(path): # skip '.svn' if dirpath[0] in {".", b'.'}: diff --git a/release/scripts/modules/bpy_extras/node_shader_utils.py b/release/scripts/modules/bpy_extras/node_shader_utils.py index 83cf94bd147..1e83a247eff 100644 --- a/release/scripts/modules/bpy_extras/node_shader_utils.py +++ b/release/scripts/modules/bpy_extras/node_shader_utils.py @@ -131,7 +131,7 @@ class ShaderWrapper(): if self._node_texcoords is None and not self.is_readonly: tree = self.material.node_tree nodes = tree.nodes - links = tree.links + # links = tree.links node_texcoords = nodes.new(type='ShaderNodeTexCoord') node_texcoords.label = "Texture Coords" @@ -521,8 +521,8 @@ class ShaderImageTextureWrapper(): self._node_mapping = ... tree = node_dst.id_data - nodes = tree.nodes - links = tree.links + # nodes = tree.nodes + # links = tree.links if socket_dst.is_linked: from_node = socket_dst.links[0].from_node diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py index 7d30b4e9ce0..e4495127ce7 100644 --- a/release/scripts/startup/bl_operators/add_mesh_torus.py +++ b/release/scripts/startup/bl_operators/add_mesh_torus.py @@ -99,10 +99,10 @@ def add_uvs(mesh, minor_seg, major_seg): u_prev = u_init u_next = u_prev + u_step - for major_index in range(major_seg): + for _major_index in range(major_seg): v_prev = v_init v_next = v_prev + v_step - for minor_index in range(minor_seg): + for _minor_index in range(minor_seg): loops = polygons[vertex_index].loop_indices uv_data[loops[0]].uv = u_prev, v_prev uv_data[loops[1]].uv = u_next, v_prev diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index 90cdbaceab5..2374faa0da8 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -68,7 +68,6 @@ class DATA_PT_context_gpencil(DataButtonsPanel, Panel): layout = self.layout ob = context.object - gpencil = context.gpencil space = context.space_data if ob: diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index ed75e212444..1994bfd34e8 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -249,7 +249,6 @@ class GreasePencilStrokeSculptPanel: layout.use_property_decorate = False settings = context.tool_settings.gpencil_sculpt - tool = settings.sculpt_tool brush = settings.brush layout.template_icon_view(settings, "sculpt_tool", show_labels=True) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 3d25829c3d2..e2504ba39ef 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -1000,7 +1000,6 @@ class PARTICLE_PT_physics_fluid_interaction(ParticleButtonsPanel, Panel): layout.use_property_split = True psys = context.particle_system - part = particle_get_settings(context) row = layout.row() row.template_list("UI_UL_list", "particle_targets", psys, "targets", diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index a05f3c92706..193ab6e6462 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -491,7 +491,6 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel): layout.use_property_split = True scene = context.scene - props = scene.eevee rd = scene.render col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 39c3597c788..00bfc48ba47 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -383,8 +383,6 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel): def draw(self, context): layout = self.layout - sc = context.space_data - col = layout.column(align=True) row = col.row(align=True) row.operator("clip.add_marker_at_click", text="Add") diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index d1d4d15ceb4..73c3f632812 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -719,7 +719,6 @@ class IMAGE_PT_view_display(Panel): ima = sima.image show_uvedit = sima.show_uvedit - show_maskedit = sima.show_maskedit uvedit = sima.uv_editor col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 4b21f5ec96f..4cda2678e33 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -294,10 +294,11 @@ class _draw_left_context_mode: if tool is None: return - is_paint = True + # is_paint = True # FIXME: tools must use their own UI drawing! if tool.idname in {"builtin.line", "builtin.box", "builtin.circle", "builtin.arc", "builtin.curve"}: - is_paint = False + # is_paint = False + pass elif tool.idname == "Cutter": row = layout.row(align=True) row.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index d1fd250991f..5b87dd0883a 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1518,7 +1518,6 @@ class USERPREF_PT_input_tablet(PreferencePanel, Panel): @classmethod def poll(cls, context): prefs = context.preferences - inputs = prefs.inputs return prefs.active_section == 'INPUT' def draw_props(self, context, layout): diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 867ecf05739..d0e278aee7d 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -135,7 +135,6 @@ class VIEW3D_HT_header(Header): # Orientation if object_mode in {'OBJECT', 'EDIT', 'EDIT_GPENCIL'} or has_pose_mode: orient_slot = scene.transform_orientation_slots[0] - custom_orientation = orient_slot.custom_orientation trans_name, trans_icon = orient_slot.ui_info() row = layout.row(align=True) @@ -651,7 +650,6 @@ class VIEW3D_MT_view_local(Menu): def draw(self, context): layout = self.layout - view = context.space_data layout.operator("view3d.localview", text="Toggle Local View") layout.operator("view3d.localview_remove_from") @@ -4333,13 +4331,14 @@ class VIEW3D_PT_collections(Panel): need_separator = False icon = 'BLANK1' - has_objects = True + # has_objects = True if child.has_selected_objects(view_layer): icon = 'LAYER_ACTIVE' elif child.has_objects(): icon = 'LAYER_USED' else: - has_objects = False + # has_objects = False + pass row = layout.row() sub = row.split(factor=0.98) @@ -4365,7 +4364,7 @@ class VIEW3D_PT_collections(Panel): layout.use_property_split = False layout.label(text="Collections Visibility") - col = layout.column() + layout.column() view_layer = context.view_layer # We pass index 0 here beause the index is increased @@ -4891,7 +4890,6 @@ class VIEW3D_PT_overlay_edit_mesh(Panel): view = context.space_data overlay = view.overlay - shading = view.shading display_all = overlay.show_overlays col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 0f7305800be..a37e54d40a8 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1663,7 +1663,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel): return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'} def draw(self, context): - layout = self.layout + pass class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel): diff --git a/tests/python/pep8.py b/tests/python/pep8.py index 78f0c82d00f..fde86892782 100644 --- a/tests/python/pep8.py +++ b/tests/python/pep8.py @@ -45,7 +45,7 @@ FORCE_PEP8_ALL = False def file_list_py(path): - for dirpath, dirnames, filenames in os.walk(path): + for dirpath, _dirnames, filenames in os.walk(path): for filename in filenames: if filename.endswith((".py", ".cfg")): yield os.path.join(dirpath, filename) |