Cleanup: unused vars, imports, pep8

This commit is contained in:
Campbell Barton 2016-08-01 11:54:02 +10:00
parent 83ebec7322
commit a3ce64be5a
16 changed files with 27 additions and 30 deletions

@ -39,7 +39,7 @@ __all__ = (
"is_py", "is_py",
"cmake_advanced_info", "cmake_advanced_info",
"cmake_compiler_defines", "cmake_compiler_defines",
"project_name_get" "project_name_get",
"init", "init",
) )

@ -82,7 +82,6 @@ def init():
import bpy import bpy
import _cycles import _cycles
import os.path import os.path
import sys
# Workaround possibly buggy legacy drivers which crashes on the OpenCL # Workaround possibly buggy legacy drivers which crashes on the OpenCL
# device enumeration. # device enumeration.
@ -103,10 +102,12 @@ def init():
_cycles.init(path, user_path, bpy.app.background) _cycles.init(path, user_path, bpy.app.background)
_parse_command_line() _parse_command_line()
def exit(): def exit():
import _cycles import _cycles
_cycles.exit() _cycles.exit()
def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=False): def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=False):
import bpy import bpy
import _cycles import _cycles

@ -1013,7 +1013,6 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
default=1.0, default=1.0,
) )
@classmethod @classmethod
def unregister(cls): def unregister(cls):
del bpy.types.Object.cycles del bpy.types.Object.cycles

@ -887,7 +887,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
lamp = context.lamp lamp = context.lamp
clamp = lamp.cycles clamp = lamp.cycles
cscene = context.scene.cycles # cscene = context.scene.cycles
layout.prop(lamp, "type", expand=True) layout.prop(lamp, "type", expand=True)
@ -1107,7 +1107,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
world = context.world world = context.world
cworld = world.cycles cworld = world.cycles
cscene = context.scene.cycles # cscene = context.scene.cycles
split = layout.split() split = layout.split()

@ -104,7 +104,6 @@ def vector_curve_node_remap(node):
""" """
Remap values of vector curve node from normalized to absolute values Remap values of vector curve node from normalized to absolute values
""" """
from mathutils import Vector
if node.bl_idname == 'ShaderNodeVectorCurve': if node.bl_idname == 'ShaderNodeVectorCurve':
node.mapping.use_clip = False node.mapping.use_clip = False
for curve in node.mapping.curves: for curve in node.mapping.curves:

