Cleanup: unused variables
This commit is contained in:
@@ -470,7 +470,7 @@ def reset_all(*, reload_scripts=False):
|
|||||||
|
|
||||||
for path in paths_list:
|
for path in paths_list:
|
||||||
_bpy.utils._sys_path_ensure(path)
|
_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)
|
is_enabled, is_loaded = check(mod_name)
|
||||||
|
|
||||||
# first check if reload is needed before changing state.
|
# first check if reload is needed before changing state.
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False):
|
|||||||
fw = fh.write
|
fw = fh.write
|
||||||
fw("keyconfig_data = \\\n[")
|
fw("keyconfig_data = \\\n[")
|
||||||
|
|
||||||
for km, kc_x in export_keymaps:
|
for km, _kc_x in export_keymaps:
|
||||||
km = km.active()
|
km = km.active()
|
||||||
fw("(")
|
fw("(")
|
||||||
fw(f"\"{km.name:s}\",\n")
|
fw(f"\"{km.name:s}\",\n")
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern):
|
|||||||
camera = bpy.data.objects[render_context.camera, None]
|
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
|
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)
|
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
|
camera.location = loc
|
||||||
# Set camera clipping accordingly to computed bbox.
|
# Set camera clipping accordingly to computed bbox.
|
||||||
min_dist = 1e24
|
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_start = min_dist / 2
|
||||||
camera.data.clip_end = max_dist * 2
|
camera.data.clip_end = max_dist * 2
|
||||||
if light:
|
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
|
light.location = loc
|
||||||
scene.update()
|
scene.update()
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ def modules_from_path(path, loaded_modules):
|
|||||||
"""
|
"""
|
||||||
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)
|
mod = _test_import(mod_name, loaded_modules)
|
||||||
if mod:
|
if mod:
|
||||||
modules.append(mod)
|
modules.append(mod)
|
||||||
@@ -868,7 +868,6 @@ def unregister_tool(tool_cls):
|
|||||||
del tool_list[-1]
|
del tool_list[-1]
|
||||||
while tool_list and tool_list[0] is None:
|
while tool_list and tool_list[0] is None:
|
||||||
del tool_list[0]
|
del tool_list[0]
|
||||||
is_none_prev = False
|
|
||||||
# Remove duplicate separators.
|
# Remove duplicate separators.
|
||||||
for i in range(len(tool_list) - 1, -1, -1):
|
for i in range(len(tool_list) - 1, -1, -1):
|
||||||
is_none = tool_list[i] is None
|
is_none = tool_list[i] is None
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ def load_image(imagepath,
|
|||||||
|
|
||||||
def _recursive_search(paths, filename_check):
|
def _recursive_search(paths, filename_check):
|
||||||
for path in paths:
|
for path in paths:
|
||||||
for dirpath, dirnames, filenames in os.walk(path):
|
for dirpath, _dirnames, filenames in os.walk(path):
|
||||||
|
|
||||||
# skip '.svn'
|
# skip '.svn'
|
||||||
if dirpath[0] in {".", b'.'}:
|
if dirpath[0] in {".", b'.'}:
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class ShaderWrapper():
|
|||||||
if self._node_texcoords is None and not self.is_readonly:
|
if self._node_texcoords is None and not self.is_readonly:
|
||||||
tree = self.material.node_tree
|
tree = self.material.node_tree
|
||||||
nodes = tree.nodes
|
nodes = tree.nodes
|
||||||
links = tree.links
|
# links = tree.links
|
||||||
|
|
||||||
node_texcoords = nodes.new(type='ShaderNodeTexCoord')
|
node_texcoords = nodes.new(type='ShaderNodeTexCoord')
|
||||||
node_texcoords.label = "Texture Coords"
|
node_texcoords.label = "Texture Coords"
|
||||||
@@ -521,8 +521,8 @@ class ShaderImageTextureWrapper():
|
|||||||
self._node_mapping = ...
|
self._node_mapping = ...
|
||||||
|
|
||||||
tree = node_dst.id_data
|
tree = node_dst.id_data
|
||||||
nodes = tree.nodes
|
# nodes = tree.nodes
|
||||||
links = tree.links
|
# links = tree.links
|
||||||
|
|
||||||
if socket_dst.is_linked:
|
if socket_dst.is_linked:
|
||||||
from_node = socket_dst.links[0].from_node
|
from_node = socket_dst.links[0].from_node
|
||||||
|
|||||||
@@ -99,10 +99,10 @@ def add_uvs(mesh, minor_seg, major_seg):
|
|||||||
|
|
||||||
u_prev = u_init
|
u_prev = u_init
|
||||||
u_next = u_prev + u_step
|
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_prev = v_init
|
||||||
v_next = v_prev + v_step
|
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
|
loops = polygons[vertex_index].loop_indices
|
||||||
uv_data[loops[0]].uv = u_prev, v_prev
|
uv_data[loops[0]].uv = u_prev, v_prev
|
||||||
uv_data[loops[1]].uv = u_next, v_prev
|
uv_data[loops[1]].uv = u_next, v_prev
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ class DATA_PT_context_gpencil(DataButtonsPanel, Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
ob = context.object
|
ob = context.object
|
||||||
gpencil = context.gpencil
|
|
||||||
space = context.space_data
|
space = context.space_data
|
||||||
|
|
||||||
if ob:
|
if ob:
|
||||||
|
|||||||
@@ -249,7 +249,6 @@ class GreasePencilStrokeSculptPanel:
|
|||||||
layout.use_property_decorate = False
|
layout.use_property_decorate = False
|
||||||
|
|
||||||
settings = context.tool_settings.gpencil_sculpt
|
settings = context.tool_settings.gpencil_sculpt
|
||||||
tool = settings.sculpt_tool
|
|
||||||
brush = settings.brush
|
brush = settings.brush
|
||||||
|
|
||||||
layout.template_icon_view(settings, "sculpt_tool", show_labels=True)
|
layout.template_icon_view(settings, "sculpt_tool", show_labels=True)
|
||||||
|
|||||||
@@ -1000,7 +1000,6 @@ class PARTICLE_PT_physics_fluid_interaction(ParticleButtonsPanel, Panel):
|
|||||||
layout.use_property_split = True
|
layout.use_property_split = True
|
||||||
|
|
||||||
psys = context.particle_system
|
psys = context.particle_system
|
||||||
part = particle_get_settings(context)
|
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_list("UI_UL_list", "particle_targets", psys, "targets",
|
row.template_list("UI_UL_list", "particle_targets", psys, "targets",
|
||||||
|
|||||||
@@ -491,7 +491,6 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
|
|||||||
layout.use_property_split = True
|
layout.use_property_split = True
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
props = scene.eevee
|
|
||||||
rd = scene.render
|
rd = scene.render
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
|||||||
@@ -383,8 +383,6 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
sc = context.space_data
|
|
||||||
|
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
row.operator("clip.add_marker_at_click", text="Add")
|
row.operator("clip.add_marker_at_click", text="Add")
|
||||||
|
|||||||
@@ -719,7 +719,6 @@ class IMAGE_PT_view_display(Panel):
|
|||||||
ima = sima.image
|
ima = sima.image
|
||||||
|
|
||||||
show_uvedit = sima.show_uvedit
|
show_uvedit = sima.show_uvedit
|
||||||
show_maskedit = sima.show_maskedit
|
|
||||||
uvedit = sima.uv_editor
|
uvedit = sima.uv_editor
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
|||||||
@@ -294,10 +294,11 @@ class _draw_left_context_mode:
|
|||||||
if tool is None:
|
if tool is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
is_paint = True
|
# is_paint = True
|
||||||
# FIXME: tools must use their own UI drawing!
|
# FIXME: tools must use their own UI drawing!
|
||||||
if tool.idname in {"builtin.line", "builtin.box", "builtin.circle", "builtin.arc", "builtin.curve"}:
|
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":
|
elif tool.idname == "Cutter":
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
row.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
||||||
|
|||||||
@@ -1518,7 +1518,6 @@ class USERPREF_PT_input_tablet(PreferencePanel, Panel):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
prefs = context.preferences
|
prefs = context.preferences
|
||||||
inputs = prefs.inputs
|
|
||||||
return prefs.active_section == 'INPUT'
|
return prefs.active_section == 'INPUT'
|
||||||
|
|
||||||
def draw_props(self, context, layout):
|
def draw_props(self, context, layout):
|
||||||
|
|||||||
@@ -135,7 +135,6 @@ class VIEW3D_HT_header(Header):
|
|||||||
# Orientation
|
# Orientation
|
||||||
if object_mode in {'OBJECT', 'EDIT', 'EDIT_GPENCIL'} or has_pose_mode:
|
if object_mode in {'OBJECT', 'EDIT', 'EDIT_GPENCIL'} or has_pose_mode:
|
||||||
orient_slot = scene.transform_orientation_slots[0]
|
orient_slot = scene.transform_orientation_slots[0]
|
||||||
custom_orientation = orient_slot.custom_orientation
|
|
||||||
trans_name, trans_icon = orient_slot.ui_info()
|
trans_name, trans_icon = orient_slot.ui_info()
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
@@ -651,7 +650,6 @@ class VIEW3D_MT_view_local(Menu):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
view = context.space_data
|
|
||||||
|
|
||||||
layout.operator("view3d.localview", text="Toggle Local View")
|
layout.operator("view3d.localview", text="Toggle Local View")
|
||||||
layout.operator("view3d.localview_remove_from")
|
layout.operator("view3d.localview_remove_from")
|
||||||
@@ -4333,13 +4331,14 @@ class VIEW3D_PT_collections(Panel):
|
|||||||
need_separator = False
|
need_separator = False
|
||||||
|
|
||||||
icon = 'BLANK1'
|
icon = 'BLANK1'
|
||||||
has_objects = True
|
# has_objects = True
|
||||||
if child.has_selected_objects(view_layer):
|
if child.has_selected_objects(view_layer):
|
||||||
icon = 'LAYER_ACTIVE'
|
icon = 'LAYER_ACTIVE'
|
||||||
elif child.has_objects():
|
elif child.has_objects():
|
||||||
icon = 'LAYER_USED'
|
icon = 'LAYER_USED'
|
||||||
else:
|
else:
|
||||||
has_objects = False
|
# has_objects = False
|
||||||
|
pass
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
sub = row.split(factor=0.98)
|
sub = row.split(factor=0.98)
|
||||||
@@ -4365,7 +4364,7 @@ class VIEW3D_PT_collections(Panel):
|
|||||||
layout.use_property_split = False
|
layout.use_property_split = False
|
||||||
|
|
||||||
layout.label(text="Collections Visibility")
|
layout.label(text="Collections Visibility")
|
||||||
col = layout.column()
|
layout.column()
|
||||||
|
|
||||||
view_layer = context.view_layer
|
view_layer = context.view_layer
|
||||||
# We pass index 0 here beause the index is increased
|
# 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
|
view = context.space_data
|
||||||
overlay = view.overlay
|
overlay = view.overlay
|
||||||
shading = view.shading
|
|
||||||
display_all = overlay.show_overlays
|
display_all = overlay.show_overlays
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
|||||||
@@ -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'}
|
return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'}
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
pass
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel):
|
class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel):
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ FORCE_PEP8_ALL = False
|
|||||||
|
|
||||||
|
|
||||||
def file_list_py(path):
|
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:
|
for filename in filenames:
|
||||||
if filename.endswith((".py", ".cfg")):
|
if filename.endswith((".py", ".cfg")):
|
||||||
yield os.path.join(dirpath, filename)
|
yield os.path.join(dirpath, filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user