Cleanup: unused vars, imports, pep8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 1 Aug 2016 01:54:02 +0000 (11:54 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 1 Aug 2016 01:55:06 +0000 (11:55 +1000)
16 files changed:
build_files/cmake/project_info.py
intern/cycles/blender/addon/engine.py
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/addon/version_update.py
release/scripts/modules/bl_previews_utils/bl_previews_render.py
release/scripts/modules/keyingsets_utils.py
release/scripts/modules/sys_info.py
release/scripts/startup/bl_ui/properties_data_bone.py
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
release/scripts/startup/keyingsets_builtins.py
release/scripts/startup/nodeitems_builtins.py

index 897b2a53b35282ae9b0048654ed93c8d5f634ce0..deea844034cd9eb5fe6b89897733b367d411ff65 100755 (executable)
@@ -39,7 +39,7 @@ __all__ = (
     "is_py",
     "cmake_advanced_info",
     "cmake_compiler_defines",
-    "project_name_get"
+    "project_name_get",
     "init",
 )
 
index d4b7535b9eebf586a38d183605f498d101809ab1..2c5365c91893b9ff67bfa6ed259334374d49d37a 100644 (file)
@@ -82,7 +82,6 @@ def init():
     import bpy
     import _cycles
     import os.path
-    import sys
 
     # Workaround possibly buggy legacy drivers which crashes on the OpenCL
     # device enumeration.
@@ -103,10 +102,12 @@ def init():
     _cycles.init(path, user_path, bpy.app.background)
     _parse_command_line()
 
+
 def exit():
     import _cycles
     _cycles.exit()
 
+
 def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=False):
     import bpy
     import _cycles
index 79b77516ae71277fc5aef06c297afcccbbc37894..81204eb8ae0bfe1a2f82368fc750b862fb275c4b 100644 (file)
@@ -1013,7 +1013,6 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
                 default=1.0,
                 )
 
-
     @classmethod
     def unregister(cls):
         del bpy.types.Object.cycles
index 58c30a2d15a4172f638e7e68b45ce1406a867667..42f7970769acd8f60f75cbfa02e0e24b4d9adb89 100644 (file)
@@ -887,7 +887,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
 
         lamp = context.lamp
         clamp = lamp.cycles
-        cscene = context.scene.cycles
+        cscene = context.scene.cycles
 
         layout.prop(lamp, "type", expand=True)
 
@@ -1107,7 +1107,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
 
         world = context.world
         cworld = world.cycles
-        cscene = context.scene.cycles
+        cscene = context.scene.cycles
 
         split = layout.split()
 
index 221b1437128eeb4e57450c54f53cb05cd61ad63c..830723d61498ce26ae6121b8adcf5a438e212c0f 100644 (file)
@@ -104,7 +104,6 @@ def vector_curve_node_remap(node):
     """
     Remap values of vector curve node from normalized to absolute values
     """
-    from mathutils import Vector
     if node.bl_idname == 'ShaderNodeVectorCurve':
         node.mapping.use_clip = False
         for curve in node.mapping.curves:
index 674c1c00ab174ee2d4a09567f642a2620b84368d..6c29223cf556cb25e7870ef7db36a1edfea767c8 100644 (file)
@@ -21,9 +21,7 @@
 # Populate a template file (POT format currently) from Blender RNA/py/C data.
 # Note: This script is meant to be used from inside Blender!
 
-import collections
 import os
-import sys
 
 import bpy
 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):
