pep8 cleanup
authorCampbell Barton <ideasman42@gmail.com>
Sat, 1 Jan 2011 07:20:34 +0000 (07:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 1 Jan 2011 07:20:34 +0000 (07:20 +0000)
47 files changed:
release/getversion.py
release/scripts/modules/animsys_refactor.py
release/scripts/modules/bpy/__init__.py
release/scripts/modules/bpy/ops.py
release/scripts/modules/bpy/path.py
release/scripts/modules/bpy/utils.py
release/scripts/modules/bpy_types.py
release/scripts/modules/rna_prop_ui.py
release/scripts/modules/sys_info.py
release/scripts/op/animsys_update.py
release/scripts/op/console_python.py
release/scripts/op/io_anim_bvh/__init__.py
release/scripts/op/io_anim_bvh/import_bvh.py
release/scripts/op/io_mesh_ply/export_ply.py
release/scripts/op/io_scene_3ds/__init__.py
release/scripts/op/io_scene_obj/__init__.py
release/scripts/op/io_scene_obj/export_obj.py
release/scripts/op/io_shape_mdd/__init__.py
release/scripts/op/io_shape_mdd/export_mdd.py
release/scripts/op/io_shape_mdd/import_mdd.py
release/scripts/op/object.py
release/scripts/op/object_align.py
release/scripts/op/object_randomize_transform.py
release/scripts/op/presets.py
release/scripts/op/uv.py
release/scripts/op/wm.py
release/scripts/ui/properties_data_bone.py
release/scripts/ui/properties_data_curve.py
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_object.py
release/scripts/ui/properties_object_constraint.py
release/scripts/ui/properties_render.py
release/scripts/ui/properties_scene.py
release/scripts/ui/properties_texture.py
release/scripts/ui/properties_world.py
release/scripts/ui/space_dopesheet.py
release/scripts/ui/space_filebrowser.py
release/scripts/ui/space_graph.py
release/scripts/ui/space_image.py
release/scripts/ui/space_info.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_time.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_userpref_keymap.py
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
release/test/pep8.py

index ee21aa43873efe4cab8b6948e8a6c9a21a6a1d54..667214a2ca3bdd509f308a5edaa2ce2f001a0bcf 100755 (executable)
@@ -57,7 +57,7 @@ for line in infile.readlines():
 infile.close()
 
 # Major was changed to float, but minor is still a string
-# Note: removed returning minor, this messes up with install path code in BLI module
+# Note: removed returning minor, messes up install path code in BLI module
 if major:
     print "%.2f" % major
 else:
index bd16a02268a4c1627996ba4fa5a33d3d5b5b9d74..464df870e87d6b4219a5adc75e6a31acbbeed6ae 100644 (file)
 This module has utility functions for renaming
 rna values in fcurves and drivers.
 
-The main function to use is: update_data_paths(...) 
+The main function to use is: update_data_paths(...)
 """
 
 IS_TESTING = False
 
+
 class DataPathBuilder(object):
     __slots__ = ("data_path", )
     """ Dummy class used to parse fcurve and driver data paths.
@@ -37,7 +38,7 @@ class DataPathBuilder(object):
     def __getattr__(self, attr):
         str_value = ".%s" % attr
         return DataPathBuilder(self.data_path + (str_value, ))
-        
+
     def __getitem__(self, key):
         str_value = '["%s"]' % key
         return DataPathBuilder(self.data_path + (str_value, ))
@@ -51,7 +52,7 @@ class DataPathBuilder(object):
             if base is not Ellipsis:
                 try:
                     # this only works when running with an old blender
-                    # where the old path will resolve 
+                    # where the old path will resolve
                     base = eval("base" + item)
                 except:
                     base_new = Ellipsis
@@ -61,7 +62,7 @@ class DataPathBuilder(object):
                             try:
                                 print("base." + item_new)
                                 base_new = eval("base." + item_new)
-                                break # found, dont keep looking
+                                break  # found, dont keep looking
                             except:
                                 pass
 
@@ -77,7 +78,7 @@ import bpy
 
 def id_iter():
     type_iter = type(bpy.data.objects)
-    
+
     for attr in dir(bpy.data):
         data_iter = getattr(bpy.data, attr, None)
         if type(data_iter) == type_iter:
@@ -115,13 +116,13 @@ def find_path_new(id_data, data_path, rna_update_dict, rna_update_from_map):
     # ignore ID props for now
     if data_path.startswith("["):
         return data_path
-    
+
     # recursive path fixing, likely will be one in most cases.
     data_path_builder = eval("DataPathBuilder(tuple())." + data_path)
     data_resolve = data_path_builder.resolve(id_data, rna_update_from_map)
 
     path_new = [pair[0] for pair in data_resolve]
-    
+
     # print(data_resolve)
     data_base = id_data
 
@@ -138,20 +139,20 @@ def find_path_new(id_data, data_path, rna_update_dict, rna_update_from_map):
 
         # set this as the base for further properties
         data_base = data
-    
-    data_path_new = "".join(path_new)[1:] # skip the first "."
+
+    data_path_new = "".join(path_new)[1:]  # skip the first "."
     return data_path_new
 
 
 def update_data_paths(rna_update):
     ''' rna_update triple [(class_name, from, to), ...]
     '''
-    
+
     # make a faster lookup dict
     rna_update_dict = {}
     for ren_class, ren_from, ren_to in rna_update:
         rna_update_dict.setdefault(ren_class, {})[ren_from] = ren_to
-        
+
     rna_update_from_map = {}
     for ren_class, ren_from, ren_to in rna_update:
         rna_update_from_map.setdefault(ren_from, []).append(ren_to)
@@ -174,7 +175,7 @@ def update_data_paths(rna_update):
                         for tar in var.targets:
                             id_data_other = tar.id
                             data_path = tar.data_path
-                            
+
                             if id_data_other and data_path:
                                 data_path_new = find_path_new(id_data_other, data_path, rna_update_dict, rna_update_from_map)
                                 # print(data_path_new)
@@ -182,9 +183,7 @@ def update_data_paths(rna_update):
                                     if not IS_TESTING:
                                         tar.data_path = data_path_new
                                     print("driver (%s): %s -> %s" % (id_data_other.name, data_path, data_path_new))
-                    
-                
-            
+
             for action in anim_data_actions(anim_data):
                 for fcu in action.fcurves:
                     data_path = fcu.data_path
index 99faeeaf169b427432483e332d4d03cd3a3fe779..5c636d3a0dfd90498b3819479abd6db1e5270f85 100644 (file)
@@ -48,7 +48,7 @@ def _main():
     pydoc.getpager = lambda: pydoc.plainpager
     pydoc.Helper.getline = lambda self, prompt: None
     pydoc.TextDoc.use_bold = lambda self, text: text
-    
+
     # Possibly temp. addons path
     from os.path import join, dirname, normpath
     _sys.path.append(normpath(join(dirname(__file__), "..", "..", "addons", "modules")))
index 6965a8db918eb7f55eddb9adef0ac87d49ed14c5..f54b0a1fefc9fc376146e04f5038cee2e3a075b6 100644 (file)
@@ -137,13 +137,12 @@ class bpy_ops_submodule_op(object):
     @staticmethod
     def _scene_update(context):
         scene = context.scene
-        if scene: # None in backgroud mode
+        if scene:  # None in backgroud mode
             scene.update()
         else:
             import bpy
             for scene in bpy.data.scenes:
                 scene.update()
-        
 
     __doc__ = property(_get_doc)
 
@@ -196,7 +195,8 @@ class bpy_ops_submodule_op(object):
         as_string = op_as_string(idname)
         op_class = getattr(bpy.types, idname)
         descr = op_class.bl_rna.description
-        # XXX, workaround for not registering every __doc__ to save time on load.
+        # XXX, workaround for not registering
+        # every __doc__ to save time on load.
         if not descr:
             descr = op_class.__doc__
             if not descr:
index 9c9d386c7b01f22350e9b13c147b42f8e35794e0..feff3b22a6fc8eaff4bf1ee145e87331f12518dd 100644 (file)
@@ -204,7 +204,7 @@ def module_names(path, recursive=False):
 
     for filename in sorted(_os.listdir(path)):
         if filename == "modules":
-            pass # XXX, hard coded exception.
+            pass  # XXX, hard coded exception.
         elif filename.endswith(".py") and filename != "__init__.py":
             fullpath = join(path, filename)
             modules.append((filename[0:-3], fullpath))
index e979c75f95e8d49256b46770ca06fee68eae3425..243ab866abb0171125bfa7c83c125fc7800d6a84 100644 (file)
@@ -31,6 +31,7 @@ import bpy as _bpy
 import os as _os
 import sys as _sys
 
+
 def _test_import(module_name, loaded_modules):
     import traceback
     import time
@@ -203,13 +204,11 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
     # deal with addons seperately
     addon_reset_all(reload_scripts)
 
-
     # run the active integration preset
     filepath = preset_find(_bpy.context.user_preferences.inputs.active_keyconfig, "keyconfig")
     if filepath:
         keyconfig_set(filepath)
 
-
     if reload_scripts:
         import gc
         print("gc.collect() -> %d" % gc.collect())
@@ -368,7 +367,6 @@ def addon_enable(module_name, default_set=True):
     import bpy_types as _bpy_types
     import imp
 
-
     _bpy_types._register_immediate = False
 
     def handle_error():
@@ -376,7 +374,6 @@ def addon_enable(module_name, default_set=True):
         traceback.print_exc()
         _bpy_types._register_immediate = True
 
-
     # reload if the mtime changes
     mod = sys.modules.get(module_name)
     if mod:
@@ -428,7 +425,7 @@ def addon_enable(module_name, default_set=True):
         if not ext:
             ext = _bpy.context.user_preferences.addons.new()
             ext.module = module_name
-    
+
     _bpy_types._register_immediate = True
 
     mod.__addon_enabled__ = True
@@ -471,7 +468,7 @@ def addon_disable(module_name, default_set=True):
             addon = addons.get(module_name)
             if addon:
                 addons.remove(addon)
-    
+
     print("\tbpy.utils.addon_disable", module_name)
 
 
@@ -483,10 +480,10 @@ def addon_reset_all(reload_scripts=False):
 
     # RELEASE SCRIPTS: official scripts distributed in Blender releases
     paths = script_paths("addons")
-    
+
     # CONTRIB SCRIPTS: good for testing but not official scripts yet
     paths += script_paths("addons_contrib")
-    
+
     # EXTERN SCRIPTS: external projects scripts
     paths += script_paths("addons_extern")
 
@@ -513,9 +510,9 @@ def addon_reset_all(reload_scripts=False):
 def preset_find(name, preset_path, display_name=False):
     if not name:
         return None
-    
+
     for directory in preset_paths(preset_path):
-        
+
         if display_name:
             filename = ""
             for fn in _os.listdir(directory):
@@ -558,7 +555,7 @@ def keyconfig_set(filepath):
             keyconfigs.remove(kc_dupe)
         else:
             break
-    
+
     kc_new.name = name
     keyconfigs.active = kc_new
 
@@ -595,4 +592,3 @@ def user_resource(type, path="", create=False):
                 target_path = ""
 
     return target_path
-
index 31450031c6b4c6c3137d7445d23a6f2835e3932e..a2c3d416b236916ecb394b51bd32c430c20c714e 100644 (file)
@@ -638,7 +638,7 @@ class OrderedMeta(RNAMeta):
 # with doc generation 'self.properties.bl_rna.properties' can fail
 class Operator(StructRNA, metaclass=OrderedMeta):
     __slots__ = ()
-    
+
     def __getattribute__(self, attr):
         properties = StructRNA.path_resolve(self, "properties")
         bl_rna = getattr(properties, "bl_rna", None)
@@ -745,7 +745,7 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
         import bpy.utils
 
         layout = self.layout
-        
+
         if not searchpaths:
             layout.label("* Missing Paths *")
 
index 2e3f9af8d1ba176c92c0187c30a56b64e510bbe9..9311987e2e7ea1a5ad4fa80026036303dd4feeed 100644 (file)
@@ -60,7 +60,7 @@ def rna_idprop_ui_prop_clear(item, prop):
 
 def rna_idprop_context_value(context, context_member, property_type):
     space = context.space_data
-    
+
     if space is None or isinstance(space, bpy.types.SpaceProperties):
         pin_id = space.pin_id
     else:
index 58fb1aba377dd0e49ece8055d3388ce7c6043b2e..303277a5d75fd5a13e5c7889c50aa3fb7ceb2ec0 100644 (file)
@@ -25,83 +25,87 @@ import bgl
 
 import sys
 
+
 def cutPoint(text, length):
-       "Returns position of the last space found before 'length' chars"
-       l = length
-       c = text[l]
-       while c != ' ':
-               l -= 1
-               if l == 0: return length # no space found
-               c = text[l]
-       return l
-
-def textWrap(text, length = 70):
-       lines = []
-       while len(text) > 70:
-               cpt = cutPoint(text, length)
-               line, text = text[:cpt], text[cpt + 1:]
-               lines.append(line)
-       lines.append(text)
-       return lines
+    "Returns position of the last space found before 'length' chars"
+    l = length
+    c = text[l]
+    while c != ' ':
+        l -= 1
+        if l == 0:
+            return length  # no space found
+        c = text[l]
+    return l
+
+
+def textWrap(text, length=70):
+    lines = []
+    while len(text) > 70:
+        cpt = cutPoint(text, length)
+        line, text = text[:cpt], text[cpt + 1:]
+        lines.append(line)
+    lines.append(text)
+    return lines
+
 
 def write_sysinfo(op):
-       output_filename = "system-info.txt"
-       warnings = 0
-       notices = 0
-
-       if output_filename in bpy.data.texts.keys():
-           output = bpy.data.texts[output_filename]
-           output.clear()
-       else:
-           output = bpy.data.texts.new(name=output_filename)
-
-       header = '= Blender {} System Information =\n'.format(bpy.app.version_string)
-       lilies = '{}\n\n'.format(len(header)*'=')
-       firstlilies = '{}\n'.format(len(header)*'=')
-       output.write(firstlilies)
-       output.write(header)
-       output.write(lilies)
-
-       # build info
-       output.write('\nBlender:\n')
-       output.write(lilies)
-       output.write('version {}, revision {}. {}\n'.format(bpy.app.version_string, bpy.app.build_revision, bpy.app.build_type))
-       output.write('build date: {}, {}\n'.format(bpy.app.build_date, bpy.app.build_time))
-       output.write('platform: {}\n'.format(bpy.app.build_platform))
-       output.write('binary path: {}\n'.format(bpy.app.binary_path))
-       output.write('build cflags: {}\n'.format(bpy.app.build_cflags))
-       output.write('build cxxflags: {}\n'.format(bpy.app.build_cxxflags))
-       output.write('build linkflags: {}\n'.format(bpy.app.build_linkflags))
-       output.write('build system: {}\n'.format(bpy.app.build_system))
-
-       # python info
-       output.write('\nPython:\n')
-       output.write(lilies)
-       output.write('version: {}\n'.format(sys.version))
-       output.write('paths:\n')
-       for p in sys.path:
-           output.write('\t{}\n'.format(p))
-
-       output.write('\nDirectories:\n')
-       output.write(lilies)
-       output.write('scripts: {}\n'.format(bpy.utils.script_paths()))
-       output.write('user scripts: {}\n'.format(bpy.utils.user_script_path()))
-       output.write('datafiles: {}\n'.format(bpy.utils.user_resource('DATAFILES')))
-       output.write('config: {}\n'.format(bpy.utils.user_resource('CONFIG')))
-       output.write('scripts : {}\n'.format(bpy.utils.user_resource('SCRIPTS')))
-       output.write('autosave: {}\n'.format(bpy.utils.user_resource('AUTOSAVE')))
-       output.write('tempdir: {}\n'.format(bpy.app.tempdir))
-
-       output.write('\nOpenGL\n')
-       output.write(lilies)
-       output.write('renderer:\t{}\n'.format(bgl.glGetString(bgl.GL_RENDERER)))
-       output.write('vendor:\t\t{}\n'.format(bgl.glGetString(bgl.GL_VENDOR)))
-       output.write('version:\t{}\n'.format(bgl.glGetString(bgl.GL_VERSION)))
-       output.write('extensions:\n')
-
-       glext = bgl.glGetString(bgl.GL_EXTENSIONS)
-       glext = textWrap(glext, 70)
-       for l in glext:
-           output.write('\t\t{}\n'.format(l))
-       
-       op.report({'INFO'}, "System information generated in 'system-info.txt'")
+    output_filename = "system-info.txt"
+    warnings = 0
+    notices = 0
+
+    if output_filename in bpy.data.texts.keys():
+        output = bpy.data.texts[output_filename]
+        output.clear()
+    else:
+        output = bpy.data.texts.new(name=output_filename)
+
+    header = '= Blender {} System Information =\n'.format(bpy.app.version_string)
+    lilies = '{}\n\n'.format(len(header) * '=')
+    firstlilies = '{}\n'.format(len(header) * '=')
+    output.write(firstlilies)
+    output.write(header)
+    output.write(lilies)
+
+    # build info
+    output.write('\nBlender:\n')
+    output.write(lilies)
+    output.write('version {}, revision {}. {}\n'.format(bpy.app.version_string, bpy.app.build_revision, bpy.app.build_type))
+    output.write('build date: {}, {}\n'.format(bpy.app.build_date, bpy.app.build_time))
+    output.write('platform: {}\n'.format(bpy.app.build_platform))
+    output.write('binary path: {}\n'.format(bpy.app.binary_path))
+    output.write('build cflags: {}\n'.format(bpy.app.build_cflags))
+    output.write('build cxxflags: {}\n'.format(bpy.app.build_cxxflags))
+    output.write('build linkflags: {}\n'.format(bpy.app.build_linkflags))
+    output.write('build system: {}\n'.format(bpy.app.build_system))
+
+    # python info
+    output.write('\nPython:\n')
+    output.write(lilies)
+    output.write('version: {}\n'.format(sys.version))
+    output.write('paths:\n')
+    for p in sys.path:
+        output.write('\t{}\n'.format(p))
+
+    output.write('\nDirectories:\n')
+    output.write(lilies)
+    output.write('scripts: {}\n'.format(bpy.utils.script_paths()))
+    output.write('user scripts: {}\n'.format(bpy.utils.user_script_path()))
+    output.write('datafiles: {}\n'.format(bpy.utils.user_resource('DATAFILES')))
+    output.write('config: {}\n'.format(bpy.utils.user_resource('CONFIG')))
+    output.write('scripts : {}\n'.format(bpy.utils.user_resource('SCRIPTS')))
+    output.write('autosave: {}\n'.format(bpy.utils.user_resource('AUTOSAVE')))
+    output.write('tempdir: {}\n'.format(bpy.app.tempdir))
+
+    output.write('\nOpenGL\n')
+    output.write(lilies)
+    output.write('renderer:\t{}\n'.format(bgl.glGetString(bgl.GL_RENDERER)))
+    output.write('vendor:\t\t{}\n'.format(bgl.glGetString(bgl.GL_VENDOR)))
+    output.write('version:\t{}\n'.format(bgl.glGetString(bgl.GL_VERSION)))
+    output.write('extensions:\n')
+
+    glext = bgl.glGetString(bgl.GL_EXTENSIONS)
+    glext = textWrap(glext, 70)
+    for l in glext:
+        output.write('\t\t{}\n'.format(l))
+
+    op.report({'INFO'}, "System information generated in 'system-info.txt'")
index 24a56c7a1e1e0f22e7efd19dbdf844cb0cb7c075..e5eab045e9453748d2878fa749fe950bd279dcb9 100644 (file)
@@ -699,5 +699,6 @@ class UpdateAnimData(bpy.types.Operator):
 if __name__ == "__main__":
     bpy.ops.anim.update_data_paths()
 
+
 def register():
     pass
index b9483cd769a7f569a0c885aa3dc22916a129beef..98d3f3f74a3b3df12b44f7719d13892e8f309671 100644 (file)
@@ -82,9 +82,9 @@ def get_console(console_id):
         namespace["__builtins__"] = sys.modules["builtins"]
         namespace["bpy"] = bpy
         namespace["C"] = bpy.context
-        
-        namespace.update(__import__("mathutils").__dict__) # from mathutils import *
-        namespace.update(__import__("math").__dict__) # from math import *
+
+        namespace.update(__import__("mathutils").__dict__)  # from mathutils import *
+        namespace.update(__import__("math").__dict__)  # from math import *
 
         console = InteractiveConsole(locals=namespace, filename="<blender_console>")
 
@@ -186,7 +186,7 @@ def execute(context):
 
     # restore the stdin
     sys.stdin = stdin_backup
-    
+
     # execute any hooks
     for func, args in execute.hooks:
         func(*args)
index ec56f76b11f288e4b8fc7bdaf369474416a56f52..211db8b9cb322eeac0b841326852b3666b23d1ec 100644 (file)
@@ -34,7 +34,7 @@ class BvhImporter(bpy.types.Operator, ImportHelper):
     '''Load a OBJ Motion Capture File'''
     bl_idname = "import_anim.bvh"
     bl_label = "Import BVH"
-    
+
     filename_ext = ".bvh"
     filter_glob = StringProperty(default="*.bvh", options={'HIDDEN'})
 
index ef0fb92aee5c476784db0aeec7d02e4781355614..f3d781448f81f2bef13a71b38269dcd9ece8a502 100644 (file)
@@ -30,19 +30,19 @@ from mathutils import Vector, Euler, Matrix
 
 class bvh_node_class(object):
     __slots__ = (
-    'name',# bvh joint name
-    'parent',# bvh_node_class type or None for no parent
-    'children',# a list of children of this type.
-    'rest_head_world',# worldspace rest location for the head of this node
-    'rest_head_local',# localspace rest location for the head of this node
-    'rest_tail_world',# # worldspace rest location for the tail of this node
-    'rest_tail_local',# # worldspace rest location for the tail of this node
-    'channels',# list of 6 ints, -1 for an unused channel, otherwise an index for the BVH motion data lines, lock triple then rot triple
-    'rot_order',# a triple of indicies as to the order rotation is applied. [0,1,2] is x/y/z - [None, None, None] if no rotation.
-    'anim_data',# a list one tuple's one for each frame. (locx, locy, locz, rotx, roty, rotz)
-    'has_loc',# Conveinience function, bool, same as (channels[0]!=-1 or channels[1]!=-1 channels[2]!=-1)
-    'has_rot',# Conveinience function, bool, same as (channels[3]!=-1 or channels[4]!=-1 channels[5]!=-1)
-    'temp')# use this for whatever you want
+    'name',  # bvh joint name
+    'parent',  # bvh_node_class type or None for no parent
+    'children',  # a list of children of this type.
+    'rest_head_world',  # worldspace rest location for the head of this node
+    'rest_head_local',  # localspace rest location for the head of this node
+    'rest_tail_world',  # worldspace rest location for the tail of this node
+    'rest_tail_local',  # worldspace rest location for the tail of this node
+    'channels',  # list of 6 ints, -1 for an unused channel, otherwise an index for the BVH motion data lines, lock triple then rot triple
+    'rot_order',  # a triple of indicies as to the order rotation is applied. [0,1,2] is x/y/z - [None, None, None] if no rotation.
+    'anim_data',  # a list one tuple's one for each frame. (locx, locy, locz, rotx, roty, rotz)
+    'has_loc',  # Conveinience function, bool, same as (channels[0]!=-1 or channels[1]!=-1 channels[2]!=-1)
+    'has_rot',  # Conveinience function, bool, same as (channels[3]!=-1 or channels[4]!=-1 channels[5]!=-1)
+    'temp')  # use this for whatever you want
 
     def __init__(self, name, rest_head_world, rest_head_local, parent, channels, rot_order):
         self.name = name
