Cleanup: unused variables

This commit is contained in:
Campbell Barton 2018-09-11 18:15:55 +10:00
parent 29fa45b695
commit b05f9e35cb
18 changed files with 29 additions and 88 deletions

@ -662,7 +662,6 @@ class CLIP_OT_setup_tracking_scene(Operator):
else:
setup_collection_recursively(collection.children, collection_name, attr_name)
collection = context.collection
collections = context.scene.collection.children
vlayers = context.scene.view_layers
@ -971,7 +970,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
def execute(self, context):
scene = context.scene
current_active_layer = scene.active_layer
# current_active_layer = scene.active_layer
self._setupScene(context)
self._setupWorld(context)

@ -171,7 +171,6 @@ class SelectHierarchy(Operator):
return context.object
def execute(self, context):
scene = context.scene
view_layer = context.view_layer
select_new = []
act_new = None

@ -218,7 +218,6 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
layout.use_property_split = True
cam = context.camera
dof_options = cam.gpu_dof
col = layout.column()
col.prop(cam, "dof_object", text="Focus on Object")

@ -358,7 +358,6 @@ class DATA_PT_font_transform(CurveButtonsPanelText, Panel):
layout = self.layout
text = context.curve
char = context.curve.edit_format
layout.use_property_split = True
@ -387,9 +386,8 @@ class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
bl_label = "Paragraph"
def draw(self, context):
layout = self.layout
text = context.curve
# Parent panel
pass
class DATA_PT_paragraph_alignment(CurveButtonsPanelText, Panel):

@ -46,8 +46,7 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data")
layout.template_image(ob, "data", ob.image_user, compact=True)
row = layout.row(align=True)
row = layout.row(align=True)
layout.row(align=True).row(align=True)
layout.prop(ob, "color", text="Transparency", index=3, slider=True)
col = layout.column(align=True)

@ -62,7 +62,6 @@ class DATA_PT_gpencil(DataButtonsPanel, Panel):
# Grease Pencil data selector
gpd_owner = context.gpencil_data_owner
gpd = context.gpencil_data
layout.template_ID(gpd_owner, "data")

@ -58,7 +58,6 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
ob = context.object
probe = context.lightprobe
# layout.prop(probe, "type")

