Cleanup: unused variables
This commit is contained in:
@@ -624,7 +624,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
|||||||
fg.use_sky = True
|
fg.use_sky = True
|
||||||
|
|
||||||
if not view_layers.get("Background"):
|
if not view_layers.get("Background"):
|
||||||
bg = view_layers.new("Background")
|
_bg = view_layers.new("Background")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def createCollection(context, collection_name):
|
def createCollection(context, collection_name):
|
||||||
@@ -969,8 +969,6 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
|||||||
setup_shadow_catcher_objects(bg_coll)
|
setup_shadow_catcher_objects(bg_coll)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
scene = context.scene
|
|
||||||
|
|
||||||
self._setupScene(context)
|
self._setupScene(context)
|
||||||
self._setupWorld(context)
|
self._setupWorld(context)
|
||||||
self._setupCamera(context)
|
self._setupCamera(context)
|
||||||
|
@@ -254,7 +254,7 @@ class SubdivisionSet(Operator):
|
|||||||
if not relative:
|
if not relative:
|
||||||
if level > mod.total_levels:
|
if level > mod.total_levels:
|
||||||
sub = 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")
|
bpy.ops.object.multires_subdivide(modifier="Multires")
|
||||||
|
|
||||||
if obj.mode == 'SCULPT':
|
if obj.mode == 'SCULPT':
|
||||||
@@ -287,7 +287,7 @@ class SubdivisionSet(Operator):
|
|||||||
if obj.mode == 'SCULPT':
|
if obj.mode == 'SCULPT':
|
||||||
mod = obj.modifiers.new("Multires", 'MULTIRES')
|
mod = obj.modifiers.new("Multires", 'MULTIRES')
|
||||||
if level > 0:
|
if level > 0:
|
||||||
for i in range(0, level):
|
for _ in range(level):
|
||||||
bpy.ops.object.multires_subdivide(modifier="Multires")
|
bpy.ops.object.multires_subdivide(modifier="Multires")
|
||||||
else:
|
else:
|
||||||
mod = obj.modifiers.new("Subsurf", 'SUBSURF')
|
mod = obj.modifiers.new("Subsurf", 'SUBSURF')
|
||||||
|
@@ -1521,7 +1521,6 @@ class WM_OT_copy_prev_settings(Operator):
|
|||||||
return os.path.isfile(old_userpref) and not os.path.isfile(new_userpref)
|
return os.path.isfile(old_userpref) and not os.path.isfile(new_userpref)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
import os
|
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
shutil.copytree(self._old_path(), self._new_path(), symlinks=True)
|
shutil.copytree(self._old_path(), self._new_path(), symlinks=True)
|
||||||
@@ -2204,7 +2203,7 @@ class WM_OT_addon_remove(Operator):
|
|||||||
# lame confirmation check
|
# lame confirmation check
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.layout.label(text="Remove Add-on: %r?" % self.module)
|
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)
|
self.layout.label(text="Path: %r" % path)
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Panel, Menu
|
from bpy.types import Panel
|
||||||
from rna_prop_ui import PropertyPanel
|
from rna_prop_ui import PropertyPanel
|
||||||
from bl_operators.presets import PresetMenu
|
from bl_operators.presets import PresetMenu
|
||||||
|
|
||||||
|
@@ -64,7 +64,6 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
|
|||||||
layout.use_property_split = True
|
layout.use_property_split = True
|
||||||
|
|
||||||
md = context.cloth
|
md = context.cloth
|
||||||
ob = context.object
|
|
||||||
cloth = md.settings
|
cloth = md.settings
|
||||||
|
|
||||||
layout.active = cloth_panel_enabled(md)
|
layout.active = cloth_panel_enabled(md)
|
||||||
@@ -236,7 +235,6 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
|
|||||||
|
|
||||||
cloth = context.cloth.collision_settings
|
cloth = context.cloth.collision_settings
|
||||||
md = context.cloth
|
md = context.cloth
|
||||||
ob = context.object
|
|
||||||
|
|
||||||
layout.active = (cloth.use_collision or cloth.use_self_collision) and cloth_panel_enabled(md)
|
layout.active = (cloth.use_collision or cloth.use_self_collision) and cloth_panel_enabled(md)
|
||||||
|
|
||||||
|
@@ -390,7 +390,6 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
sc = context.space_data
|
sc = context.space_data
|
||||||
clip = sc.clip
|
|
||||||
|
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
row = col.row(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
|
layout.use_property_decorate = False
|
||||||
|
|
||||||
clip = context.space_data.clip
|
clip = context.space_data.clip
|
||||||
settings = clip.tracking.settings
|
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
|
||||||
|
@@ -515,7 +515,6 @@ class IMAGE_HT_header(Header):
|
|||||||
ima = sima.image
|
ima = sima.image
|
||||||
iuser = sima.image_user
|
iuser = sima.image_user
|
||||||
toolsettings = context.tool_settings
|
toolsettings = context.tool_settings
|
||||||
mode = sima.mode
|
|
||||||
|
|
||||||
show_render = sima.show_render
|
show_render = sima.show_render
|
||||||
show_uvedit = sima.show_uvedit
|
show_uvedit = sima.show_uvedit
|
||||||
|
@@ -584,7 +584,7 @@ class WM_MT_toolsystem_submenu(Menu):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.scale_y = 2.0
|
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:
|
if item_group is None:
|
||||||
# Should never happen, just in case
|
# Should never happen, just in case
|
||||||
layout.label(text="Unable to find toolbar group")
|
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):
|
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:
|
if item is None:
|
||||||
return False
|
return False
|
||||||
_activate_by_item(context, space_type, item, index)
|
_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):
|
def activate_by_name_or_cycle(context, space_type, text, offset=1):
|
||||||
|
|
||||||
# Only cycle when the active tool is activated again.
|
# 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:
|
if item is None:
|
||||||
return False
|
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):
|
for item_group in cls.tools_from_context(context):
|
||||||
if type(item_group) is tuple:
|
if type(item_group) is tuple:
|
||||||
index_current = cls._tool_group_active.get(item_group[0].text, 0)
|
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:
|
if sub_item.text == text:
|
||||||
text_current = item_group[index_current].text
|
text_current = item_group[index_current].text
|
||||||
break
|
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):
|
def description_from_name(context, space_type, text, *, use_operator=True):
|
||||||
# Used directly for tooltips.
|
# 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:
|
if item is None:
|
||||||
return False
|
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):
|
def keymap_from_name(context, space_type, text):
|
||||||
# Used directly for tooltips.
|
# 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:
|
if item is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@@ -1441,7 +1441,7 @@ class USERPREF_PT_addons(Panel):
|
|||||||
"wm.addon_remove", text="Remove", icon='CANCEL',
|
"wm.addon_remove", text="Remove", icon='CANCEL',
|
||||||
).module = mod.__name__
|
).module = mod.__name__
|
||||||
|
|
||||||
for i in range(4 - tot_row):
|
for _ in range(4 - tot_row):
|
||||||
split.separator()
|
split.separator()
|
||||||
|
|
||||||
# Show addon user preferences
|
# Show addon user preferences
|
||||||
|
@@ -3847,7 +3847,6 @@ class VIEW3D_MT_orientations_pie(Menu):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
pie = layout.menu_pie()
|
pie = layout.menu_pie()
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
orientation = scene.current_orientation
|
|
||||||
|
|
||||||
pie.prop(scene, "transform_orientation", expand=True)
|
pie.prop(scene, "transform_orientation", expand=True)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user