From c6519481e52b9b2b9f049a63487185cbba2ba965 Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Sat, 1 Jan 2011 12:10:01 +0000 Subject: [PATCH] clear some pep8 complaints --- io_anim_camera.py | 1 - io_import_scene_lwo.py | 2 ++ modules/add_utils.py | 21 +++++++++++---------- space_view3d_copy_attributes.py | 10 +++++----- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/io_anim_camera.py b/io_anim_camera.py index dd975aba5..ebe6e8e1a 100644 --- a/io_anim_camera.py +++ b/io_anim_camera.py @@ -77,7 +77,6 @@ def writeCameras(context, filepath, frame_start, frame_end, only_selected=False) fw("cameras['%s'] = obj\n" % obj.name) fw("\n") - for f in frame_range: scene.frame_set(f) fw("# new frame\n") diff --git a/io_import_scene_lwo.py b/io_import_scene_lwo.py index 2e22ada79..d2c5e2b7d 100644 --- a/io_import_scene_lwo.py +++ b/io_import_scene_lwo.py @@ -1242,9 +1242,11 @@ class IMPORT_OT_lwo(bpy.types.Operator): def menu_func(self, context): self.layout.operator(IMPORT_OT_lwo.bl_idname, text="LightWave Object (.lwo)") + def register(): bpy.types.INFO_MT_file_import.append(menu_func) + def unregister(): bpy.types.INFO_MT_file_import.remove(menu_func) diff --git a/modules/add_utils.py b/modules/add_utils.py index 12e08e523..cb7428929 100644 --- a/modules/add_utils.py +++ b/modules/add_utils.py @@ -26,6 +26,7 @@ import bpy import mathutils from bpy.props import FloatVectorProperty + class AddObjectHelper: '''Helper Class for Add Object Operators''' location = FloatVectorProperty(name='Location', description='Location of new Object') @@ -66,11 +67,11 @@ def add_object_align_init(context, operator): def add_object_data(context, obdata, operator=None): '''Create Object from data - + context: Blender Context obdata: Object data (mesh, curve, camera,...) operator: the active operator (self) - + Returns the Object ''' @@ -115,26 +116,26 @@ def flatten_vector_list(list): '''flatten a list of vetcors to use in foreach_set and the like''' if not list: return None - - result=[] + + result = [] for vec in list: result.extend([i for i in vec]) - + return result - + def list_to_vector_list(list, dimension=3): '''make Vector objects out of a list''' #test if list contains right number of elements - + result = [] for i in range(0, len(list), dimension): try: - vec = mathutils.Vector( [list[i+ind] for ind in range(dimension)] ) + vec = mathutils.Vector([list[i + ind] for ind in range(dimension)]) except: print('Number of elemnts doesnt match into the vectors.') return None - + result.append(vec) - + return result diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py index ece2b4829..05b64ac1a 100644 --- a/space_view3d_copy_attributes.py +++ b/space_view3d_copy_attributes.py @@ -100,8 +100,8 @@ def getmat(bone, active, context, ignoreparent): ''' data_bone = context.active_object.data.bones[bone.name] #all matrices are in armature space unless commented otherwise - otherloc = active.matrix #final 4x4 mat of target, location. - bonemat_local = Matrix(data_bone.matrix_local) #self rest matrix + otherloc = active.matrix # final 4x4 mat of target, location. + bonemat_local = Matrix(data_bone.matrix_local) # self rest matrix if data_bone.parent: parentposemat = Matrix( context.active_object.pose.bones[data_bone.parent.name].matrix) @@ -253,7 +253,7 @@ class CopySelectedPoseConstraints(bpy.types.Operator): generic_copy(old_constraint, new_constraint) return {'FINISHED'} -pose_ops = [] #list of pose mode copy operators +pose_ops = [] # list of pose mode copy operators genops(pose_copies, pose_ops, "pose.copy_", pose_poll_func, pLoopExec) @@ -387,7 +387,7 @@ def obWei(ob, active, context): for i in range(0, len(active.vertex_groups)): groups = active.vertex_groups[i] vgroups_IndexName[groups.index] = groups.name - data = {} # vert_indices, [(vgroup_index, weights)] + data = {} # vert_indices, [(vgroup_index, weights)] for v in me_source.vertices: vg = v.groups vi = v.index @@ -728,7 +728,7 @@ def register(): kc = bpy.context.window_manager.keyconfigs['Blender'] km = kc.keymaps.get("Object Mode") if km is None: - km = kc.keymaps.new(name="Object Mode") + km = kc.keymaps.new(name="Object Mode") kmi = km.items.new('wm.call_menu', 'C', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_copypopup' km = kc.keymaps.get("Pose") -- GitLab