@@ -58,7 +58,6 @@ class bvh_node_class(object):
         self.has_loc = channels[0] != -1 or channels[1] != -1 or channels[2] != -1
         self.has_rot = channels[3] != -1 or channels[4] != -1 or channels[5] != -1
 
-
         self.children = []
 
         # list of 6 length tuples: (lx,ly,lz, rx,ry,rz)
@@ -105,9 +104,7 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
     # Split by whitespace.
     file_lines = [ll for ll in [l.split() for l in file_lines] if ll]
 
-
     # Create Hirachy as empties
-
     if file_lines[0][0].lower() == 'hierarchy':
         #print 'Importing the BVH Hierarchy for:', file_path
         pass
@@ -119,9 +116,8 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
 
     channelIndex = -1
 
-
-    lineIdx = 0 # An index for the file.
-    while lineIdx < len(file_lines) -1:
+    lineIdx = 0  # An index for the file.
+    while lineIdx < len(file_lines) - 1:
         #...
         if file_lines[lineIdx][0].lower() == 'root' or file_lines[lineIdx][0].lower() == 'joint':
 
@@ -137,9 +133,9 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
 
             #print '%snode: %s, parent: %s' % (len(bvh_nodes_serial) * '  ', name,  bvh_nodes_serial[-1])
 
