Cleanup: unused variables

This commit is contained in:
Campbell Barton 2018-10-25 12:03:34 +11:00
parent bf34f95a9e
commit 23fdac8672
10 changed files with 12 additions and 21 deletions

View File

@ -624,7 +624,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
fg.use_sky = True
if not view_layers.get("Background"):
bg = view_layers.new("Background")
_bg = view_layers.new("Background")
@staticmethod
def createCollection(context, collection_name):
@ -969,8 +969,6 @@ class CLIP_OT_setup_tracking_scene(Operator):
setup_shadow_catcher_objects(bg_coll)
def execute(self, context):
scene = context.scene
self._setupScene(context)
self._setupWorld(context)
self._setupCamera(context)

View File

@ -254,7 +254,7 @@ class SubdivisionSet(Operator):
if not relative:
if level > mod.total_levels:
sub = level - mod.total_levels
for i in range(sub):
for _ in range(sub):
bpy.ops.object.multires_subdivide(modifier="Multires")
if obj.mode == 'SCULPT':
@ -287,7 +287,7 @@ class SubdivisionSet(Operator):
if obj.mode == 'SCULPT':
mod = obj.modifiers.new("Multires", 'MULTIRES')
if level > 0:
for i in range(0, level):
for _ in range(level):
bpy.ops.object.multires_subdivide(modifier="Multires")
else:
mod = obj.modifiers.new("Subsurf", 'SUBSURF')

View File

@ -1521,7 +1521,6 @@ class WM_OT_copy_prev_settings(Operator):
return os.path.isfile(old_userpref) and not os.path.isfile(new_userpref)
def execute(self, context):
import os
import shutil
shutil.copytree(self._old_path(), self._new_path(), symlinks=True)
@ -2204,7 +2203,7 @@ class WM_OT_addon_remove(Operator):
# lame confirmation check
def draw(self, context):
self.layout.label(text="Remove Add-on: %r?" % self.module)
path, isdir = WM_OT_addon_remove.path_from_addon(self.module)
path, _isdir = WM_OT_addon_remove.path_from_addon(self.module)
self.layout.label(text="Path: %r" % path)
def invoke(self, context, event):

View File

@ -18,7 +18,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel, Menu
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
from bl_operators.presets import PresetMenu

View File

@ -64,7 +64,6 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
layout.use_property_split = True
md = context.cloth
ob = context.object
cloth = md.settings
layout.active = cloth_panel_enabled(md)
@ -236,7 +235,6 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
cloth = context.cloth.collision_settings
md = context.cloth
ob = context.object
layout.active = (cloth.use_collision or cloth.use_self_collision) and cloth_panel_enabled(md)

View File

@ -390,7 +390,6 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
layout = self.layout
sc = context.space_data
clip = sc.clip
col = layout.column(align=True)
row = col.row(align=True)
@ -812,7 +811,6 @@ class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel):
layout.use_property_decorate = False
clip = context.space_data.clip
settings = clip.tracking.settings
col = layout.column()

View File

@ -515,7 +515,6 @@ class IMAGE_HT_header(Header):
ima = sima.image
iuser = sima.image_user
toolsettings = context.tool_settings
mode = sima.mode
show_render = sima.show_render
show_uvedit = sima.show_uvedit

View File

@ -584,7 +584,7 @@ class WM_MT_toolsystem_submenu(Menu):
layout = self.layout
layout.scale_y = 2.0
cls, item_group = self._tool_group_from_button(context)
_cls, item_group = self._tool_group_from_button(context)
if item_group is None:
# Should never happen, just in case
layout.label(text="Unable to find toolbar group")
@ -616,7 +616,7 @@ def _activate_by_item(context, space_type, item, index):
def activate_by_name(context, space_type, text):
cls, item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
_cls, item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
if item is None:
return False
_activate_by_item(context, space_type, item, index)
@ -626,7 +626,7 @@ def activate_by_name(context, space_type, text):
def activate_by_name_or_cycle(context, space_type, text, offset=1):
# Only cycle when the active tool is activated again.
cls, item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
cls, item, _index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
if item is None:
return False
@ -637,7 +637,7 @@ def activate_by_name_or_cycle(context, space_type, text, offset=1):
for item_group in cls.tools_from_context(context):
if type(item_group) is tuple:
index_current = cls._tool_group_active.get(item_group[0].text, 0)
for i, sub_item in enumerate(item_group):
for sub_item in item_group:
if sub_item.text == text:
text_current = item_group[index_current].text
break
@ -660,7 +660,7 @@ def activate_by_name_or_cycle(context, space_type, text, offset=1):
def description_from_name(context, space_type, text, *, use_operator=True):
# Used directly for tooltips.
cls, item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
_cls, item, _index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
if item is None:
return False
@ -685,7 +685,7 @@ def description_from_name(context, space_type, text, *, use_operator=True):
def keymap_from_name(context, space_type, text):
# Used directly for tooltips.
cls, item, index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
_cls, item, _index = ToolSelectPanelHelper._tool_get_by_name(context, space_type, text)
if item is None:
return False

View File

@ -1441,7 +1441,7 @@ class USERPREF_PT_addons(Panel):
"wm.addon_remove", text="Remove", icon='CANCEL',
).module = mod.__name__
for i in range(4 - tot_row):
for _ in range(4 - tot_row):
split.separator()
# Show addon user preferences

View File

@ -3847,7 +3847,6 @@ class VIEW3D_MT_orientations_pie(Menu):
layout = self.layout
pie = layout.menu_pie()
scene = context.scene
orientation = scene.current_orientation
pie.prop(scene, "transform_orientation", expand=True)