Cleanup: unused variables

This commit is contained in:
Campbell Barton 2021-03-06 18:16:39 +11:00
parent 753f1cf0ad
commit bd79691599
Notes: blender-bot 2023-02-14 03:44:41 +01:00
Referenced by commit ccb372d17c, Fix regression in bd79691599
14 changed files with 17 additions and 33 deletions

View File

@ -89,7 +89,7 @@ def protect_format_seq(msg):
PDF = "\u202C"
LRO = "\u202D"
RLO = "\u202E"
uctrl = {LRE, RLE, PDF, LRO, RLO}
# uctrl = {LRE, RLE, PDF, LRO, RLO}
# Most likely incomplete, but seems to cover current needs.
format_codes = set("tslfd")
digits = set(".0123456789")

View File

@ -283,7 +283,8 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern):
return cos
def preview_render_do(render_context, item_container, item_name, objects, offset_matrix=None):
scene = bpy.data.scenes[render_context.scene, None]
# Unused.
# scene = bpy.data.scenes[render_context.scene, None]
if objects is not 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

View File

@ -113,7 +113,6 @@ def object_data_add(context, obdata, operator=None, name=None):
:return: the newly created object in the scene.
:rtype: :class:`bpy.types.Object`
"""
scene = context.scene
layer = context.view_layer
layer_collection = context.layer_collection or layer.active_layer_collection
scene_collection = layer_collection.collection

View File

@ -622,8 +622,8 @@ def BuildRNAInfo():
yield (rna_sub_type_name, rna_sub_struct)
i += 1
for (rna_type_name, rna_struct) in _bpy_types_iterator():
# if not rna_type_name.startswith('__'):
for (_rna_type_name, rna_struct) in _bpy_types_iterator():
# if not _rna_type_name.startswith('__'):
identifier = rna_struct.identifier

View File

@ -392,7 +392,6 @@ class DATA_PT_gpencil_display(DataButtonsPanel, Panel):
layout.use_property_decorate = False
gpd = context.gpencil
gpl = gpd.layers.active
layout.prop(gpd, "edit_line_color", text="Edit Line Color")

View File

@ -37,8 +37,6 @@ class AnnotationDrawingToolsPanel:
tool_settings = context.tool_settings
is_clip_editor = context.space_data.type == 'CLIP_EDITOR'
col = layout.column(align=True)
col.label(text="Draw:")
@ -337,7 +335,6 @@ class GPENCIL_MT_material_active(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
ob = context.active_object
mat_active = ob.active_material
for slot in ob.material_slots:
mat = slot.material

View File

@ -614,7 +614,6 @@ def brush_settings(layout, context, brush, popover=False):
# use_persistent, set_persistent_base
if capabilities.has_persistence:
ob = context.sculpt_object
layout.separator()
layout.prop(brush, "use_persistent")
layout.operator("sculpt.set_persistent_base")
@ -1318,7 +1317,6 @@ def brush_basic_gpencil_sculpt_settings(layout, context, brush, *, compact=False
def brush_basic_gpencil_weight_settings(layout, _context, brush, *, compact=False):
gp_settings = brush.gpencil_settings
layout.prop(brush, "size", slider=True)
row = layout.row(align=True)

View File

@ -77,8 +77,6 @@ class VIEWLAYER_PT_eevee_layer_passes_data(ViewLayerButtonsPanel, Panel):
layout.use_property_split = True
layout.use_property_decorate = False
scene = context.scene
rd = scene.render
view_layer = context.view_layer
col = layout.column()
@ -101,8 +99,6 @@ class VIEWLAYER_PT_eevee_layer_passes_light(ViewLayerButtonsPanel, Panel):
view_layer = context.view_layer
view_layer_eevee = view_layer.eevee
scene = context.scene
scene_eevee = scene.eevee
col = layout.column(heading="Diffuse", align=True)
col.prop(view_layer, "use_pass_diffuse_direct", text="Light")

View File

@ -278,7 +278,6 @@ class OUTLINER_MT_object(Menu):
layout = self.layout
space = context.space_data
obj = context.active_object
layout.operator("outliner.id_copy", text="Copy", icon='COPYDOWN')
layout.operator("outliner.id_paste", text="Paste", icon='PASTEDOWN')

View File

@ -113,6 +113,10 @@ class SEQUENCER_HT_tool_header(Header):
# TODO: options popover.
def draw_tool_settings(self, context):
pass
# Currently unused.
'''
layout = self.layout
# Active Tool
@ -120,6 +124,7 @@ class SEQUENCER_HT_tool_header(Header):
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
tool = ToolSelectPanelHelper.draw_active_tool_header(context, layout)
tool_mode = context.mode if tool is None else tool.mode
'''
class SEQUENCER_HT_header(Header):
@ -129,8 +134,6 @@ class SEQUENCER_HT_header(Header):
layout = self.layout
st = context.space_data
scene = context.scene
sequencer_tool_settings = context.tool_settings.sequencer_tool_settings
show_region_tool_header = st.show_region_tool_header
@ -336,8 +339,6 @@ class SEQUENCER_MT_view(Menu):
st = context.space_data
is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
is_sequencer_view = st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}
scene = context.scene
ed = scene.sequence_editor
if st.view_type == 'PREVIEW':
# Specifying the REGION_PREVIEW context is needed in preview-only
@ -1904,7 +1905,6 @@ class SEQUENCER_PT_strip_proxy(SequencerButtonsPanel, Panel):
if strip.proxy:
proxy = strip.proxy
flow = layout.column_flow()
if ed.proxy_storage == 'PER_STRIP':
col = layout.column(heading="Custom Proxy")
col.prop(proxy, "use_proxy_custom_directory", text="Directory")

View File

@ -2412,7 +2412,7 @@ class _defs_sequencer_generic:
@ToolDef.from_fn
def sample():
def draw_settings(_context, layout, tool):
props = tool.operator_properties("sequencer.sample")
tool.operator_properties("sequencer.sample")
return dict(
idname="builtin.sample",
label="Sample",

View File

@ -642,7 +642,7 @@ class USERPREF_PT_system_video_sequencer(SystemPanel, CenterAlignMixIn, Panel):
def draw_centered(self, context, layout):
prefs = context.preferences
system = prefs.system
edit = prefs.edit
# edit = prefs.edit
layout.prop(system, "memory_cache_limit")

View File

@ -7009,10 +7009,9 @@ class VIEW3D_PT_gpencil_curve_edit(Panel):
bl_label = "Curve Editing"
def draw(self, context):
gpd = context.gpencil_data
settings = context.tool_settings.gpencil_sculpt
layout = self.layout
gpd = context.gpencil_data
col = layout.column(align=True)
col.prop(gpd, "edit_curve_resolution")
col.prop(gpd, "curve_edit_threshold")

View File

@ -199,8 +199,6 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
ob = context.active_object
mesh = ob.data
split = layout.split()
row = layout.row(align=True, heading="Transform")
row.prop(tool_settings, "use_transform_correct_face_attributes")
@ -1352,8 +1350,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_select(Panel, View3DPanel, GreasePenci
if context.mode == 'PAINT_GPENCIL':
brush = tool_settings.gpencil_paint.brush
if brush is not None:
gp_settings = brush.gpencil_settings
col.prop(brush, "use_custom_icon", toggle=True, icon='FILE_IMAGE', text="")
if brush.use_custom_icon:
@ -1493,7 +1489,8 @@ class VIEW3D_PT_tools_grease_pencil_brush_stroke(Panel, View3DPanel):
return brush is not None and brush.gpencil_tool == 'DRAW'
def draw(self, context):
layout = self.layout
# layout = self.layout
pass
class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(Panel, View3DPanel):
@ -1850,7 +1847,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_weight_falloff(GreasePencilBrushFallof
ts = context.tool_settings
settings = ts.gpencil_weight_paint
brush = settings.brush
return (settings and settings.brush and settings.brush.curve)
return (brush and brush.curve)
# Grease Pencil vertex painting tools
@ -1942,7 +1939,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_vertex_color(View3DPanel, Panel):
ts = context.tool_settings
settings = ts.gpencil_vertex_paint
brush = settings.brush
gp_settings = brush.gpencil_settings
col = layout.column()