diff options
author | Nathan Vegdahl <cessen@cessen.com> | 2013-03-01 04:17:14 +0400 |
---|---|---|
committer | Nathan Vegdahl <cessen@cessen.com> | 2013-03-01 04:17:14 +0400 |
commit | 3e316aace81f6305f61e9ac1d87ebc1717079429 (patch) | |
tree | 1ca9d980b3ed359d67534f7bd7baa9f376d2b3ad /rigify/generate.py | |
parent | 38cc068b90491ddd4bb2d8dc5fefa251cfd64ba4 (diff) |
Rigify: significant upgrade to arm and leg rigs, and misc changes/bugfixes.
Arm/leg rig upgrades:
- Arms and legs no longer scale with their parents, which was
problematic when e.g. the torso of a character did
squash-and-stretch causing the arms/legs to distort and shear.
- Squash-and-stretch for both FK and IK rigs.
- Rubber hose controls.
Misc changes/bugfixes:
- Rigify now locks all pose transforms for non-control bones
automatically.
- The README file now correctly reflects the new rig-type API.
- Scrubbed the code for unused variables and imports.
- PEP8 cleanups.
Diffstat (limited to 'rigify/generate.py')
-rw-r--r-- | rigify/generate.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/rigify/generate.py b/rigify/generate.py index 69c8863b..5e9feafc 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -265,7 +265,6 @@ def generate_rig(context, metarig): try: # Collect/initialize all the rigs. rigs = [] - deformation_rigs = [] for bone in bones_sorted: bpy.ops.object.mode_set(mode='EDIT') rigs += get_bone_rigs(obj, bone) @@ -307,6 +306,16 @@ def generate_rig(context, metarig): obj.data.edit_bones[bone].parent = obj.data.edit_bones[root_bone] bpy.ops.object.mode_set(mode='OBJECT') + # Lock transforms on all non-control bones + r = re.compile("[A-Z][A-Z][A-Z]-") + for bone in bones: + if r.match(bone): + pb = obj.pose.bones[bone] + pb.lock_location = (True, True, True) + pb.lock_rotation = (True, True, True) + pb.lock_rotation_w = True + pb.lock_scale = (True, True, True) + # Every bone that has a name starting with "DEF-" make deforming. All the # others make non-deforming. for bone in bones: |