Cleanup: remove unused variables & imports in scripts/

This commit is contained in:
Campbell Barton 2023-11-10 10:06:41 +11:00
parent a615dcdfa8
commit 8eb5223663
11 changed files with 1 additions and 22 deletions

@ -153,8 +153,6 @@ def draw(layout, context, context_member, property_type, *, use_edit=True):
if not rna_item:
return
from bpy.utils import escape_identifier
if rna_item.id_data.library is not None:
use_edit = False
is_lib_override = rna_item.id_data.override_library and rna_item.id_data.override_library.reference

@ -4,12 +4,6 @@
from __future__ import annotations
if "bpy" in locals():
from importlib import reload
if "anim_utils" in locals():
reload(anim_utils)
del reload
import bpy
from bpy.types import Operator

@ -284,7 +284,6 @@ class NewGeometryNodeTreeAssign(Operator):
return geometry_modifier_poll(context)
def execute(self, context):
space = context.space_data
modifier = get_context_modifier(context)
if not modifier:
return {'CANCELLED'}

@ -166,8 +166,6 @@ class NodeAddZoneOperator(NodeAddOperator):
space = context.space_data
tree = space.edit_tree
props = self.properties
self.deselect_nodes(context)
input_node = self.create_node(context, self.input_node_type)
output_node = self.create_node(context, self.output_node_type)

@ -219,7 +219,6 @@ def extend(obj, EXTEND_MODE, use_uv_selection):
def main(context, operator):
use_uv_selection = True
view = context.space_data
if context.space_data and context.space_data.type == 'VIEW_3D':
use_uv_selection = False # When called from the 3D editor, UV selection is ignored.

@ -8,7 +8,6 @@ import bpy
from bpy.types import (
Menu,
Operator,
bpy_prop_array,
)
from bpy.props import (
BoolProperty,
@ -35,7 +34,7 @@ def _rna_path_prop_search_for_context_impl(context, edit_text, unique_attrs):
line = context_prefix + edit_text
cursor = len(line)
namespace = {"context": context}
comp_prefix, _, comp_options = intellisense.expand(line=line, cursor=len(line), namespace=namespace, private=False)
comp_prefix, _, comp_options = intellisense.expand(line=line, cursor=cursor, namespace=namespace, private=False)
prefix = comp_prefix[len(context_prefix):] # Strip "context."
for attr in comp_options.split("\n"):
if attr.endswith((
@ -66,7 +65,6 @@ def rna_path_prop_search_for_context(self, context, edit_text):
# Users are very unlikely to be setting shortcuts in the preferences, skip this.
if area.type == 'PREFERENCES':
continue
space = area.spaces.active
# Ignore the same region type multiple times in an area.
# Prevents the 3D-viewport quad-view from attempting to expand 3 extra times for e.g.
region_type_unique = set()

@ -662,7 +662,6 @@ class NODE_MT_geometry_node_add_all(Menu):
bl_label = ""
def draw(self, context):
snode = context.space_data
layout = self.layout
layout.menu("NODE_MT_geometry_node_GEO_ATTRIBUTE")
layout.menu("NODE_MT_geometry_node_GEO_INPUT")

@ -47,7 +47,6 @@ class DATA_PT_grease_pencil_layers(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
ob = context.object
grease_pencil = context.grease_pencil
layer = grease_pencil.layers.active

@ -595,9 +595,6 @@ class EeveeRaytracingOptionsPanel(RenderButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
scene = context.scene
eevee = scene.eevee
layout.prop(props, "resolution_scale")
layout.prop(props, "sample_clamp")

@ -1405,7 +1405,6 @@ class VIEW3D_MT_view(Menu):
def draw(self, context):
layout = self.layout
view = context.space_data
prefs = context.preferences
layout.prop(view, "show_region_toolbar")
layout.prop(view, "show_region_ui")

@ -3,7 +3,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
import bpy
import nodeitems_utils
from nodeitems_utils import (
NodeCategory,
NodeItem,