@ -21,9 +21,7 @@
# Populate a template file (POT format currently) from Blender RNA/py/C data. # Populate a template file (POT format currently) from Blender RNA/py/C data.
# Note: This script is meant to be used from inside Blender! # Note: This script is meant to be used from inside Blender!
import collections
import os import os
import sys
import bpy import bpy
from mathutils import Vector, Euler, Matrix from mathutils import Vector, Euler, Matrix
@ -67,6 +65,8 @@ def rna_backup_restore(data, backup):
def do_previews(do_objects, do_groups, do_scenes, do_data_intern): def do_previews(do_objects, do_groups, do_scenes, do_data_intern):
import collections
# Helpers. # Helpers.
RenderContext = collections.namedtuple("RenderContext", ( RenderContext = collections.namedtuple("RenderContext", (
"scene", "world", "camera", "lamp", "camera_data", "lamp_data", "image", # All those are names! "scene", "world", "camera", "lamp", "camera_data", "lamp_data", "image", # All those are names!
@ -362,7 +362,6 @@ def do_previews(do_objects, do_groups, do_scenes, do_data_intern):
# File "<string>", line 327, in do_previews # File "<string>", line 327, in do_previews
# OverflowError: Python int too large to convert to C long # OverflowError: Python int too large to convert to C long
# ... :( # ... :(
import sys
scene = bpy.data.scenes[render_context.scene, None] scene = bpy.data.scenes[render_context.scene, None]
for obname in objects: for obname in objects:
ob = bpy.data.objects[obname, None] ob = bpy.data.objects[obname, None]

@ -28,7 +28,7 @@ __all__ = (
"RKS_POLL_selected_objects", "RKS_POLL_selected_objects",
"RKS_POLL_selected_bones", "RKS_POLL_selected_bones",
"RKS_POLL_selected_items", "RKS_POLL_selected_items",
"RKS_ITER_selected_object", "RKS_ITER_selected_objects",
"RKS_ITER_selected_bones", "RKS_ITER_selected_bones",
"RKS_ITER_selected_item", "RKS_ITER_selected_item",
"RKS_GEN_available", "RKS_GEN_available",
@ -239,6 +239,7 @@ bbone_property_ids = (
"bone.bbone_out", "bone.bbone_out",
) )
# Add Keying Set entries for bendy bones # Add Keying Set entries for bendy bones
def RKS_GEN_bendy_bones(ksi, context, ks, data): def RKS_GEN_bendy_bones(ksi, context, ks, data):
# get id-block and path info # get id-block and path info

@ -24,7 +24,6 @@
def write_sysinfo(filepath): def write_sysinfo(filepath):
import sys import sys
import textwrap
import subprocess import subprocess
import bpy import bpy

@ -153,7 +153,7 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
def draw(self, context): def draw(self, context):
ob = context.object ob = context.object
bone = context.bone bone = context.bone
arm = context.armature # arm = context.armature
pchan = None pchan = None
if ob and bone: if ob and bone:
@ -268,7 +268,6 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
sub.prop(bone, "use_local_location") sub.prop(bone, "use_local_location")
class BONE_PT_display(BoneButtonsPanel, Panel): class BONE_PT_display(BoneButtonsPanel, Panel):
bl_label = "Display" bl_label = "Display"

@ -214,13 +214,13 @@ class GreasePencilStrokeSculptPanel:
layout.separator() layout.separator()
if settings.tool == 'THICKNESS': if tool == 'THICKNESS':
layout.row().prop(brush, "direction", expand=True) layout.row().prop(brush, "direction", expand=True)
elif settings.tool == 'PINCH': elif tool == 'PINCH':
row = layout.row(align=True) row = layout.row(align=True)
row.prop_enum(brush, "direction", 'ADD', text="Pinch") row.prop_enum(brush, "direction", 'ADD', text="Pinch")
row.prop_enum(brush, "direction", 'SUBTRACT', text="Inflate") row.prop_enum(brush, "direction", 'SUBTRACT', text="Inflate")
elif settings.tool == 'TWIST': elif tool == 'TWIST':
row = layout.row(align=True) row = layout.row(align=True)
row.prop_enum(brush, "direction", 'SUBTRACT', text="CW") row.prop_enum(brush, "direction", 'SUBTRACT', text="CW")
row.prop_enum(brush, "direction", 'ADD', text="CCW") row.prop_enum(brush, "direction", 'ADD', text="CCW")
@ -228,7 +228,7 @@ class GreasePencilStrokeSculptPanel:
layout.separator() layout.separator()
layout.prop(settings, "use_select_mask") layout.prop(settings, "use_select_mask")
if settings.tool == 'SMOOTH': if tool == 'SMOOTH':
layout.prop(brush, "affect_pressure") layout.prop(brush, "affect_pressure")
@ -581,7 +581,6 @@ class GreasePencilDataPanel:
col.active = not gpl.lock col.active = not gpl.lock
col.prop(gpl, "line_width", slider=True) col.prop(gpl, "line_width", slider=True)
split = layout.split(percentage=0.5) split = layout.split(percentage=0.5)
split.active = not gpl.lock split.active = not gpl.lock

@ -103,6 +103,7 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
layout.prop(dopesheet, "use_datablock_sort", text="") layout.prop(dopesheet, "use_datablock_sort", text="")
####################################### #######################################
# DopeSheet Editor - General/Standard UI # DopeSheet Editor - General/Standard UI

@ -729,7 +729,6 @@ class IMAGE_PT_paint(Panel, ImagePaintPanel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
sima = context.space_data sima = context.space_data
toolsettings = context.tool_settings.image_paint
return sima.show_paint return sima.show_paint
@ -987,7 +986,7 @@ class IMAGE_PT_tools_paint_options(BrushButtonsPanel, Panel):
layout = self.layout layout = self.layout
toolsettings = context.tool_settings toolsettings = context.tool_settings
brush = toolsettings.image_paint.brush # brush = toolsettings.image_paint.brush
ups = toolsettings.unified_paint_settings ups = toolsettings.unified_paint_settings

@ -37,7 +37,6 @@ class VIEW3D_HT_header(Header):
row = layout.row(align=True) row = layout.row(align=True)
row.template_header() row.template_header()
sub = row.row(align=True)
VIEW3D_MT_editor_menus.draw_collapsible(context, layout) VIEW3D_MT_editor_menus.draw_collapsible(context, layout)
@ -137,13 +136,12 @@ class VIEW3D_HT_header(Header):
row.operator("gpencil.copy", text="", icon='COPYDOWN') row.operator("gpencil.copy", text="", icon='COPYDOWN')
row.operator("gpencil.paste", text="", icon='PASTEDOWN') row.operator("gpencil.paste", text="", icon='PASTEDOWN')
layout.prop(context.gpencil_data, "use_onion_skinning", text="Onion Skins", icon='PARTICLE_PATH') # XXX: icon # XXX: icon
layout.prop(context.gpencil_data, "use_onion_skinning", text="Onion Skins", icon='PARTICLE_PATH')
layout.prop(context.tool_settings.gpencil_sculpt, "use_select_mask") layout.prop(context.tool_settings.gpencil_sculpt, "use_select_mask")
class VIEW3D_MT_editor_menus(Menu): class VIEW3D_MT_editor_menus(Menu):
bl_space_type = 'VIEW3D_MT_editor_menus' bl_space_type = 'VIEW3D_MT_editor_menus'
bl_label = "" bl_label = ""

@ -605,6 +605,7 @@ class VIEW3D_PT_tools_curveedit_options_stroke(View3DPanel, Panel):
colsub = layout.column(align=True) colsub = layout.column(align=True)
colsub.prop(cps, "surface_plane", expand=True) colsub.prop(cps, "surface_plane", expand=True)
# ********** default tools for editmode_surface **************** # ********** default tools for editmode_surface ****************
class VIEW3D_PT_tools_transform_surface(View3DPanel, Panel): class VIEW3D_PT_tools_transform_surface(View3DPanel, Panel):

@ -175,6 +175,7 @@ class BUILTIN_KSI_RotScale(KeyingSetInfo):
# ------------ # ------------
# Bendy Bones # Bendy Bones
class BUILTIN_KSI_BendyBones(KeyingSetInfo): class BUILTIN_KSI_BendyBones(KeyingSetInfo):
"""Insert a keyframe for each of the BBone shape properties""" """Insert a keyframe for each of the BBone shape properties"""

@ -32,6 +32,7 @@ class SortedNodeCategory(NodeCategory):
super().__init__(identifier, name, description, items) super().__init__(identifier, name, description, items)
class CompositorNodeCategory(SortedNodeCategory): class CompositorNodeCategory(SortedNodeCategory):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):