-            lineIdx += 2 # Incriment to the next line (Offset)
+            lineIdx += 2  # Incriment to the next line (Offset)
             rest_head_local = Vector((float(file_lines[lineIdx][1]), float(file_lines[lineIdx][2]), float(file_lines[lineIdx][3]))) * GLOBAL_SCALE
-            lineIdx += 1 # Incriment to the next line (Channels)
+            lineIdx += 1  # Incriment to the next line (Channels)
 
             # newChannel[Xposition, Yposition, Zposition, Xrotation, Yrotation, Zrotation]
             # newChannel references indecies to the motiondata,
@@ -150,7 +146,7 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
             rot_count = 0
             for channel in file_lines[lineIdx][2:]:
                 channel = channel.lower()
-                channelIndex += 1 # So the index points to the right channel
+                channelIndex += 1  # So the index points to the right channel
                 if channel == 'xposition':
                     my_channel[0] = channelIndex
                 elif channel == 'yposition':
@@ -173,8 +169,7 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
 
             channels = file_lines[lineIdx][2:]
 
-            my_parent = bvh_nodes_serial[-1] # account for none
-
+            my_parent = bvh_nodes_serial[-1]  # account for none
 
             # Apply the parents offset accumletivly
             if my_parent is None:
@@ -188,24 +183,23 @@ def read_bvh(context, file_path, ROT_MODE='XYZ', GLOBAL_SCALE=1.0):
             bvh_nodes_serial.append(bvh_node)
 
         # Account for an end node
-        if file_lines[lineIdx][0].lower() == 'end' and file_lines[lineIdx][1].lower() == 'site': # There is somtimes a name after 'End Site' but we will ignore it.
-            lineIdx += 2 # Incriment to the next line (Offset)
+        if file_lines[lineIdx][0].lower() == 'end' and file_lines[lineIdx][1].lower() == 'site':  # There is somtimes a name after 'End Site' but we will ignore it.
+            lineIdx += 2  # Incriment to the next line (Offset)
             rest_tail = Vector((float(file_lines[lineIdx][1]), float(file_lines[lineIdx][2]), float(file_lines[lineIdx][3]))) * GLOBAL_SCALE
 
             bvh_nodes_serial[-1].rest_tail_world = bvh_nodes_serial[-1].rest_head_world + rest_tail
             bvh_nodes_serial[-1].rest_tail_local = bvh_nodes_serial[-1].rest_head_local + rest_tail
 
-
             # Just so we can remove the Parents in a uniform way- End end never has kids
             # so this is a placeholder
             bvh_nodes_serial.append(None)
 
-        if len(file_lines[lineIdx]) == 1 and file_lines[lineIdx][0] == '}': # == ['}']
-            bvh_nodes_serial.pop() # Remove the last item
+        if len(file_lines[lineIdx]) == 1 and file_lines[lineIdx][0] == '}':  # == ['}']
+            bvh_nodes_serial.pop()  # Remove the last item
 
         if len(file_lines[lineIdx]) == 1 and file_lines[lineIdx][0].lower() == 'motion':
             #print '\nImporting motion data'
-            lineIdx += 3 # Set the cursor to the first frame
+            lineIdx += 3  # Set the cursor to the first frame
             break
 
         lineIdx += 1
