diff options
author | Nathan Vegdahl <cessen@cessen.com> | 2013-02-15 19:14:24 +0400 |
---|---|---|
committer | Nathan Vegdahl <cessen@cessen.com> | 2013-02-15 19:14:24 +0400 |
commit | a2b35fb7cca524a9027db863f00fe90d7c15c04f (patch) | |
tree | fb73e9a3bc80d87dda7e95cafb593da3fa3c20a2 /rigify/metarigs | |
parent | 3b3ee36a1d0bce6529b19af4510757b43ee0c846 (diff) |
Bunch of bug fixes.
The biggest fixes relate to keeping ID data modification out of
draw methods. This was breaking Rigify with the current API.
Secondary fix was to move widget meshes to match the bones, even
if the widget meshes already exist. It's nice for when the user
is progressively tweaking the metarig.
Diffstat (limited to 'rigify/metarigs')
-rw-r--r-- | rigify/metarigs/human.py | 79 |
1 files changed, 31 insertions, 48 deletions
diff --git a/rigify/metarigs/human.py b/rigify/metarigs/human.py index 23ec2483..6cc92f3b 100644 --- a/rigify/metarigs/human.py +++ b/rigify/metarigs/human.py @@ -500,8 +500,7 @@ def create(obj): bpy.ops.object.mode_set(mode='OBJECT') pbone = obj.pose.bones[bones['hips']] pbone.rigify_type = 'spine' - pbone.rigify_parameters.add() - pbone.rigify_parameters[0].chain_bone_controls = "1, 2, 3" + pbone.rigify_parameters.chain_bone_controls = "1, 2, 3" pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -524,13 +523,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_ik_layers = True + pbone.rigify_parameters.separate_ik_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].ik_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.ik_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['thigh.R']] @@ -541,13 +539,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_ik_layers = True + pbone.rigify_parameters.separate_ik_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].ik_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.ik_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['ribs']] @@ -590,7 +587,6 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'YXZ' pbone.bone.layers = [True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() pbone = obj.pose.bones[bones['shoulder.R']] pbone.rigify_type = 'basic.copy' pbone.lock_location = (True, True, True) @@ -599,7 +595,6 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'YXZ' pbone.bone.layers = [True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() pbone = obj.pose.bones[bones['foot.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -664,13 +659,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_ik_layers = True + pbone.rigify_parameters.separate_ik_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].ik_layers = [False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.ik_layers = [False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['upper_arm.R']] @@ -681,13 +675,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_ik_layers = True + pbone.rigify_parameters.separate_ik_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].ik_layers = [False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.ik_layers = [False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['toe.L']] @@ -746,7 +739,6 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'YXZ' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() pbone = obj.pose.bones[bones['palm.02.L']] pbone.rigify_type = '' pbone.lock_location = (True, True, True) @@ -779,7 +771,6 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'YXZ' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() pbone = obj.pose.bones[bones['palm.02.R']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -812,13 +803,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['thumb.01.L']] @@ -829,13 +819,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass pbone = obj.pose.bones[bones['finger_middle.01.L']] @@ -846,13 +835,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['finger_ring.01.L']] @@ -863,13 +851,13 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() + try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['finger_pinky.01.L']] @@ -880,13 +868,13 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() + try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['finger_index.01.R']] @@ -897,13 +885,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass pbone = obj.pose.bones[bones['thumb.01.R']] @@ -914,13 +901,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['finger_middle.01.R']] @@ -931,13 +917,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['finger_ring.01.R']] @@ -948,13 +933,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['finger_pinky.01.R']] @@ -965,13 +949,12 @@ def create(obj): pbone.lock_scale = (False, False, False) pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] - pbone.rigify_parameters.add() try: - pbone.rigify_parameters[0].separate_extra_layers = True + pbone.rigify_parameters.separate_extra_layers = True except AttributeError: pass try: - pbone.rigify_parameters[0].extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] + pbone.rigify_parameters.extra_layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass pbone = obj.pose.bones[bones['finger_index.02.L']] |