diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-31 17:33:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-31 17:33:27 +0300 |
commit | fbadf21b00dba10945d269cf7a82e091833bfcb4 (patch) | |
tree | de28edbb39e97849fb59cb4edbcee4f09c7da282 /release/scripts/modules/rigify | |
parent | 22d8742f0dab025f2789e28e337277f761d4e189 (diff) |
pep8 changes to rigify (minor warnings still there)
also found quite a few cases where variables were used that hadnt been defined.
Diffstat (limited to 'release/scripts/modules/rigify')
-rw-r--r-- | release/scripts/modules/rigify/arm_biped.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/rigify/copy.py | 1 | ||||
-rw-r--r-- | release/scripts/modules/rigify/eye_balls.py | 7 | ||||
-rw-r--r-- | release/scripts/modules/rigify/eye_lid.py | 10 | ||||
-rw-r--r-- | release/scripts/modules/rigify/finger_curl.py | 3 | ||||
-rw-r--r-- | release/scripts/modules/rigify/leg_biped.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/rigify/leg_quadruped.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/rigify/mouth.py | 8 | ||||
-rw-r--r-- | release/scripts/modules/rigify/neck_flex.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/rigify/palm_curl.py | 1 | ||||
-rw-r--r-- | release/scripts/modules/rigify/shape_key_distance.py | 6 | ||||
-rw-r--r-- | release/scripts/modules/rigify/shape_key_rotdiff.py | 6 | ||||
-rw-r--r-- | release/scripts/modules/rigify/spine_pivot_flex.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/rigify/stretch.py | 4 | ||||
-rw-r--r-- | release/scripts/modules/rigify/stretch_twist.py | 4 | ||||
-rw-r--r-- | release/scripts/modules/rigify/track_dual.py | 9 | ||||
-rw-r--r-- | release/scripts/modules/rigify/track_reverse.py | 4 |
17 files changed, 29 insertions, 44 deletions
diff --git a/release/scripts/modules/rigify/arm_biped.py b/release/scripts/modules/rigify/arm_biped.py index 935e5bb4e33..83b1b30152b 100644 --- a/release/scripts/modules/rigify/arm_biped.py +++ b/release/scripts/modules/rigify/arm_biped.py @@ -20,7 +20,7 @@ import bpy from math import radians, pi -from rigify import RigifyError, get_layer_dict, ORG_PREFIX +from rigify import RigifyError, ORG_PREFIX from rigify_utils import bone_class_instance, copy_bone_simple, add_pole_target_bone, add_stretch_to, blend_bone_list, get_side_name, get_base_name from rna_prop_ui import rna_idprop_ui_prop_get from Mathutils import Vector diff --git a/release/scripts/modules/rigify/copy.py b/release/scripts/modules/rigify/copy.py index 2d4a3da8c44..b3dab355a01 100644 --- a/release/scripts/modules/rigify/copy.py +++ b/release/scripts/modules/rigify/copy.py @@ -19,7 +19,6 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict from rigify_utils import bone_class_instance, copy_bone_simple METARIG_NAMES = ("cpy",) diff --git a/release/scripts/modules/rigify/eye_balls.py b/release/scripts/modules/rigify/eye_balls.py index 995cd555c55..7d66be89f7d 100644 --- a/release/scripts/modules/rigify/eye_balls.py +++ b/release/scripts/modules/rigify/eye_balls.py @@ -20,10 +20,9 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get -from math import acos from Mathutils import Vector -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple #METARIG_NAMES = ("cpy",) RIG_TYPE = "eye_balls" @@ -70,7 +69,7 @@ def metarig_definition(obj, orig_bone_name): try: chain += [bone.parent.name, bone.name] except AttributeError: - raise RigifyError("'%s' rig type requires a parent (bone: %s)" % (RIG_TYPE, base_names[0])) + raise RigifyError("'%s' rig type requires a parent (bone: %s)" % (RIG_TYPE, orig_bone_name)) return chain diff --git a/release/scripts/modules/rigify/eye_lid.py b/release/scripts/modules/rigify/eye_lid.py index 9824b6eeb16..ac6a12e842c 100644 --- a/release/scripts/modules/rigify/eye_lid.py +++ b/release/scripts/modules/rigify/eye_lid.py @@ -22,8 +22,8 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get from math import acos from Mathutils import Vector -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple #METARIG_NAMES = ("cpy",) RIG_TYPE = "eye_lid" @@ -71,12 +71,12 @@ def metarig_definition(obj, orig_bone_name): try: chain += [bone.parent.parent.name, bone.parent.name, bone.name] except AttributeError: - raise RigifyError("'%s' rig type requires a chain of two parents (bone: %s)" % (RIG_TYPE, base_names[0])) + raise RigifyError("'%s' rig type requires a chain of two parents (bone: %s)" % (RIG_TYPE, orig_bone_name)) chain += [child.name for child in bone.children_recursive_basename] if len(chain) < 10: - raise RigifyError("'%s' rig type requires a chain of 10 bones (bone: %s)" % (RIG_TYPE, base_names[0])) + raise RigifyError("'%s' rig type requires a chain of 10 bones (bone: %s)" % (RIG_TYPE, orig_bone_name)) chain = chain[:10] @@ -84,7 +84,7 @@ def metarig_definition(obj, orig_bone_name): chain += [bb[chain[9]].children[0].name] chain += [bb[chain[10]].children[0].name] except IndexError: - raise RigifyError("'%s' rig type requires a chain of 10 bones (bone: %s)" % (RIG_TYPE, base_names[0])) + raise RigifyError("'%s' rig type requires a chain of 10 bones (bone: %s)" % (RIG_TYPE, orig_bone_name)) return chain diff --git a/release/scripts/modules/rigify/finger_curl.py b/release/scripts/modules/rigify/finger_curl.py index 760ef10607b..da2cf8dc279 100644 --- a/release/scripts/modules/rigify/finger_curl.py +++ b/release/scripts/modules/rigify/finger_curl.py @@ -19,10 +19,9 @@ # <pep8 compliant> import bpy -from rigify import RigifyError, get_layer_dict +from rigify import RigifyError from rigify_utils import copy_bone_simple, get_side_name from rna_prop_ui import rna_idprop_ui_prop_get -from functools import reduce METARIG_NAMES = "finger_01", "finger_02", "finger_03" diff --git a/release/scripts/modules/rigify/leg_biped.py b/release/scripts/modules/rigify/leg_biped.py index be7b103bc8c..6cfb1b92dc2 100644 --- a/release/scripts/modules/rigify/leg_biped.py +++ b/release/scripts/modules/rigify/leg_biped.py @@ -20,7 +20,7 @@ import bpy from math import pi -from rigify import RigifyError, get_layer_dict +from rigify import RigifyError from rigify_utils import bone_class_instance, copy_bone_simple, blend_bone_list, get_side_name, get_base_name from rna_prop_ui import rna_idprop_ui_prop_get diff --git a/release/scripts/modules/rigify/leg_quadruped.py b/release/scripts/modules/rigify/leg_quadruped.py index ef82380dfef..43c54e9f321 100644 --- a/release/scripts/modules/rigify/leg_quadruped.py +++ b/release/scripts/modules/rigify/leg_quadruped.py @@ -22,7 +22,7 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get from math import pi from rigify import RigifyError -from rigify_utils import bone_class_instance, copy_bone_simple, add_pole_target_bone, get_side_name, get_base_name +from rigify_utils import bone_class_instance, copy_bone_simple, get_side_name, get_base_name from Mathutils import Vector METARIG_NAMES = "hips", "thigh", "shin", "foot", "toe" diff --git a/release/scripts/modules/rigify/mouth.py b/release/scripts/modules/rigify/mouth.py index 5ccb8917f47..4a01a272af7 100644 --- a/release/scripts/modules/rigify/mouth.py +++ b/release/scripts/modules/rigify/mouth.py @@ -22,8 +22,8 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get from math import acos, pi from Mathutils import Vector -from rigify import get_layer_dict, RigifyError -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple #METARIG_NAMES = ("cpy",) RIG_TYPE = "mouth" @@ -105,12 +105,12 @@ def metarig_definition(obj, orig_bone_name): try: chain += [bone.parent.parent.name, bone.parent.name, bone.name] except AttributeError: - raise RigifyError("'%s' rig type requires a chain of two parents (bone: %s)" % (RIG_TYPE, base_names[0])) + raise RigifyError("'%s' rig type requires a chain of two parents (bone: %s)" % (RIG_TYPE, orig_bone_name)) chain += [child.name for child in bone.children_recursive_basename] if len(chain) < 10: - raise RigifyError("'%s' rig type requires a chain of 8 bones (bone: %s)" % (RIG_TYPE, base_names[0])) + raise RigifyError("'%s' rig type requires a chain of 8 bones (bone: %s)" % (RIG_TYPE, orig_bone_name)) return chain[:10] diff --git a/release/scripts/modules/rigify/neck_flex.py b/release/scripts/modules/rigify/neck_flex.py index 343d18bda82..b749ab6ad89 100644 --- a/release/scripts/modules/rigify/neck_flex.py +++ b/release/scripts/modules/rigify/neck_flex.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy -from rigify import RigifyError, get_layer_dict +from rigify import RigifyError from rigify_utils import bone_class_instance, copy_bone_simple from rna_prop_ui import rna_idprop_ui_prop_get diff --git a/release/scripts/modules/rigify/palm_curl.py b/release/scripts/modules/rigify/palm_curl.py index b0a1348c938..73a1597dfbe 100644 --- a/release/scripts/modules/rigify/palm_curl.py +++ b/release/scripts/modules/rigify/palm_curl.py @@ -19,7 +19,6 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict from rigify_utils import copy_bone_simple, get_side_name from rna_prop_ui import rna_idprop_ui_prop_get diff --git a/release/scripts/modules/rigify/shape_key_distance.py b/release/scripts/modules/rigify/shape_key_distance.py index 54d5f302bba..c15a27f497d 100644 --- a/release/scripts/modules/rigify/shape_key_distance.py +++ b/release/scripts/modules/rigify/shape_key_distance.py @@ -19,11 +19,7 @@ # <pep8 compliant> import bpy -from rna_prop_ui import rna_idprop_ui_prop_get -from math import acos -from Mathutils import Vector -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError #METARIG_NAMES = ("cpy",) RIG_TYPE = "shape_key_distance" diff --git a/release/scripts/modules/rigify/shape_key_rotdiff.py b/release/scripts/modules/rigify/shape_key_rotdiff.py index 0c83bda36fd..6d6f6cbc615 100644 --- a/release/scripts/modules/rigify/shape_key_rotdiff.py +++ b/release/scripts/modules/rigify/shape_key_rotdiff.py @@ -19,11 +19,7 @@ # <pep8 compliant> import bpy -from rna_prop_ui import rna_idprop_ui_prop_get -from math import acos -from Mathutils import Vector -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError #METARIG_NAMES = ("cpy",) RIG_TYPE = "shape_key_rotdiff" diff --git a/release/scripts/modules/rigify/spine_pivot_flex.py b/release/scripts/modules/rigify/spine_pivot_flex.py index 287a7d0f9d1..b1552b2395b 100644 --- a/release/scripts/modules/rigify/spine_pivot_flex.py +++ b/release/scripts/modules/rigify/spine_pivot_flex.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict +from rigify import RigifyError from rigify_utils import bone_class_instance, copy_bone_simple from rna_prop_ui import rna_idprop_ui_prop_get diff --git a/release/scripts/modules/rigify/stretch.py b/release/scripts/modules/rigify/stretch.py index 7f24951bdef..634232bc6e4 100644 --- a/release/scripts/modules/rigify/stretch.py +++ b/release/scripts/modules/rigify/stretch.py @@ -19,8 +19,8 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict, RigifyError -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple METARIG_NAMES = tuple() RIG_TYPE = "stretch" diff --git a/release/scripts/modules/rigify/stretch_twist.py b/release/scripts/modules/rigify/stretch_twist.py index 2a7953133f9..60ffaa26210 100644 --- a/release/scripts/modules/rigify/stretch_twist.py +++ b/release/scripts/modules/rigify/stretch_twist.py @@ -19,8 +19,8 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple METARIG_NAMES = tuple() RIG_TYPE = "stretch_twist" diff --git a/release/scripts/modules/rigify/track_dual.py b/release/scripts/modules/rigify/track_dual.py index 59a83d9d5f2..1dcd105730b 100644 --- a/release/scripts/modules/rigify/track_dual.py +++ b/release/scripts/modules/rigify/track_dual.py @@ -19,8 +19,8 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple METARIG_NAMES = tuple() RIG_TYPE = "track_dual" @@ -48,12 +48,11 @@ bool_map = {0:False, 1:True, "no":False, "yes":True, "No":False, "Yes":True} + def metarig_definition(obj, orig_bone_name): return (orig_bone_name,) - - def main(obj, bone_definition, base_names, options): """ A dual-bone track setup. Deformation only (no controls). @@ -89,7 +88,6 @@ def main(obj, bone_definition, base_names, options): bone2 = bone_e.name - bpy.ops.object.mode_set(mode='OBJECT') # Constraints @@ -110,4 +108,3 @@ def main(obj, bone_definition, base_names, options): return tuple() - diff --git a/release/scripts/modules/rigify/track_reverse.py b/release/scripts/modules/rigify/track_reverse.py index c74211f41ef..ec6107709e4 100644 --- a/release/scripts/modules/rigify/track_reverse.py +++ b/release/scripts/modules/rigify/track_reverse.py @@ -19,8 +19,8 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple METARIG_NAMES = tuple() RIG_TYPE = "track_reverse" |