@@ -307,7 +301,7 @@ def bvh_node_dict2objects(context, bvh_nodes, IMPORT_START_FRAME=1, IMPORT_LOOP=
 
     # Parent the objects
     for bvh_node in bvh_nodes.values():
-        bvh_node.temp.makeParent([bvh_node_child.temp for bvh_node_child in bvh_node.children], 1, 0) # ojbs, noninverse, 1 = not fast.
+        bvh_node.temp.makeParent([bvh_node_child.temp for bvh_node_child in bvh_node.children], 1, 0)  # ojbs, noninverse, 1 = not fast.
 
     # Offset
     for bvh_node in bvh_nodes.values():
@@ -318,7 +312,7 @@ def bvh_node_dict2objects(context, bvh_nodes, IMPORT_START_FRAME=1, IMPORT_LOOP=
     for name, bvh_node in bvh_nodes.items():
         if not bvh_node.children:
             ob_end = add_ob(name + '_end')
-            bvh_node.temp.makeParent([ob_end], 1, 0) # ojbs, noninverse, 1 = not fast.
+            bvh_node.temp.makeParent([ob_end], 1, 0)  # ojbs, noninverse, 1 = not fast.
             ob_end.loc = bvh_node.rest_tail_local
 
 
@@ -334,7 +328,7 @@ def bvh_node_dict2objects(context, bvh_nodes, IMPORT_START_FRAME=1, IMPORT_LOOP=
 
             bvh_node.temp.rot = rx, ry, rz
 
-            bvh_node.temp.insertIpoKey(Blender.Object.IpoKeyTypes.LOCROT) # XXX invalid
+            bvh_node.temp.insertIpoKey(Blender.Object.IpoKeyTypes.LOCROT)  # XXX invalid
 
     scn.update(1)
     return objects
@@ -396,7 +390,7 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
         if (bone.head - bone.tail).length < 0.001:
             if bvh_node.parent:
                 ofs = bvh_node.parent.rest_head_local - bvh_node.parent.rest_tail_local
-                if ofs.length: # is our parent zero length also?? unlikely
+                if ofs.length:  # is our parent zero length also?? unlikely
                     bone.tail = bone.tail + ofs
                 else:
                     bone.tail.y = bone.tail.y + average_bone_length
@@ -446,7 +440,7 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
             (2, 1, 0): 'ZYX'}
 
         for bvh_node in bvh_nodes.values():
-            bone_name = bvh_node.temp # may not be the same name as the bvh_node, could have been shortened.
+            bone_name = bvh_node.temp  # may not be the same name as the bvh_node, could have been shortened.
             pose_bone = pose_bones[bone_name]
             pose_bone.rotation_mode = eul_order_lookup[tuple(bvh_node.rot_order)]
 
@@ -459,8 +453,8 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
 
     context.scene.update()
 
-    bpy.ops.pose.select_all() # set
-    bpy.ops.anim.keyframe_insert_menu(type=-4) # XXX -     -4 ???
+    bpy.ops.pose.select_all()  # set
+    bpy.ops.anim.keyframe_insert_menu(type=-4)  # XXX -     -4 ???
 
 
 #XXX   action = Blender.Armature.NLA.NewAction("Action")
@@ -475,7 +469,7 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
     # Replace the bvh_node.temp (currently an editbone)
     # With a tuple  (pose_bone, armature_bone, bone_rest_matrix, bone_rest_matrix_inv)
     for bvh_node in bvh_nodes.values():
-        bone_name = bvh_node.temp # may not be the same name as the bvh_node, could have been shortened.
+        bone_name = bvh_node.temp  # may not be the same name as the bvh_node, could have been shortened.
         pose_bone = pose_bones[bone_name]
         rest_bone = arm_data.bones[bone_name]
         bone_rest_matrix = rest_bone.matrix_local.rotation_part()
@@ -498,7 +492,7 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
         prev_euler = [Euler() for i in range(len(bvh_nodes))]
 
     # Animate the data, the last used bvh_node will do since they all have the same number of frames
-    for frame_current in range(len(bvh_node.anim_data)-1): # skip the first frame (rest frame)
+    for frame_current in range(len(bvh_node.anim_data) - 1):  # skip the first frame (rest frame)
         # print frame_current
 
         # if frame_current==40: # debugging
@@ -537,7 +531,7 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
 
     for cu in action.fcurves:
         if IMPORT_LOOP:
-            pass # 2.5 doenst have cyclic now?
+            pass  # 2.5 doenst have cyclic now?
 
         for bez in cu.keyframe_points:
             bez.interpolation = 'LINEAR'
@@ -564,5 +558,5 @@ def load(operator, context, filepath="", rotate_mode='NATIVE', scale=1.0, use_cy
             IMPORT_LOOP=use_cyclic)
 
     print('Done in %.4f\n' % (time.time() - t1))
-    
+
     return {'FINISHED'}
index e08f0105a4414f6b8af0665da8518df92af1bd5d..271a2d23207a063a3a5cce9e3494562d6dac7296 100644 (file)
@@ -32,14 +32,13 @@ import os
 
 
 def save(operator, context, filepath="", use_modifiers=True, use_normals=True, use_uv_coords=True, use_colors=True):
-    
+
     def rvec3d(v):
         return round(v[0], 6), round(v[1], 6), round(v[2], 6)
 
-
     def rvec2d(v):
         return round(v[0], 6), round(v[1], 6)
-    
+
     scene = context.scene
     obj = context.object
 
@@ -94,15 +93,14 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u
     # incase
     color = uvcoord = uvcoord_key = normal = normal_key = None
 
-    mesh_verts = mesh.vertices # save a lookup
-    ply_verts = [] # list of dictionaries
+    mesh_verts = mesh.vertices  # save a lookup
+    ply_verts = []  # list of dictionaries
     # vdict = {} # (index, normal, uv) -> new index
     vdict = [{} for i in range(len(mesh_verts))]
     ply_faces = [[] for f in range(len(mesh.faces))]
     vert_count = 0
     for i, f in enumerate(mesh.faces):
 
-
         smooth = f.use_smooth
         if not smooth:
             normal = tuple(f.normal)
@@ -110,7 +108,7 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u
 
         if faceUV:
             uv = active_uv_layer[i]
-            uv = uv.uv1, uv.uv2, uv.uv3, uv.uv4 # XXX - crufty :/
+            uv = uv.uv1, uv.uv2, uv.uv3, uv.uv4  # XXX - crufty :/
         if vertexColors:
             col = active_col_layer[i]
             col = col.color1[:], col.color2[:], col.color3[:], col.color4[:]
@@ -136,13 +134,12 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u
                 color = col[j]
                 color = int(color[0] * 255.0), int(color[1] * 255.0), int(color[2] * 255.0)
 
-
             key = normal_key, uvcoord_key, color
 
             vdict_local = vdict[vidx]
-            pf_vidx = vdict_local.get(key) # Will be None initially
+            pf_vidx = vdict_local.get(key)  # Will be None initially
 
-            if pf_vidx is None: # same as vdict_local.has_key(key)
+            if pf_vidx is None:  # same as vdict_local.has_key(key)
                 pf_vidx = vdict_local[key] = vert_count
                 ply_verts.append((vidx, normal, uvcoord, color))
                 vert_count += 1
@@ -176,13 +173,13 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u
     file.write('end_header\n')
 
     for i, v in enumerate(ply_verts):
-        file.write('%.6f %.6f %.6f ' % mesh_verts[v[0]].co[:]) # co
+        file.write('%.6f %.6f %.6f ' % mesh_verts[v[0]].co[:])  # co
         if use_normals:
-            file.write('%.6f %.6f %.6f ' % v[1]) # no
+            file.write('%.6f %.6f %.6f ' % v[1])  # no
         if use_uv_coords:
-            file.write('%.6f %.6f ' % v[2]) # uv
+            file.write('%.6f %.6f ' % v[2])  # uv
         if use_colors:
-            file.write('%u %u %u' % v[3]) # col
+            file.write('%u %u %u' % v[3])  # col
         file.write('\n')
 
     for pf in ply_faces:
@@ -202,5 +199,5 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u
     if is_editmode:
         Blender.Window.EditMode(1, '', 0)
     """
-    
+
     return {'FINISHED'}
index 51cec065ac0dd4945150e498d3269ea6db13cac4..d12dc0144e8c0e19540120eb3f741fda5c07e275 100644 (file)
@@ -66,9 +66,11 @@ class Export3DS(bpy.types.Operator, ExportHelper):
 def menu_func_export(self, context):
     self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)")
 
+
 def menu_func_import(self, context):
     self.layout.operator(Import3DS.bl_idname, text="3D Studio (.3ds)")
 
+
 def register():
     bpy.types.INFO_MT_file_import.append(menu_func_import)
     bpy.types.INFO_MT_file_export.append(menu_func_export)
@@ -84,4 +86,3 @@ def unregister():
 
 if __name__ == "__main__":
     register()
-
index b87c6b443470f10112cfc83025f026f94105dc0d..2c1691fc33378dc72cbffe770a41a3f97de31673 100644 (file)
@@ -40,19 +40,18 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
     filename_ext = ".obj"
     filter_glob = StringProperty(default="*.obj;*.mtl", options={'HIDDEN'})
 
-    CREATE_SMOOTH_GROUPS = BoolProperty(name="Smooth Groups", description="Surround smooth groups by sharp edges", default= True)
-    CREATE_FGONS = BoolProperty(name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default= True)
-    CREATE_EDGES = BoolProperty(name="Lines as Edges", description="Import lines and faces with 2 verts as edge", default= True)
-    SPLIT_OBJECTS = BoolProperty(name="Object", description="Import OBJ Objects into Blender Objects", default= True)
-    SPLIT_GROUPS = BoolProperty(name="Group", description="Import OBJ Groups into Blender Objects", default= True)
+    CREATE_SMOOTH_GROUPS = BoolProperty(name="Smooth Groups", description="Surround smooth groups by sharp edges", default=True)
+    CREATE_FGONS = BoolProperty(name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default=True)
+    CREATE_EDGES = BoolProperty(name="Lines as Edges", description="Import lines and faces with 2 verts as edge", default=True)
+    SPLIT_OBJECTS = BoolProperty(name="Object", description="Import OBJ Objects into Blender Objects", default=True)
+    SPLIT_GROUPS = BoolProperty(name="Group", description="Import OBJ Groups into Blender Objects", default=True)
     # old comment: only used for user feedback
     # disabled this option because in old code a handler for it disabled SPLIT* params, it's not passed to load_obj
     # KEEP_VERT_ORDER = BoolProperty(name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True)
-    ROTATE_X90 = BoolProperty(name="-X90", description="Rotate X 90.", default= True)
+    ROTATE_X90 = BoolProperty(name="-X90", description="Rotate X 90.", default=True)
     CLAMP_SIZE = FloatProperty(name="Clamp Scale", description="Clamp the size to this maximum (Zero to Disable)", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=0.0)
-    POLYGROUPS = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default= True)
-    IMAGE_SEARCH = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default= True)
-
+    POLYGROUPS = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default=True)
+    IMAGE_SEARCH = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default=True)
 
     def execute(self, context):
         # print("Selected: " + context.active_object.name)
@@ -74,19 +73,19 @@ class ExportOBJ(bpy.types.Operator, ExportHelper):
     # to the class instance from the operator settings before calling.
 
     # context group
-    use_selection = BoolProperty(name="Selection Only", description="Export selected objects only", default= False)
-    use_all_scenes = BoolProperty(name="All Scenes", description="", default= False)
-    use_animation = BoolProperty(name="Animation", description="", default= False)
+    use_selection = BoolProperty(name="Selection Only", description="Export selected objects only", default=False)
+    use_all_scenes = BoolProperty(name="All Scenes", description="", default=False)
+    use_animation = BoolProperty(name="Animation", description="", default=False)
 
     # object group
-    use_modifiers = BoolProperty(name="Apply Modifiers", description="Apply modifiers (preview resolution)", default= True)
-    use_rotate_x90 = BoolProperty(name="Rotate X90", description="", default= True)
+    use_modifiers = BoolProperty(name="Apply Modifiers", description="Apply modifiers (preview resolution)", default=True)
+    use_rotate_x90 = BoolProperty(name="Rotate X90", description="", default=True)
 
     # extra data group
     use_edges = BoolProperty(name="Edges", description="", default=True)
     use_normals = BoolProperty(name="Normals", description="", default=False)
     use_hq_normals = BoolProperty(name="High Quality Normals", description="", default=True)
-    use_uvs = BoolProperty(name="UVs", description="", default= True)
+    use_uvs = BoolProperty(name="UVs", description="", default=True)
     use_materials = BoolProperty(name="Materials", description="", default=True)
     copy_images = BoolProperty(name="Copy Images", description="", default=False)
     use_triangles = BoolProperty(name="Triangulate", description="", default=False)
@@ -94,11 +93,10 @@ class ExportOBJ(bpy.types.Operator, ExportHelper):
     use_nurbs = BoolProperty(name="Nurbs", description="", default=False)
 
     # grouping group
-    use_blen_objects = BoolProperty(name="Objects as OBJ Objects", description="", default= True)
-    group_by_object = BoolProperty(name="Objects as OBJ Groups ", description="", default= False)
-    group_by_material = BoolProperty(name="Material Groups", description="", default= False)
-    keep_vertex_order = BoolProperty(name="Keep Vertex Order", description="", default= False)
-
+    use_blen_objects = BoolProperty(name="Objects as OBJ Objects", description="", default=True)
+    group_by_object = BoolProperty(name="Objects as OBJ Groups ", description="", default=False)
+    group_by_material = BoolProperty(name="Material Groups", description="", default=False)
+    keep_vertex_order = BoolProperty(name="Keep Vertex Order", description="", default=False)
 
     def execute(self, context):
         from . import export_obj
@@ -117,6 +115,7 @@ def register():
     bpy.types.INFO_MT_file_import.append(menu_func_import)
     bpy.types.INFO_MT_file_export.append(menu_func_export)
 
+
 def unregister():
     bpy.types.INFO_MT_file_import.remove(menu_func_import)
     bpy.types.INFO_MT_file_export.remove(menu_func_export)
index f3852666ac4ea6a5a2531116c5bead1c400234cd..69100f8db7a6f4f0152317abf30e51b9c138a8ff 100644 (file)
@@ -768,7 +768,7 @@ def _write(context, filepath,
             else:
                 objects = scene.objects
 
-            full_path= ''.join(context_name)
+            full_path = ''.join(context_name)
 
             # erm... bit of a problem here, this can overwrite files when exporting frames. not too bad.
             # EXPORT THE FILE.
@@ -789,7 +789,6 @@ def _write(context, filepath,
                   EXPORT_POLYGROUPS,
                   EXPORT_CURVE_AS_NURBS)
 
-
         scene.frame_set(orig_frame, 0.0)
 
     # Restore old active scene.
@@ -825,7 +824,7 @@ def save(operator, context, filepath="",
          use_animation=False,
          ):
 
-    _write(context, filepath, 
+    _write(context, filepath,
            EXPORT_TRI=use_triangles,
            EXPORT_EDGES=use_edges,
            EXPORT_NORMALS=use_normals,
index 1cd1ff5dce1b3050383b1a895e7169d7d64ffde8..a48d16d87a66d6f40c7c2209c26aa7293b08f327 100644 (file)
@@ -58,11 +58,12 @@ class ImportMDD(bpy.types.Operator, ImportHelper):
         from . import import_mdd
         return import_mdd.load(self, context, **self.as_keywords(ignore=("filter_glob",)))
 
+
 class ExportMDD(bpy.types.Operator, ExportHelper):
     '''Animated mesh to MDD vertex keyframe file'''
     bl_idname = "export_shape.mdd"
     bl_label = "Export MDD"
-    
+
     filename_ext = ".mdd"
     filter_glob = StringProperty(default="*.mdd", options={'HIDDEN'})
 
index 3c57ae5afa06cdf556e266fda44e0c34c83903a5..7fb11facf5897dd854ba50a809eba2f01a326963 100644 (file)
@@ -39,7 +39,7 @@ def zero_file(filepath):
     If a file fails, this replaces it with 1 char, better not remove it?
     '''
     file = open(filepath, 'w')
-    file.write('\n') # apparently macosx needs some data in a blank file?
+    file.write('\n')  # apparently macosx needs some data in a blank file?
     file.close()
 
 
@@ -84,13 +84,13 @@ def save(operator, context, filepath="", frame_start=1, frame_end=300, fps=25):
 
     numframes = frame_end - frame_start + 1
     fps = float(fps)
-    f = open(filepath, 'wb') #no Errors yet:Safe to create file
+    f = open(filepath, 'wb')  # no Errors yet:Safe to create file
 
     # Write the header
     f.write(pack(">2i", numframes, numverts))
 
     # Write the frame times (should we use the time IPO??)
-    f.write(pack(">%df" % (numframes), *[frame / fps for frame in range(numframes)])) # seconds
+    f.write(pack(">%df" % (numframes), *[frame / fps for frame in range(numframes)]))  # seconds
 
     #rest frame needed to keep frames in sync
     """
@@ -102,7 +102,7 @@ def save(operator, context, filepath="", frame_start=1, frame_end=300, fps=25):
     me.transform(mat_flip * obj.matrix_world)
     f.write(pack(">%df" % (numverts * 3), *[axis for v in me.vertices for axis in v.co]))
 
-    for frame in range(frame_start, frame_end + 1):#in order to start at desired frame
+    for frame in range(frame_start, frame_end + 1):  # in order to start at desired frame
         """
         Blender.Set('curframe', frame)
         me_tmp.getFromObject(obj.name)
@@ -127,5 +127,5 @@ def save(operator, context, filepath="", frame_start=1, frame_end=300, fps=25):
     Blender.Set('curframe', orig_frame)
     """
     scene.frame_set(orig_frame)
-    
+
     return {'FINISHED'}
index 990c1a56619af31f55b8042712490384c71caea9..02be14e97fa7f3c64dfd2d3c26c6a9aec959cb66 100644 (file)
@@ -36,10 +36,10 @@ from struct import unpack
 
 
 def load(operator, context, filepath, frame_start=0, frame_step=1):
-    
+
     scene = context.scene
     obj = context.object
-    
+
     print('\n\nimporting mdd %r' % filepath)
 
     if bpy.ops.object.mode_set.poll():
@@ -68,37 +68,34 @@ def load(operator, context, filepath, frame_start=0, frame_step=1):
         new_shapekey.name = ("frame_%.4d" % fr)
         new_shapekey_name = new_shapekey.name
 
-        obj.active_shape_key_index = len(obj.data.shape_keys.keys)-1
-        index = len(obj.data.shape_keys.keys)-1
+        obj.active_shape_key_index = len(obj.data.shape_keys.keys) - 1
+        index = len(obj.data.shape_keys.keys) - 1
         obj.show_only_shape_key = True
 
-        verts = obj.data.shape_keys.keys[len(obj.data.shape_keys.keys)-1].data
-
+        verts = obj.data.shape_keys.keys[len(obj.data.shape_keys.keys) - 1].data
 
-        for v in verts: # 12 is the size of 3 floats
+        for v in verts:  # 12 is the size of 3 floats
             v.co[:] = unpack('>3f', file.read(12))
         #me.update()
         obj.show_only_shape_key = False
 
-
         # insert keyframes
         shape_keys = obj.data.shape_keys
 
         scene.frame_current -= 1
         obj.data.shape_keys.keys[index].value = 0.0
-        shape_keys.keys[len(obj.data.shape_keys.keys)-1].keyframe_insert("value")
+        shape_keys.keys[len(obj.data.shape_keys.keys) - 1].keyframe_insert("value")
 
         scene.frame_current += 1
         obj.data.shape_keys.keys[index].value = 1.0
-        shape_keys.keys[len(obj.data.shape_keys.keys)-1].keyframe_insert("value")
+        shape_keys.keys[len(obj.data.shape_keys.keys) - 1].keyframe_insert("value")
 
         scene.frame_current += 1
         obj.data.shape_keys.keys[index].value = 0.0
-        shape_keys.keys[len(obj.data.shape_keys.keys)-1].keyframe_insert("value")
+        shape_keys.keys[len(obj.data.shape_keys.keys) - 1].keyframe_insert("value")
 
         obj.data.update()
 
-
     for i in range(frames):
         UpdateMesh(obj, i)
 
index 01e6a5f3cd0a421b132fa25d537fda192a3181b6..537603672287ca9fd1c9b141ac55f7e9bae85be9 100644 (file)
@@ -552,7 +552,6 @@ class IsolateTypeRender(bpy.types.Operator):
         return {'FINISHED'}
 
 
-
 class ClearAllRestrictRender(bpy.types.Operator):
     '''Reveal all render objects by setting the hide render flag'''
     bl_idname = "object.hide_render_clear_all"
index fc2c9b2731fade3bf2a3e2cd7f8e0ed063b9dc01..8654fb4db3d85db844daf5a75f14bb02ada2ca9d 100644 (file)
@@ -123,21 +123,21 @@ def align_objects(align_x, align_y, align_z, align_mode, relative_to):
 
             # Align Mode
 
-            if relative_to == 'OPT_4': # Active relative
+            if relative_to == 'OPT_4':  # Active relative
                 if align_mode == 'OPT_1':
                     obj_x = obj_loc[0] - negative_x - size_active_x
 
                 elif align_mode == 'OPT_3':
                     obj_x = obj_loc[0] - positive_x + size_active_x
 
-            else: # Everything else relative
+            else:  # Everything else relative
                 if align_mode == 'OPT_1':
                     obj_x = obj_loc[0] - negative_x
 
                 elif align_mode == 'OPT_3':
                     obj_x = obj_loc[0] - positive_x
 
-            if align_mode == 'OPT_2': # All relative
+            if align_mode == 'OPT_2':  # All relative
                 obj_x = obj_loc[0] - center_x
 
             # Relative To
@@ -156,26 +156,24 @@ def align_objects(align_x, align_y, align_z, align_mode, relative_to):
 
             obj.location[0] = loc_x
 
-
         if align_y:
-
             # Align Mode
 
-            if relative_to == 'OPT_4': # Active relative
+            if relative_to == 'OPT_4':  # Active relative
                 if align_mode == 'OPT_1':
                     obj_y = obj_loc[1] - negative_y - size_active_y
 
                 elif align_mode == 'OPT_3':
                     obj_y = obj_loc[1] - positive_y + size_active_y
 
-            else: # Everything else relative
+            else:  # Everything else relative
                 if align_mode == 'OPT_1':
                     obj_y = obj_loc[1] - negative_y
 
                 elif align_mode == 'OPT_3':
                     obj_y = obj_loc[1] - positive_y
 
-            if align_mode == 'OPT_2': # All relative
+            if align_mode == 'OPT_2':  # All relative
                 obj_y = obj_loc[1] - center_y
 
             # Relative To
@@ -194,26 +192,23 @@ def align_objects(align_x, align_y, align_z, align_mode, relative_to):
 
             obj.location[1] = loc_y
 
-
         if align_z:
-
             # Align Mode
-
-            if relative_to == 'OPT_4': # Active relative
+            if relative_to == 'OPT_4':  # Active relative
                 if align_mode == 'OPT_1':
                     obj_z = obj_loc[2] - negative_z - size_active_z
 
                 elif align_mode == 'OPT_3':
                     obj_z = obj_loc[2] - positive_z + size_active_z
 
-            else: # Everything else relative
+            else:  # Everything else relative
                 if align_mode == 'OPT_1':
                     obj_z = obj_loc[2] - negative_z
 
                 elif align_mode == 'OPT_3':
                     obj_z = obj_loc[2] - positive_z
 
-            if align_mode == 'OPT_2': # All relative
+            if align_mode == 'OPT_2':  # All relative
                 obj_z = obj_loc[2] - center_z
 
             # Relative To
index ff1af6794ee1243f84afc4e8af5fda06158700a6..8b8070f34bcd0534b575b5264d2641e47dc9b89e 100644 (file)
@@ -86,6 +86,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even):
 
 from bpy.props import *
 
+
 class RandomizeLocRotSize(bpy.types.Operator):
     '''Randomize objects loc/rot/scale'''
     bl_idname = "object.randomize_transform"
index dd16a4ee5e07ef1f0c9e7c61f5cd954265425f66..36170fb628351aac8659d33a60530476827990e6 100644 (file)
@@ -29,7 +29,7 @@ class AddPresetBase():
      - preset_subdir '''
     # bl_idname = "script.preset_base_add"
     # bl_label = "Add a Python Preset"
-    bl_options = {'REGISTER'} # only because invoke_props_popup requires.
+    bl_options = {'REGISTER'}  # only because invoke_props_popup requires.
 
     name = bpy.props.StringProperty(name="Name", description="Name of the preset, used to make the path name", maxlen=64, default="")
     remove_active = bpy.props.BoolProperty(default=False, options={'HIDDEN'})
@@ -42,13 +42,13 @@ class AddPresetBase():
 
     def execute(self, context):
         import os
-        
+
         if hasattr(self, "pre_cb"):
             self.pre_cb(context)
-        
+
         preset_menu_class = getattr(bpy.types, self.preset_menu)
 
-        if not self.remove_active:        
+        if not self.remove_active:
 
             if not self.name:
                 return {'FINISHED'}
@@ -62,7 +62,7 @@ class AddPresetBase():
                 return {'CANCELLED'}
 
             filepath = os.path.join(target_path, filename) + ".py"
-            
+
             if hasattr(self, "add"):
                 self.add(context, filepath)
             else:
@@ -352,6 +352,7 @@ class WM_MT_operator_presets(bpy.types.Menu):
 
     preset_operator = "script.execute_preset"
 
+
 def register():
     pass
 
index e362d0932c3e717c42a65845036e4f14a31591b8..1b6c036b2d26cc521b2764ffa56e953b8facd094 100644 (file)
 import bpy
 from bpy.props import *
 
+
 def write_svg(fw, mesh, image_width, image_height, face_iter):
     # for making an XML compatible string
     from xml.sax.saxutils import escape
     from os.path import basename
-    
+
     fw('<?xml version="1.0" standalone="no"?>\n')
     fw('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" \n')
     fw('  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')
@@ -126,7 +127,6 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
     for f in mesh_source.faces:
         tot_verts += len(f.vertices)
 
-
     faces_source = mesh_source.faces
 
     # get unique UV's incase there are many overlapping which slow down filling.
@@ -145,7 +145,6 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
     mesh_new_materials = []
     mesh_new_face_vertices = []
 
-
     current_vert = 0
 
     for face_data in face_hash_3:
@@ -167,7 +166,7 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
     mesh.faces.foreach_set("material_index", mesh_new_materials)
 
     mesh.update(calc_edges=True)
-    
+
     obj_solid = bpy.data.objects.new("uv_temp_solid", mesh)
     obj_wire = bpy.data.objects.new("uv_temp_wire", mesh)
     base_solid = scene.objects.link(obj_solid)
@@ -177,11 +176,10 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
 
     # place behind the wire
     obj_solid.location = 0, 0, -1
-    
+
     obj_wire.material_slots[0].link = 'OBJECT'
     obj_wire.material_slots[0].material = material_wire
-    
-    
+
     # setup the camera
     cam = bpy.data.cameras.new("uv_temp")
     cam.type = 'ORTHO'
@@ -204,7 +202,6 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
     material_wire.use_shadeless = True
     material_wire.diffuse_color = 0, 0, 0
 
-
     # scene render settings
     scene.render.use_raytrace = False
     scene.render.alpha_mode = 'STRAIGHT'
@@ -217,11 +214,11 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
     if image_width > image_height:
         scene.render.pixel_aspect_y = image_width / image_height
     elif image_width < image_height:
-        scene.render.pixel_aspect_x = image_height /image_width
-        
+        scene.render.pixel_aspect_x = image_height / image_width
+
     scene.frame_start = 1
     scene.frame_end = 1
-    
+
     scene.render.file_format = 'PNG'
     scene.render.filepath = filepath
 
@@ -236,13 +233,12 @@ def write_png(fw, mesh_source, image_width, image_height, face_iter):
 
     bpy.data.cameras.remove(cam)
     bpy.data.meshes.remove(mesh)
-    
+
     bpy.data.materials.remove(material_wire)
     for mat_solid in material_solids:
         bpy.data.materials.remove(mat_solid)
 
 
-
 class ExportUVLayout(bpy.types.Operator):
     """Export UV layout to file"""
 
@@ -328,7 +324,6 @@ class ExportUVLayout(bpy.types.Operator):
         if is_editmode:
             bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
 
-        
         mesh = obj.data
 
         mode = self.mode
index 1435d34934c217cb12c5ec568f144d6211cd9902..f6cd30edb053311d2a40865bd1cc9ebaa72654c6 100644 (file)
@@ -85,10 +85,10 @@ class BRUSH_OT_set_active_number(bpy.types.Operator):
     number = IntProperty(name="number",
             description="Brush number")
 
-    _attr_dict = {"sculpt"      : "use_paint_sculpt",
+    _attr_dict = {"sculpt": "use_paint_sculpt",
                   "vertex_paint": "use_paint_vertex",
                   "weight_paint": "use_paint_weight",
-                  "image_paint" : "use_paint_texture"}
+                  "image_paint": "use_paint_texture"}
 
     def execute(self, context):
         attr = self._attr_dict.get(self.mode)
@@ -102,6 +102,7 @@ class BRUSH_OT_set_active_number(bpy.types.Operator):
 
         return {'CANCELLED'}
 
+
 class WM_OT_context_set_boolean(bpy.types.Operator):
     '''Set a context value.'''
     bl_idname = "wm.context_set_boolean"
@@ -668,7 +669,6 @@ class WM_OT_doc_edit(bpy.types.Operator):
         return wm.invoke_props_dialog(self, width=600)
 
 
-
 from bpy.props import *
 
 
@@ -689,7 +689,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
     '''Internal use (edit a property data_path)'''
     bl_idname = "wm.properties_edit"
     bl_label = "Edit Property"
-    bl_options = {'REGISTER'} # only because invoke_props_popup requires.
+    bl_options = {'REGISTER'}  # only because invoke_props_popup requires.
 
     data_path = rna_path
     property = rna_property
@@ -803,6 +803,7 @@ class WM_OT_keyconfig_activate(bpy.types.Operator):
         bpy.utils.keyconfig_set(self.filepath)
         return {'FINISHED'}
 
+
 class WM_OT_sysinfo(bpy.types.Operator):
     '''Generate System Info'''
     bl_idname = "wm.sysinfo"
@@ -813,6 +814,7 @@ class WM_OT_sysinfo(bpy.types.Operator):
         sys_info.write_sysinfo(self)
         return {'FINISHED'}
 
+
 def register():
     pass
 
index 61ce3f7503c4672452d56fd275370585d5f746e0..336fc5430c640f12ea2423a1f3c5530479a7d852 100644 (file)
@@ -54,7 +54,7 @@ class BONE_PT_transform(BoneButtonsPanel, bpy.types.Panel):
     def poll(cls, context):
         if context.edit_bone:
             return True
-        
+
         ob = context.object
         return ob and ob.mode == 'POSE' and context.bone
 
index f7cfb1bb8bf63ec290e45244aa97c928e03c2786..85a32236bcc9ed90d23e1e186e31d28779db89e8 100644 (file)
@@ -62,7 +62,7 @@ class DATA_PT_context_curve(CurveButtonsPanel, bpy.types.Panel):
         if ob:
             layout.template_ID(ob, "data")
         elif curve:
-            layout.template_ID(space, "pin_id") # XXX: broken
+            layout.template_ID(space, "pin_id")  # XXX: broken
 
 
 class DATA_PT_shape_curve(CurveButtonsPanel, bpy.types.Panel):
index 1bc68a9e9776d3727ed1f284d3299d1f426e7e24..04c24ffc6b45bb4a1d4ceed8cfe42d29c6719e29 100644 (file)
@@ -60,13 +60,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
         col.prop(md, "use_bone_envelopes", text="Bone Envelopes")
 
         split = layout.split()
-        
+
         col = split.split()
         col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
         sub = col.column()
         sub.active = bool(md.vertex_group)
         sub.prop(md, "invert_vertex_group")
-        
+
         col = layout.column()
         col.prop(md, "use_multi_modifier")
 
index ce04f73294efb8285ab719d338f9a89bb322d9f3..72ae26c1de2748e91bc689b6a98df56853724626 100644 (file)
@@ -68,7 +68,8 @@ class OBJECT_PT_transform(ObjectButtonsPanel, bpy.types.Panel):
         row.column().prop(ob, "scale")
 
         layout.prop(ob, "rotation_mode")
-               
+
+
 class OBJECT_PT_delta_transform(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Delta Transform"
     bl_options = {'DEFAULT_CLOSED'}
index 4db846fc2fe9243cea20198c2b3e40472acb29fe..605ce04f9f882cf7d57b5e2b4ce4718906197572 100644 (file)
@@ -550,17 +550,16 @@ class ConstraintButtonsPanel():
         col.prop(con, "axis_x", text="X")
         col.prop(con, "axis_y", text="Y")
         col.prop(con, "axis_z", text="Z")
-        
 
         if con.pivot_type == 'CONE_TWIST':
             layout.label(text="Limits:")
             split = layout.split()
-        
+
             col = split.column(align=True)
             col.prop(con, "use_angular_limit_x", text="Angular X")
             col.prop(con, "use_angular_limit_y", text="Angular Y")
             col.prop(con, "use_angular_limit_z", text="Angular Z")
-                
+
             col = split.column()
             col.prop(con, "limit_cone_min", text="")
             col = split.column()
@@ -569,7 +568,7 @@ class ConstraintButtonsPanel():
         elif con.pivot_type == 'GENERIC_6_DOF':
             layout.label(text="Limits:")
             split = layout.split()
-            
+
             col = split.column(align=True)
             col.prop(con, "use_limit_x", text="X")
             col.prop(con, "use_limit_y", text="Y")
@@ -577,12 +576,12 @@ class ConstraintButtonsPanel():
             col.prop(con, "use_angular_limit_x", text="Angular X")
             col.prop(con, "use_angular_limit_y", text="Angular Y")
             col.prop(con, "use_angular_limit_z", text="Angular Z")
-                
+
             col = split.column()
             col.prop(con, "limit_generic_min", text="")
             col = split.column()
             col.prop(con, "limit_generic_max", text="")
-      
+
     def CLAMP_TO(self, context, layout, con):
         self.target_template(layout, con)
 
index 52fc57412cc1512d275e6d4012d08b2c25d496a5..9ea41b080af0380cf60a179104d4f3317b422256 100644 (file)
@@ -337,7 +337,7 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
             col.prop(rd, "jpeg2k_ycc")
 
         elif file_format in ('CINEON', 'DPX'):
-            
+
             split = layout.split()
             split.label("FIXME: hard coded Non-Linear, Gamma:1.0")
             '''
@@ -491,7 +491,7 @@ class RENDER_PT_motion_blur(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Sampled Motion Blur"
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER'}
-       
+
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
@@ -527,7 +527,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
         row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
         row.operator("render.preset_add", text="", icon="ZOOMIN")
         row.operator("render.preset_add", text="", icon="ZOOMOUT").remove_active = True
-        
+
         split = layout.split()
 
         col = split.column()
index bc735e574934e04de063e478f3abf2f272646c48..5085e8d2ab5d2939ef4a7ca04c261e9436572504 100644 (file)
@@ -229,7 +229,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
         f.write("# Keying Set: %s\n" % ks.name)
 
         f.write("import bpy\n\n")
-        f.write("scene= bpy.data.scenes[0]\n\n") # XXX, why not use the current scene?
+        f.write("scene= bpy.data.scenes[0]\n\n")  # XXX, why not use the current scene?
 
         # Add KeyingSet and set general settings
         f.write("# Keying Set Level declarations\n")
@@ -238,7 +238,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
         if not ks.is_path_absolute:
             f.write("ks.is_path_absolute = False\n")
         f.write("\n")
-    
+
         f.write("ks.bl_options = %r\n" % ks.bl_options)
         f.write("\n")
 
index 5898f182380c80ec7742bb327734c9d3962209e0..194431161d32197e578de2f8cdeb19655309894e 100644 (file)
@@ -103,7 +103,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
 
         if tex_collection:
             row = layout.row()
-            
+
             row.template_list(idblock, "texture_slots", idblock, "active_texture_index", rows=2)
 
             col = row.column(align=True)
@@ -143,7 +143,6 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
                 split.prop(tex, "type", text="")
 
 
-
 class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
     bl_label = "Preview"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -394,7 +393,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
 
     def draw(self, context):
         layout = self.layout
-        
+
         idblock = context_tex_datablock(context)
         tex = context.texture
         slot = context.texture_slot
@@ -410,7 +409,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
         col.prop(tex, "use_flip_axis", text="Flip X/Y Axis")
 
         col = split.column()
-        
+
         #Only for Material based textures, not for Lamp/World...
         if isinstance(idblock, bpy.types.Material):
             col.prop(tex, "use_normal_map")
@@ -900,7 +899,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
             sub = row.row()
             sub.active = getattr(tex, toggle)
             sub.prop(tex, factor, text=name, slider=True)
-            return sub # XXX, temp. use_map_normal needs to override.
+            return sub  # XXX, temp. use_map_normal needs to override.
 
         if isinstance(idblock, bpy.types.Material):
             if idblock.type in ('SURFACE', 'WIRE'):
@@ -939,13 +938,13 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
                 #sub.prop(tex, "default_value", text="Amount", slider=True)
             elif idblock.type == 'HALO':
                 layout.label(text="Halo:")
-                
+
                 split = layout.split()
-                
+
                 col = split.column()
                 factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", "Color")
                 factor_but(col, "use_map_alpha", "alpha_factor", "Alpha")
-                
+
                 col = split.column()
                 factor_but(col, "use_map_raymir", "raymir_factor", "Size")
                 factor_but(col, "use_map_hardness", "hardness_factor", "Hardness")
index 8b6ad827c1d6d3da27e6857978753c14ffa3a7af..0ab39ce6fdb077ccdfcf5f59dad5ecec704fd863 100644 (file)
@@ -152,7 +152,7 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, bpy.types.Panel):
         split = layout.split()
         split.prop(light, "indirect_factor", text="Factor")
         split.prop(light, "indirect_bounces", text="Bounces")
-        
+
         if light.gather_method == 'RAYTRACE':
             layout.label(text="Only works with Approximate gather method")
 
index c73e2aee8ee57fe58f48933e5392b3621d88d2dd..0a61245da3f61bbeaf4a7cafa9c1723382085bdf 100644 (file)
@@ -20,6 +20,7 @@
 
 import bpy
 
+
 # used for DopeSheet, NLA, and Graph Editors
 def dopesheet_filter(layout, context):
     dopesheet = context.space_data.dopesheet
@@ -100,7 +101,7 @@ class DOPESHEET_HT_header(bpy.types.Header):
         if st.mode == 'DOPESHEET':
             dopesheet_filter(layout, context)
 
-        elif st.mode in ('ACTION','SHAPEKEY'):
+        elif st.mode in ('ACTION', 'SHAPEKEY'):
             layout.template_ID(st, "action", new="action.new")
 
         if st.mode != 'GPENCIL':
index 499fd63f1e68c4b8e92513ee24c7951fde08a8e8..dea306277f194ef22105c8f1a833c12e13c99841 100644 (file)
@@ -57,9 +57,9 @@ class FILEBROWSER_HT_header(bpy.types.Header):
 
             row = layout.row(align=True)
             row.active = params.use_filter
-            
+
             row.prop(params, "use_filter_folder", text="")
-            
+
             if params.filter_glob:
                 #if st.operator and hasattr(st.operator, "filter_glob"):
                 #    row.prop(params, "filter_glob", text="")
index 79acdd9f9ce64f54db67c28694865ad66b97ae3c..15900e803cce5c138180f8f391e1609daa6b6383 100644 (file)
@@ -188,7 +188,7 @@ class GRAPH_MT_key(bpy.types.Menu):
         layout.separator()
         layout.operator_menu_enum("graph.handle_type", "type", text="Handle Type")
         layout.operator_menu_enum("graph.interpolation_type", "type", text="Interpolation Mode")
+
         layout.separator()
         layout.operator("graph.clean")
         layout.operator("graph.sample")
index 93516457dd652aaef0cbedbbf69314a3043b1ac8..464e5bb8cfeb30ab4f0c8ea948570e631513d71e 100644 (file)
@@ -250,7 +250,8 @@ class IMAGE_MT_uvs(bpy.types.Menu):
         layout.separator()
 
         layout.menu("IMAGE_MT_uvs_showhide")
-        
+
+
 class IMAGE_MT_uvs_select_mode(bpy.types.Menu):
     bl_label = "UV Select Mode"
 
@@ -259,9 +260,9 @@ class IMAGE_MT_uvs_select_mode(bpy.types.Menu):
 
         layout.operator_context = 'INVOKE_REGION_WIN'
         toolsettings = context.tool_settings
-        
+
         # do smart things depending on whether uv_select_sync is on
-        
+
         if toolsettings.use_uv_select_sync:
             prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
             prop.value = "(True, False, False)"
@@ -287,7 +288,7 @@ class IMAGE_MT_uvs_select_mode(bpy.types.Menu):
             prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
             prop.value = "FACE"
             prop.data_path = "tool_settings.uv_select_mode"
-        
+
             prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
             prop.value = "ISLAND"
             prop.data_path = "tool_settings.uv_select_mode"
index fdcfa8c422285f74aaf131ba2fd09edccfaad51a..dda21dea84e659c8d2e8e7c1e4129ce51a74d5d6 100644 (file)
@@ -69,7 +69,6 @@ class INFO_HT_header(bpy.types.Header):
         # XXX: this should be right-aligned to the RHS of the region
         layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER', text="")
 
-
         # XXX: BEFORE RELEASE, MOVE FILE MENU OUT OF INFO!!!
         """
         row = layout.row(align=True)
@@ -82,7 +81,7 @@ class INFO_HT_header(bpy.types.Header):
         row = layout.row()
         row.enabled = sinfo.show_report_operator
         row.operator("info.report_replay")
-        
+
         row.menu("INFO_MT_report")
         """
 
@@ -220,6 +219,7 @@ class INFO_MT_curve_add(bpy.types.Menu):
         layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
         layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
 
+
 class INFO_MT_edit_curve_add(bpy.types.Menu):
     bl_idname = "INFO_MT_edit_curve_add"
     bl_label = "Add"
@@ -231,9 +231,9 @@ class INFO_MT_edit_curve_add(bpy.types.Menu):
         layout.operator_context = 'INVOKE_REGION_WIN'
 
         if is_surf:
-          INFO_MT_surface_add.draw(self, context)
+            INFO_MT_surface_add.draw(self, context)
         else:
-          INFO_MT_curve_add.draw(self, context)
+            INFO_MT_curve_add.draw(self, context)
 
 
 class INFO_MT_surface_add(bpy.types.Menu):
index b8a5c2c68c2ff96321cfdb0b8f446479726f97d1..6f547db901591107cb4bac498c0f30e4e12db027 100644 (file)
@@ -390,7 +390,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel):
         col.label(text="Frame Still %d:%d" % (strip.frame_still_start, strip.frame_still_end))
 
         elem = False
