[Bf-blender-cvs] [bd796915999] master: Cleanup: unused variables
Campbell Barton
noreply at git.blender.org
Sat Mar 6 09:33:29 CET 2021
Commit: bd7969159997b8802d54e79a002350a7fb97944d
Author: Campbell Barton
Date: Sat Mar 6 18:16:39 2021 +1100
Branches: master
https://developer.blender.org/rBbd7969159997b8802d54e79a002350a7fb97944d
Cleanup: unused variables
===================================================================
M release/scripts/modules/bl_i18n_utils/utils_rtl.py
M release/scripts/modules/bl_previews_utils/bl_previews_render.py
M release/scripts/modules/bpy_extras/object_utils.py
M release/scripts/modules/rna_info.py
M release/scripts/startup/bl_ui/properties_data_gpencil.py
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M release/scripts/startup/bl_ui/properties_paint_common.py
M release/scripts/startup/bl_ui/properties_view_layer.py
M release/scripts/startup/bl_ui/space_outliner.py
M release/scripts/startup/bl_ui/space_sequencer.py
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M release/scripts/startup/bl_ui/space_userpref.py
M release/scripts/startup/bl_ui/space_view3d.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
diff --git a/release/scripts/modules/bl_i18n_utils/utils_rtl.py b/release/scripts/modules/bl_i18n_utils/utils_rtl.py
index 2b6a56c5deb..041dd477406 100755
--- a/release/scripts/modules/bl_i18n_utils/utils_rtl.py
+++ b/release/scripts/modules/bl_i18n_utils/utils_rtl.py
@@ -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")
diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
index 6e3d04e7fa2..979b47f7a14 100644
--- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py
+++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
@@ -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
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index 8afb09882fd..b20800c4207 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -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
diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py
index 964eff0e572..3bcc709ab72 100644
--- a/release/scripts/modules/rna_info.py
+++ b/release/scripts/modules/rna_info.py
@@ -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
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 9db6eedb04c..69720a6c54b 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -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")
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 0eb5d60457c..c23cc838e51 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -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
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index dfdc6ab79f4..1f1d407bd10 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -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)
diff --git a/release/scripts/startup/bl_ui/properties_view_layer.py b/release/scripts/startup/bl_ui/properties_view_layer.py
index 8c39684583f..ae6cc56b730 100644
--- a/release/scripts/startup/bl_ui/properties_view_layer.py
+++ b/release/scripts/startup/bl_ui/properties_view_layer.py
@@ -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")
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index 43a5e17e50e..012ab038569 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -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')
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index e10f3383bc8..fa7082e139a 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -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")
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 8e99c3af4c3..913fa7ea48a 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -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",
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 94a1e2bec4d..b61daf0e472 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -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")
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 41a1831f46a..08d128b6023 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -7009,10 +7009,9 @@ class VIEW3D_PT_gpencil_curve_edit(Panel):
bl_label = "Curve Editing"
def draw(self, context):
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list