+    import collections
+
     # Helpers.
     RenderContext = collections.namedtuple("RenderContext", (
         "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
             #         OverflowError: Python int too large to convert to C long
             #    ... :(
-            import sys
             scene = bpy.data.scenes[render_context.scene, None]
             for obname in objects:
                 ob = bpy.data.objects[obname, None]
index 375ee3feebefa8308402ac0635587b7d923d3691..8cef64c35905004cd078f4dc2917edd27563e58e 100644 (file)
@@ -28,7 +28,7 @@ __all__ = (
     "RKS_POLL_selected_objects",
     "RKS_POLL_selected_bones",
     "RKS_POLL_selected_items",
-    "RKS_ITER_selected_object",
+    "RKS_ITER_selected_objects",
     "RKS_ITER_selected_bones",
     "RKS_ITER_selected_item",
     "RKS_GEN_available",
@@ -239,6 +239,7 @@ bbone_property_ids = (
     "bone.bbone_out",
 )
 
+
 # Add Keying Set entries for bendy bones
 def RKS_GEN_bendy_bones(ksi, context, ks, data):
     # get id-block and path info
index 75ac67c56609901d89dd50eb411884e7cf8062a9..b225325ba276bf105d3ebcb4353a356d8f1a73f3 100644 (file)
@@ -24,7 +24,6 @@
 def write_sysinfo(filepath):
     import sys
 
-    import textwrap
     import subprocess
 
     import bpy
index 853d45e2396122e999cbcb3803859c55eebde145..3a5475514c9243d098224fd34c270ed4a1083885 100644 (file)
@@ -153,7 +153,7 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
     def draw(self, context):
         ob = context.object
         bone = context.bone
-        arm = context.armature
+        arm = context.armature
         pchan = None
 
         if ob and bone:
@@ -268,7 +268,6 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
         sub.prop(bone, "use_local_location")
 
 
-
 class BONE_PT_display(BoneButtonsPanel, Panel):
     bl_label = "Display"
 
index ac412688fa1238c73a1c2f5e7407efe2b6907dad..baa70ed08f5903705e49f53d5ad227d6d6688b47 100644 (file)
@@ -63,7 +63,7 @@ class GreasePencilDrawingToolsPanel:
     def draw(self, context):
         layout = self.layout
 
-        is_3d_view     = context.space_data.type == 'VIEW_3D'
+        is_3d_view = context.space_data.type == 'VIEW_3D'
         is_clip_editor = context.space_data.type == 'CLIP_EDITOR'
 
         col = layout.column(align=True)
@@ -136,7 +136,7 @@ class GreasePencilStrokeEditPanel:
     def draw(self, context):
         layout = self.layout
 
-        is_3d_view     = context.space_data.type == 'VIEW_3D'
+        is_3d_view = context.space_data.type == 'VIEW_3D'
 
         if not is_3d_view:
             layout.label(text="Select:")
@@ -214,13 +214,13 @@ class GreasePencilStrokeSculptPanel:
 
         layout.separator()
 
-        if settings.tool == 'THICKNESS':
+        if tool == 'THICKNESS':
             layout.row().prop(brush, "direction", expand=True)
-        elif settings.tool == 'PINCH':
+        elif tool == 'PINCH':
             row = layout.row(align=True)
             row.prop_enum(brush, "direction", 'ADD', text="Pinch")
             row.prop_enum(brush, "direction", 'SUBTRACT', text="Inflate")
-        elif settings.tool == 'TWIST':
+        elif tool == 'TWIST':
             row = layout.row(align=True)
             row.prop_enum(brush, "direction", 'SUBTRACT', text="CW")
             row.prop_enum(brush, "direction", 'ADD', text="CCW")
@@ -228,7 +228,7 @@ class GreasePencilStrokeSculptPanel:
         layout.separator()
         layout.prop(settings, "use_select_mask")
 
-        if settings.tool == 'SMOOTH':
+        if tool == 'SMOOTH':
             layout.prop(brush, "affect_pressure")
 
 
@@ -581,14 +581,13 @@ class GreasePencilDataPanel:
         col.active = not gpl.lock
         col.prop(gpl, "line_width", slider=True)
 
-
         split = layout.split(percentage=0.5)
         split.active = not gpl.lock
 
         col = split.column(align=True)
         col.prop(gpl, "use_volumetric_strokes")
         col.prop(gpl, "show_points", text="Points")
-        
+
         col = split.column(align=True)
         col.prop(gpl, "use_hq_fill")
         col.prop(gpl, "show_x_ray")
index d6d9198020151b53bdaf91a80f729ebee0ca545a..4d365c8dc08e4b5ede08069ebc037e6676de1659 100644 (file)
@@ -103,6 +103,7 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
 
             layout.prop(dopesheet, "use_datablock_sort", text="")
 
+
 #######################################
 # DopeSheet Editor - General/Standard UI
 
index c191a4b5bdc3135bce77ee444043a23026f5799a..9f719bc793ed4aad64bff7c18ad84e0b5b62cbd4 100644 (file)
@@ -729,7 +729,6 @@ class IMAGE_PT_paint(Panel, ImagePaintPanel):
     @classmethod
     def poll(cls, context):
         sima = context.space_data
-        toolsettings = context.tool_settings.image_paint
         return sima.show_paint
 
 
@@ -987,7 +986,7 @@ class IMAGE_PT_tools_paint_options(BrushButtonsPanel, Panel):
         layout = self.layout
 
         toolsettings = context.tool_settings
-        brush = toolsettings.image_paint.brush
+        brush = toolsettings.image_paint.brush
 
         ups = toolsettings.unified_paint_settings
 
index fdf0996ac1e66c3ebda088145ad590318bafe421..681fa8e39aa2dcffde58875b9954e34c102dc006 100644 (file)
@@ -37,7 +37,6 @@ class VIEW3D_HT_header(Header):
 
         row = layout.row(align=True)
         row.template_header()
-        sub = row.row(align=True)
 
         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.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")
 
 
-
-
 class VIEW3D_MT_editor_menus(Menu):
     bl_space_type = 'VIEW3D_MT_editor_menus'
     bl_label = ""
@@ -1505,14 +1503,14 @@ class VIEW3D_MT_object_apply(Menu):
         props.location, props.rotation, props.scale = False, True, True
 
         layout.separator()
-        
+
         layout.operator("object.transforms_to_deltas", text="Location to Deltas", text_ctxt=i18n_contexts.default).mode = 'LOC'
         layout.operator("object.transforms_to_deltas", text="Rotation to Deltas", text_ctxt=i18n_contexts.default).mode = 'ROT'
         layout.operator("object.transforms_to_deltas", text="Scale to Deltas", text_ctxt=i18n_contexts.default).mode = 'SCALE'
-        
+
         layout.operator("object.transforms_to_deltas", text="All Transforms to Deltas", text_ctxt=i18n_contexts.default).mode = 'ALL'
         layout.operator("object.anim_transforms_to_deltas")
-        
+
         layout.separator()
 
         layout.operator("object.visual_transform_apply", text="Visual Transform", text_ctxt=i18n_contexts.default)
index e9f4d715ec23b5d780a1f78fce945f716f3b1753..e9f4a45c2c3b39d394d61da1eeaaf28b2a226c88 100644 (file)
@@ -605,6 +605,7 @@ class VIEW3D_PT_tools_curveedit_options_stroke(View3DPanel, Panel):
                 colsub = layout.column(align=True)
                 colsub.prop(cps, "surface_plane", expand=True)
 
+
 # ********** default tools for editmode_surface ****************
 
 class VIEW3D_PT_tools_transform_surface(View3DPanel, Panel):
index 3e245b07dbdd72ef99b80a8b95ee26412528e317..0b4fbd52b5d62de215da51d43ace4e98db9fe853 100644 (file)
@@ -175,6 +175,7 @@ class BUILTIN_KSI_RotScale(KeyingSetInfo):
 
 # ------------
 
+
 # Bendy Bones
 class BUILTIN_KSI_BendyBones(KeyingSetInfo):
     """Insert a keyframe for each of the BBone shape properties"""
index 092cd31330c60b6478dabb4c4357514b31a52ad6..83e396b0997ca4e5b1ea7c506904c0955c9c514a 100644 (file)
@@ -32,6 +32,7 @@ class SortedNodeCategory(NodeCategory):
 
         super().__init__(identifier, name, description, items)
 
+
 class CompositorNodeCategory(SortedNodeCategory):
     @classmethod
     def poll(cls, context):