From 6f2787a32081cbc3515808893dba709b0f79e2f4 Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Sun, 1 Jan 2012 12:35:51 +0000 Subject: [PATCH] set as pep8, only minor edits --- rigify/__init__.py | 10 ++++++---- rigify/generate.py | 4 +++- rigify/metarig_menu.py | 3 ++- rigify/metarigs/human.py | 3 ++- rigify/rig_ui_template.py | 4 ++-- rigify/rigs/basic/copy.py | 4 ++-- rigify/rigs/basic/copy_chain.py | 5 ++--- rigify/rigs/biped/arm/__init__.py | 3 ++- rigify/rigs/biped/arm/deform.py | 3 ++- rigify/rigs/biped/arm/fk.py | 3 ++- rigify/rigs/biped/arm/ik.py | 3 ++- rigify/rigs/biped/leg/__init__.py | 3 ++- rigify/rigs/biped/leg/deform.py | 2 ++ rigify/rigs/biped/leg/fk.py | 3 ++- rigify/rigs/biped/leg/ik.py | 3 ++- rigify/rigs/finger.py | 3 ++- rigify/rigs/misc/delta.py | 3 ++- rigify/rigs/neck_short.py | 3 ++- rigify/rigs/palm.py | 3 ++- rigify/rigs/spine.py | 7 ++++--- rigify/ui.py | 2 ++ rigify/utils.py | 6 ++++-- 22 files changed, 53 insertions(+), 30 deletions(-) diff --git a/rigify/__init__.py b/rigify/__init__.py index fc8eb8184..8ec269131 100644 --- a/rigify/__init__.py +++ b/rigify/__init__.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + bl_info = { "name": "Rigify", "author": "Nathan Vegdahl", @@ -24,10 +26,10 @@ bl_info = { "location": "View3D > Add > Armature", "description": "Adds various Rig Templates", "location": "Armature properties", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\ - "Scripts/Rigging/Rigify", - "tracker_url": "http://projects.blender.org/tracker/index.php?"\ - "func=detail&aid=25546", + "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/" + "Scripts/Rigging/Rigify", + "tracker_url": "http://projects.blender.org/tracker/index.php?" + "func=detail&aid=25546", "category": "Rigging"} diff --git a/rigify/generate.py b/rigify/generate.py index 8f5e012ae..2a6bb3084 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy import re import time @@ -166,7 +168,7 @@ def generate_rig(context, metarig): getattr(bone.rigify_parameters[0], prop)) except AttributeError: print("FAILED TO COPY PARAMETER: " + str(prop)) - + # Custom properties for prop in bone.keys(): try: diff --git a/rigify/metarig_menu.py b/rigify/metarig_menu.py index fefb4bd61..d5366480b 100644 --- a/rigify/metarig_menu.py +++ b/rigify/metarig_menu.py @@ -16,6 +16,8 @@ # # ##### END GPL LICENSE BLOCK ##### +# <pep8 compliant> + import bpy from rigify.metarigs import human @@ -53,4 +55,3 @@ def unregister(): bpy.utils.unregister_class(AddHuman) bpy.types.INFO_MT_armature_add.remove(menu_func) - diff --git a/rigify/metarigs/human.py b/rigify/metarigs/human.py index cfc9f0380..23ec2483a 100644 --- a/rigify/metarigs/human.py +++ b/rigify/metarigs/human.py @@ -16,6 +16,8 @@ # # ##### END GPL LICENSE BLOCK ##### +# <pep8 compliant> + import bpy @@ -1146,4 +1148,3 @@ def create(obj): arm.edit_bones.active = bone arm.layers = [(x in [0, 2, 4, 6, 8, 10, 12]) for x in range(0, 32)] - diff --git a/rigify/rig_ui_template.py b/rigify/rig_ui_template.py index f21c40966..c793dadee 100644 --- a/rigify/rig_ui_template.py +++ b/rigify/rig_ui_template.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + UI_SLIDERS = ''' import bpy from mathutils import Matrix, Vector @@ -543,7 +545,6 @@ class RigLayers(bpy.types.Panel): code += "\n row = col.row()\n" code += " row.prop(context.active_object.data, 'layers', index=28, toggle=True, text='Root')\n" - return code @@ -567,4 +568,3 @@ def unregister(): register() ''' - diff --git a/rigify/rigs/basic/copy.py b/rigify/rigs/basic/copy.py index 6a8800b23..f0c5c380b 100644 --- a/rigify/rigs/basic/copy.py +++ b/rigify/rigs/basic/copy.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from rigify.utils import copy_bone from rigify.utils import strip_org, make_deformer_name @@ -88,7 +90,6 @@ class Rig: group.make_control = bpy.props.BoolProperty(name="Control", default=True, description="Create a control bone for the copy") group.make_deform = bpy.props.BoolProperty(name="Deform", default=True, description="Create a deform bone for the copy") - @classmethod def parameters_ui(self, layout, obj, bone): """ Create the ui for the rig parameters. @@ -139,4 +140,3 @@ class Rig: bone.select_head = True bone.select_tail = True arm.edit_bones.active = bone - diff --git a/rigify/rigs/basic/copy_chain.py b/rigify/rigs/basic/copy_chain.py index 937b02f62..eaff060f9 100644 --- a/rigify/rigs/basic/copy_chain.py +++ b/rigify/rigs/basic/copy_chain.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from rigify.utils import MetarigError from rigify.utils import copy_bone @@ -127,7 +129,6 @@ class Rig: group.make_controls = bpy.props.BoolProperty(name="Controls", default=True, description="Create control bones for the copy") group.make_deforms = bpy.props.BoolProperty(name="Deform", default=True, description="Create deform bones for the copy") - @classmethod def parameters_ui(self, layout, obj, bone): """ Create the ui for the rig parameters. @@ -206,5 +207,3 @@ class Rig: bone.select_head = True bone.select_tail = True arm.edit_bones.active = bone - - diff --git a/rigify/rigs/biped/arm/__init__.py b/rigify/rigs/biped/arm/__init__.py index 55cd2564e..b22be16b9 100644 --- a/rigify/rigs/biped/arm/__init__.py +++ b/rigify/rigs/biped/arm/__init__.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy import imp from . import fk, ik, deform @@ -231,4 +233,3 @@ class Rig: bone.select_head = True bone.select_tail = True arm.edit_bones.active = bone - diff --git a/rigify/rigs/biped/arm/deform.py b/rigify/rigs/biped/arm/deform.py index 112c5550d..4ed2cc479 100644 --- a/rigify/rigs/biped/arm/deform.py +++ b/rigify/rigs/biped/arm/deform.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from math import acos from mathutils import Vector, Matrix @@ -227,4 +229,3 @@ class Rig: con.name = "track_to" con.target = self.obj con.subtarget = ftip - diff --git a/rigify/rigs/biped/arm/fk.py b/rigify/rigs/biped/arm/fk.py index 690dab505..770312272 100644 --- a/rigify/rigs/biped/arm/fk.py +++ b/rigify/rigs/biped/arm/fk.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from rigify.utils import MetarigError from rigify.utils import copy_bone @@ -213,4 +215,3 @@ class Rig: mod.levels = 2 return [uarm, farm, hand] - diff --git a/rigify/rigs/biped/arm/ik.py b/rigify/rigs/biped/arm/ik.py index 55147a47d..70720ac92 100644 --- a/rigify/rigs/biped/arm/ik.py +++ b/rigify/rigs/biped/arm/ik.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from mathutils import Vector from math import pi, acos @@ -335,4 +337,3 @@ class Rig: mod.levels = 2 return [uarm, farm, hand, pole] - diff --git a/rigify/rigs/biped/leg/__init__.py b/rigify/rigs/biped/leg/__init__.py index c80376a83..3827d7ccf 100644 --- a/rigify/rigs/biped/leg/__init__.py +++ b/rigify/rigs/biped/leg/__init__.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy import imp from . import fk, ik, deform @@ -268,4 +270,3 @@ class Rig: bone.select_head = True bone.select_tail = True arm.edit_bones.active = bone - diff --git a/rigify/rigs/biped/leg/deform.py b/rigify/rigs/biped/leg/deform.py index 5ea8cf651..e7cd31940 100644 --- a/rigify/rigs/biped/leg/deform.py +++ b/rigify/rigs/biped/leg/deform.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from math import acos from mathutils import Vector, Matrix diff --git a/rigify/rigs/biped/leg/fk.py b/rigify/rigs/biped/leg/fk.py index 5ff9d4a9a..270fffdb6 100644 --- a/rigify/rigs/biped/leg/fk.py +++ b/rigify/rigs/biped/leg/fk.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from mathutils import Vector from rigify.utils import MetarigError @@ -251,4 +253,3 @@ class Rig: mod.levels = 2 return [thigh, shin, foot, foot_mch] - diff --git a/rigify/rigs/biped/leg/ik.py b/rigify/rigs/biped/leg/ik.py index cfac14303..d114b942d 100644 --- a/rigify/rigs/biped/leg/ik.py +++ b/rigify/rigs/biped/leg/ik.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from mathutils import Vector from math import pi, acos @@ -604,4 +606,3 @@ class Rig: mod.levels = 2 return [thigh, shin, foot, pole, foot_roll, foot_ik_target] - diff --git a/rigify/rigs/finger.py b/rigify/rigs/finger.py index 523a9edda..7961a5fd9 100644 --- a/rigify/rigs/finger.py +++ b/rigify/rigs/finger.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from mathutils import Vector from rigify.utils import MetarigError @@ -408,4 +410,3 @@ class Rig: bone.select_head = True bone.select_tail = True arm.edit_bones.active = bone - diff --git a/rigify/rigs/misc/delta.py b/rigify/rigs/misc/delta.py index 2db278f0b..d61cf695c 100644 --- a/rigify/rigs/misc/delta.py +++ b/rigify/rigs/misc/delta.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from math import acos from rigify.utils import MetarigError @@ -158,4 +160,3 @@ def set_mat(obj, bone_name, matrix): a.roll = roll_1 else: a.roll = roll_2 - diff --git a/rigify/rigs/neck_short.py b/rigify/rigs/neck_short.py index edba5c8d7..074208752 100644 --- a/rigify/rigs/neck_short.py +++ b/rigify/rigs/neck_short.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from rigify.utils import MetarigError from rigify.utils import copy_bone, new_bone, put_bone @@ -388,4 +390,3 @@ class Rig: bone.select_head = True bone.select_tail = True arm.edit_bones.active = bone - diff --git a/rigify/rigs/palm.py b/rigify/rigs/palm.py index 1309f626a..1d25050a1 100644 --- a/rigify/rigs/palm.py +++ b/rigify/rigs/palm.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from math import cos, pi from rigify.utils import MetarigError @@ -270,4 +272,3 @@ class Rig: bone.select_head = True bone.select_tail = True arm.edit_bones.active = bone - diff --git a/rigify/rigs/spine.py b/rigify/rigs/spine.py index 1b77c4c3c..cee086152 100644 --- a/rigify/rigs/spine.py +++ b/rigify/rigs/spine.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + """ TODO: - Add parameters for bone transform alphas. """ @@ -71,8 +73,8 @@ class Rig: self.control_indices.sort() self.pivot_rest = self.params.rest_pivot_slide - self.pivot_rest = max(self.pivot_rest, 1.0/len(self.org_bones)) - self.pivot_rest = min(self.pivot_rest, 1.0-(1.0/len(self.org_bones))) + self.pivot_rest = max(self.pivot_rest, 1.0 / len(self.org_bones)) + self.pivot_rest = min(self.pivot_rest, 1.0 - (1.0 / len(self.org_bones))) if len(self.org_bones) <= 1: raise MetarigError("RIGIFY ERROR: Bone '%s': input to rig type must be a chain of 2 or more bones" % (strip_org(bone_name))) @@ -532,7 +534,6 @@ class Rig: group.rest_pivot_slide = bpy.props.FloatProperty(name="Rest Pivot Slide", default=0.0, min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, description="The pivot slide value in the rest pose") group.chain_bone_controls = bpy.props.StringProperty(name="Control bone list", default="", description="Define which bones have controls") - @classmethod def parameters_ui(self, layout, obj, bone): """ Create the ui for the rig parameters. diff --git a/rigify/ui.py b/rigify/ui.py index f187490b0..bc5c4d8ff 100644 --- a/rigify/ui.py +++ b/rigify/ui.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy from bpy.props import * import rigify diff --git a/rigify/utils.py b/rigify/utils.py index 64b42dcd7..197a1a255 100644 --- a/rigify/utils.py +++ b/rigify/utils.py @@ -16,6 +16,8 @@ # #======================= END GPL LICENSE BLOCK ======================== +# <pep8 compliant> + import bpy import imp import random @@ -358,6 +360,7 @@ def create_compass_widget(rig, bone_name): mesh.from_pydata(verts, edges, []) mesh.update() + def create_root_widget(rig, bone_name): """ Creates a widget for the root bone. """ @@ -536,7 +539,7 @@ def write_metarig(obj, layers=False, func_name="create_sample"): return "\n".join(code) -def random_id(length = 8): +def random_id(length=8): """ Generates a random alphanumeric id string. """ tlength = int(length / 2) @@ -548,4 +551,3 @@ def random_id(length = 8): text += random.choice(chars) text += str(hex(int(time.time())))[2:][-tlength:].rjust(tlength, '0')[::-1] return text - -- GitLab