-        
+
         if strip.type == 'IMAGE':
             elem = strip.getStripElem(frame_current)
         elif strip.type == 'MOVIE':
@@ -684,7 +684,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel):
         layout.template_ID(strip, "scene_camera")
 
         sce = strip.scene
-        layout.label(text="Original frame range: "+ str(sce.frame_start) +" - "+ str(sce.frame_end) + " (" + str(sce.frame_end-sce.frame_start+1) + ")")
+        layout.label(text="Original frame range: %d-%d (%d)" % (sce.frame_start, sce.frame_end, sce.frame_end - sce.frame_start + 1))
 
 
 class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel):
@@ -793,7 +793,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, bpy.types.Panel):
         render = context.scene.render
 
         col = layout.column()
-        col.active = False #Currently only opengl preview works!
+        col.active = False  # Currently only opengl preview works!
         col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
         col = layout.column()
         #col.active = render.use_sequencer_gl_preview
index 845e1b53687e0a06023609a8291552092c4eb087..6c4aaab84d940329fa829b24419e4b78be425811 100644 (file)
@@ -73,11 +73,11 @@ class TIME_HT_header(bpy.types.Header):
             sub.operator("screen.animation_play", text="", icon='PAUSE')
         row.operator("screen.keyframe_jump", text="", icon='NEXT_KEYFRAME').next = True
         row.operator("screen.frame_jump", text="", icon='FF').end = True