@ -116,7 +116,6 @@ class VIEWLAYER_PT_freestyle(ViewLayerFreestyleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
scene = context.scene
view_layer = context.view_layer
freestyle = view_layer.freestyle_settings
@ -183,9 +182,6 @@ class VIEWLAYER_PT_freestyle_lineset(ViewLayerFreestyleEditorButtonsPanel, Panel
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
view_layer = context.view_layer
freestyle = view_layer.freestyle_settings
lineset = freestyle.linesets.active
@ -613,7 +609,6 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
def draw(self, context):
layout = self.layout
scene = context.scene
view_layer = context.view_layer
lineset = view_layer.freestyle_settings.linesets.active

@ -587,7 +587,6 @@ class GPENCIL_MT_gpencil_draw_specials(Menu):
def draw(self, context):
layout = self.layout
is_3d_view = context.space_data.type == 'VIEW_3D'
layout.operator_context = 'INVOKE_REGION_WIN'
@ -605,7 +604,6 @@ class GPENCIL_MT_gpencil_draw_delete(Menu):
def draw(self, context):
layout = self.layout
is_3d_view = context.space_data.type == 'VIEW_3D'
layout.operator_context = 'INVOKE_REGION_WIN'
@ -631,7 +629,6 @@ class GPENCIL_UL_annotation_layer(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
# assert(isinstance(item, bpy.types.GPencilLayer)
gpl = item
gpd = context.gpencil_data
if self.layout_type in {'DEFAULT', 'COMPACT'}:
if gpl.lock:

@ -277,7 +277,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
if part.type == 'HAIR':
col.prop(part, "hair_length")
if not part.use_advanced_hair:
row = layout.row()
layout.row() # is this needed?
col.prop(part, "use_modifier_stack")
return
@ -428,7 +428,6 @@ class PARTICLE_PT_hair_dynamics_structure(ParticleButtonsPanel, Panel):
psys = context.particle_system
cloth_md = psys.cloth
cloth = cloth_md.settings
result = cloth_md.solver_result
layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
@ -460,7 +459,6 @@ class PARTICLE_PT_hair_dynamics_volume(ParticleButtonsPanel, Panel):
psys = context.particle_system
cloth_md = psys.cloth
cloth = cloth_md.settings
result = cloth_md.solver_result
layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
@ -698,7 +696,6 @@ class PARTICLE_PT_physics_fluid_advanced(ParticleButtonsPanel, Panel):
@classmethod
def poll(cls, context):
part = particle_get_settings(context)
fluid = part.fluid
if part.physics_type == 'FLUID':
return True
else:
@ -708,7 +705,7 @@ class PARTICLE_PT_physics_fluid_advanced(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
fluid = part.fluid
@ -758,7 +755,7 @@ class PARTICLE_PT_physics_fluid_springs(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
fluid = part.fluid
@ -783,7 +780,7 @@ class PARTICLE_PT_physics_fluid_springs_viscoelastic(ParticleButtonsPanel, Panel
return False
def draw_header(self, context):
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
fluid = part.fluid
@ -793,7 +790,7 @@ class PARTICLE_PT_physics_fluid_springs_viscoelastic(ParticleButtonsPanel, Panel
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
fluid = part.fluid
@ -827,7 +824,7 @@ class PARTICLE_PT_physics_fluid_springs_advanced(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
fluid = part.fluid
@ -851,7 +848,7 @@ class PARTICLE_PT_physics_boids_movement(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
boids = part.boids
@ -905,7 +902,7 @@ class PARTICLE_PT_physics_boids_battle(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
boids = part.boids
@ -933,7 +930,7 @@ class PARTICLE_PT_physics_boids_misc(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
boids = part.boids
@ -1251,8 +1248,7 @@ class PARTICLE_PT_render_extra(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
ob = context.object
# psys = context.particle_system
part = particle_get_settings(context)
col = layout.column()
@ -1278,8 +1274,7 @@ class PARTICLE_PT_render_line(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
ob = context.object
# psys = context.particle_system
part = particle_get_settings(context)
col = layout.column()
@ -1306,8 +1301,7 @@ class PARTICLE_PT_render_path(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
ob = context.object
# psys = context.particle_system
part = particle_get_settings(context)
col = layout.column()
@ -1342,7 +1336,6 @@ class PARTICLE_PT_render_path_timing(ParticleButtonsPanel, Panel):
layout.use_property_split = True
psys = context.particle_system
ob = context.object
part = particle_get_settings(context)
col = layout.column()
@ -1373,8 +1366,7 @@ class PARTICLE_PT_render_object(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
ob = context.object
# psys = context.particle_system
part = particle_get_settings(context)
col = layout.column()
@ -1401,8 +1393,7 @@ class PARTICLE_PT_render_collection(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
ob = context.object
# psys = context.particle_system
part = particle_get_settings(context)
col = layout.column()
@ -1441,8 +1432,7 @@ class PARTICLE_PT_render_collection_use_count(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
ob = context.object
# psys = context.particle_system
part = particle_get_settings(context)
col = layout.column()
@ -1484,8 +1474,6 @@ class PARTICLE_PT_render_billboards_alignment(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
ob = context.object
part = particle_get_settings(context)
col = layout.column()
@ -1510,8 +1498,7 @@ class PARTICLE_PT_render_billboards_tilt(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
ob = context.object
# psys = context.particle_system
part = particle_get_settings(context)
col = layout.column()
@ -1580,7 +1567,7 @@ class PARTICLE_PT_render_trails(ParticleButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
col = layout.column()
@ -1725,7 +1712,7 @@ class PARTICLE_PT_children_parting(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
layout.use_property_split = True
@ -1750,7 +1737,7 @@ class PARTICLE_PT_children_clumping(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
layout.use_property_split = True
@ -1792,7 +1779,7 @@ class PARTICLE_PT_children_roughness(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
layout.use_property_split = True
@ -1834,7 +1821,7 @@ class PARTICLE_PT_children_kink(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
psys = context.particle_system
# psys = context.particle_system
part = particle_get_settings(context)
layout.use_property_split = True

@ -377,9 +377,6 @@ class RENDER_PT_encoding_video(RenderButtonsPanel, Panel):
layout.use_property_split = True
layout.use_property_decorate = False
rd = context.scene.render
ffmpeg = rd.ffmpeg
self.draw_vcodec(context)
def draw_vcodec(self, context):

@ -523,7 +523,7 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel):
self.layout.prop(rd, "use_simplify", text="")
def draw(self, context):
layout = self.layout
pass
class SCENE_PT_simplify_viewport(SceneButtonsPanel, Panel):

@ -67,8 +67,6 @@ class VIEWLAYER_PT_eevee_layer_passes(ViewLayerButtonsPanel, Panel):
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
scene = context.scene
rd = scene.render
view_layer = context.view_layer
col = flow.column()

@ -140,8 +140,6 @@ class OUTLINER_MT_collection_view_layer(Menu):
def draw(self, context):
layout = self.layout
space = context.space_data
layout.operator("outliner.collection_exclude_set")
layout.operator("outliner.collection_exclude_clear")
@ -260,7 +258,7 @@ class OUTLINER_PT_filter(Panel):
layout.separator()
if space.display_mode != 'DATA_API':
if display_mode != 'DATA_API':
layout.prop(space, "use_sort_alpha")
layout.prop(space, "show_restrict_columns")
layout.separator()

@ -60,7 +60,7 @@ def _keymap_fn_from_seq(keymap_data):
kmi = km.keymap_items.new(op_idname, **kmi_kwargs)
kmi_props = kmi.properties
if op_props_dict:
_props_assign_recursive(kmi.properties, op_props_dict)
_props_assign_recursive(kmi_props, op_props_dict)
keymap_fn.keymap_data = keymap_data
return keymap_fn
@ -248,7 +248,6 @@ class ToolSelectPanelHelper:
"""
Return the active Python tool definition and icon name.
"""
workspace = context.workspace
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
if cls is not None:
tool_active = ToolSelectPanelHelper._tool_active_from_context(context, space_type, mode)
@ -344,7 +343,6 @@ class ToolSelectPanelHelper:
keymap_data = item.keymap
if keymap_data is not None and callable(keymap_data[0]):
text = item.text
icon_name = item.icon
cls._km_action_simple(kc, context_mode, text, keymap_data)
# -------------------------------------------------------------------------
@ -429,7 +427,6 @@ class ToolSelectPanelHelper:
# 2 column layout, disabled
if width_scale > 80.0:
column_count = 2
use_columns = True
else:
column_count = 1
@ -617,7 +614,6 @@ 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)
ok = False
for i, sub_item in enumerate(item_group):
if sub_item.text == text:
text_current = item_group[index_current].text

@ -1227,7 +1227,6 @@ class _defs_gpencil_paint:
if ob and ob.mode == 'GPENCIL_PAINT':
brush = context.active_gpencil_brush
gp_settings = brush.gpencil_settings
tool_settings = context.tool_settings
if gp_settings.gpencil_brush_type == 'ERASE':
row = layout.row()

@ -49,9 +49,6 @@ class VIEW3D_HT_header(Header):
layout.template_header_3D_mode()
# Contains buttons like Mode, Pivot, Layer, Mesh Select Mode...
shading_type = view.shading.type
shading_item = bpy.types.View3DShading.bl_rna.properties["type"].enum_items[shading_type]
if obj:
# Set above:
# object_mode = obj.mode
@ -1676,7 +1673,6 @@ class VIEW3D_MT_object_specials(Menu):
def draw(self, context):
layout = self.layout
scene = context.scene
obj = context.object
layout.operator("view3d.copybuffer", text="Copy Objects", icon='COPYDOWN')
@ -2658,7 +2654,6 @@ class VIEW3D_MT_edit_mesh(Menu):
def draw(self, context):
layout = self.layout
tool_settings = context.tool_settings
with_bullet = bpy.app.build_options.bullet
@ -2992,8 +2987,6 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
def draw(self, context):
layout = self.layout
with_freestyle = bpy.app.build_options.freestyle
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Faces"),
@ -3609,8 +3602,6 @@ class VIEW3D_MT_edit_gpencil(Menu):
bl_label = "Strokes"
def draw(self, context):
tool_settings = context.tool_settings
layout = self.layout
layout.menu("VIEW3D_MT_edit_gpencil_transform")
@ -4066,14 +4057,12 @@ class VIEW3D_PT_shading_options(Panel):
is_xray = shading.show_xray
is_shadows = shading.show_shadows
icon_x = 'CHECKBOX_HLT' if is_xray else 'CHECKBOX_DEHLT'
row = col.row()
row.prop(shading, "show_xray", text="")
sub = row.row()
sub.active = is_xray
sub.prop(shading, "xray_alpha", text="X-Ray")
icon_s = 'CHECKBOX_HLT' if is_shadows else 'CHECKBOX_DEHLT'
row = col.row()
row.prop(shading, "show_shadows", text="")
row.active = not is_xray
@ -4249,7 +4238,6 @@ class VIEW3D_PT_overlay_object(Panel):
layout = self.layout
view = context.space_data
overlay = view.overlay
shading = view.shading
display_all = overlay.show_overlays
col = layout.column(align=True)
@ -4357,7 +4345,6 @@ class VIEW3D_PT_overlay_edit_mesh(Panel):
overlay = view.overlay
display_all = overlay.show_overlays
data = context.active_object.data
with_freestyle = bpy.app.build_options.freestyle
col = layout.column()
col.active = display_all
@ -4722,7 +4709,6 @@ class VIEW3D_PT_snapping(Panel):
toolsettings = context.tool_settings
snap_elements = toolsettings.snap_elements
obj = context.active_object
mode = context.mode
object_mode = 'OBJECT' if obj is None else obj.mode
layout = self.layout

@ -517,7 +517,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
class TEXTURE_UL_texpaintslots(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
mat = data
# mat = data
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.prop(item, "name", text="", emboss=False, icon_value=icon)
@ -1151,8 +1151,6 @@ class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
def draw(self, context):
layout = self.layout
toolsettings = context.tool_settings
col = layout.column()
self.unified_paint_settings(col, context)
@ -1719,9 +1717,7 @@ class VIEW3D_PT_tools_grease_pencil_weight_paint(View3DPanel, Panel):
layout.use_property_split = True
layout.use_property_decorate = False
gpd = context.gpencil_data
settings = context.tool_settings.gpencil_sculpt
tool = settings.tool
brush = settings.brush
layout.template_icon_view(settings, "weight_tool", show_labels=True)