Cleanup: unused variables

This commit is contained in:
2019-03-17 21:13:25 +11:00
parent ad9addbf46
commit 69bf4e5e36
18 changed files with 20 additions and 30 deletions

View File

@@ -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.

View File

@@ -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")

View File

@@ -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()

View File

@@ -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

View File

@@ -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'.'}:

View File

@@ -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