-               
+
         layout.prop(scene, "sync_mode", text="")
 
         layout.separator()
-               
+
         row = layout.row(align=True)
         row.prop(tools, "use_keyframe_insert_auto", text="", toggle=True)
         if screen.is_animation_playing and tools.use_keyframe_insert_auto:
index 3970001652648fa7f0becafb4e22abc849d667bb..e1e0194b99d94c20b45a48009d897c24754c0a51 100644 (file)
@@ -808,6 +808,7 @@ class USERPREF_PT_input(InputKeyMapPanel):
 
         #print("runtime", time.time() - start)
 
+
 class USERPREF_MT_addons_dev_guides(bpy.types.Menu):
     bl_label = "Addons develoment guides"
 
@@ -848,21 +849,21 @@ class USERPREF_PT_addons(bpy.types.Panel):
 
         modules = []
         loaded_modules = set()
-        
+
         # RELEASE SCRIPTS: official scripts distributed in Blender releases
         paths = bpy.utils.script_paths("addons")
-        
+
         # CONTRIB SCRIPTS: good for testing but not official scripts yet
         # if folder addons_contrib/ exists, scripts in there will be loaded too
         paths += bpy.utils.script_paths("addons_contrib")
-        
+
         # EXTERN SCRIPTS: external projects scripts
         # if folder addons_extern/ exists, scripts in there will be loaded too
         paths += bpy.utils.script_paths("addons_extern")
 
         if bpy.app.debug:
             t_main = time.time()
-        
+
         # fake module importing
         def fake_module(mod_name, mod_path, speedy=True):
             if bpy.app.debug:
@@ -953,11 +954,11 @@ class USERPREF_PT_addons(bpy.types.Panel):
         col = split.column()
         col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
         col.prop(context.window_manager, "addon_filter", text="Filter", expand=True)
-        
+
         # menu to open webpages with addons development guides
         col.separator()
-        col.label(text = ' Online Documentation', icon = 'INFO')
-        col.menu('USERPREF_MT_addons_dev_guides', text='Addons Developer Guides')
+        col.label(text=" Online Documentation", icon='INFO')
+        col.menu("USERPREF_MT_addons_dev_guides", text="Addons Developer Guides")
 
         col = split.column()
 
index 8e34eb89af385d9c080f36d675e01b70fd2bcb21..316e4e2be10a94b8724aae95a6ba4a15d8b10c0c 100644 (file)
@@ -128,6 +128,7 @@ class USERPREF_MT_keyconfigs(bpy.types.Menu):
     bl_label = "KeyPresets"
     preset_subdir = "keyconfig"
     preset_operator = "wm.keyconfig_activate"
+
     def draw(self, context):
         props = self.layout.operator("wm.context_set_value", text="Blender (default)")
         props.data_path = "window_manager.keyconfigs.active"
@@ -379,7 +380,7 @@ class InputKeyMapPanel(bpy.types.Panel):
         subcol = subsplit.column()
 
         row = subcol.row(align=True)
-        
+
         #row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config:")
         text = bpy.path.display_name(context.window_manager.keyconfigs.active.name)
         if not text:
@@ -387,7 +388,7 @@ class InputKeyMapPanel(bpy.types.Panel):
         row.menu("USERPREF_MT_keyconfigs", text=text)
         row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMIN")
         row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMOUT").remove_active = True
-    
+
 #        layout.context_pointer_set("keyconfig", wm.keyconfigs.active)
 #        row.operator("wm.keyconfig_remove", text="", icon='X')
 
@@ -605,7 +606,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
         f.write("import bpy\n")
         f.write("import os\n\n")
         f.write("wm = bpy.context.window_manager\n")
-        f.write("kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])\n\n") # keymap must be created by caller
+        f.write("kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])\n\n")  # keymap must be created by caller
 
         # Generate a list of keymaps to export:
         #
index c3ef572d5c401e2bc1e91a0752de8b9cd177e37d..7a791d5b87bf191b79903451df65a872aef11439 100644 (file)
@@ -647,6 +647,7 @@ class VIEW3D_MT_select_face(bpy.types.Menu):  # XXX no matching enum
 
 # ********** Object menu **********
 
+
 class VIEW3D_MT_object(bpy.types.Menu):
     bl_context = "objectmode"
     bl_label = "Object"
@@ -1418,7 +1419,7 @@ class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu):
         if mesh.total_edge_sel and (select_mode[0] or select_mode[1]):
             menu += ["EDGE"]
         if mesh.total_vert_sel and select_mode[0]:
-            menu += ["VERT"]        
+            menu += ["VERT"]
 
         # should never get here
         return menu
index 529ec750d6715b2155b17efd08403377c407d284..5731a915ab2f8592e12061550c4a17f6119dde41 100644 (file)
@@ -1077,9 +1077,9 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, bpy.types.Panel):
 
     def draw(self, context):
         layout = self.layout
-               
+
         ob = context.active_object
-               
+
         col = layout.column()
         col.active = ob.vertex_groups.active != None
         col.operator("object.vertex_group_normalize_all", text="Normalize All")
index 12cdf5c3b60da398bb56952fbe2412d605d60db0..3ccd7dd79b6a500d09a75803e69244e08f5eab1d 100644 (file)
@@ -48,7 +48,7 @@ def file_list_py(path):
 
 def is_pep8(path):
     print(path)
-    f = open(path, 'r')
+    f = open(path, 'r', encoding="utf8")
     for i in range(PEP8_SEEK_COMMENT):
         line = f.readline()
         if line.startswith("# <pep8"):