- bone.basename now only gets the name before the first '.', since names like finger.01.L are common

- updated delta not to remove a bone
- spine and neck rigs interpolation bones are now axis aligned to the control bone
- palm tag is expected on the pointer finger rather then the wrist
- operate on bone children first working up the chain (not essential but more pradictable)
This commit is contained in:
2009-12-07 17:21:30 +00:00
parent 161871316e
commit f8f7f57557
8 changed files with 58 additions and 58 deletions

View File

@@ -25,8 +25,8 @@ from rna_prop_ui import rna_idprop_ui_prop_get
# not used, defined for completeness
METARIG_NAMES = tuple()
def metarig_template():
# generated by rigify.write_meta_rig
bpy.ops.object.mode_set(mode='EDIT')
obj = bpy.context.object
arm = obj.data
@@ -73,26 +73,26 @@ def metarig_template():
bone.parent = arm.edit_bones['hand']
bpy.ops.object.mode_set(mode='OBJECT')
pbone = obj.pose.bones['hand']
pbone = obj.pose.bones['palm.05']
pbone['type'] = 'palm'
def metarig_definition(obj, orig_bone_name):
'''
The bone given is the first in a chain
Expects an array of children sorted with the little finger lowest.
The bone given is the first in an array of siblings with a matching basename
sorted with the little finger lowest.
eg.
parent -> [pinky, ring... etc]
[pinky, ring... etc]
'''
arm = obj.data
bone_definition = [orig_bone_name]
palm_ebone = arm.bones[orig_bone_name]
palm_bone = arm.bones[orig_bone_name]
palm_parent = palm_bone.parent
palm_base = palm_bone.basename
bone_definition = [bone.name for bone in palm_parent.children if bone.basename == palm_base]
bone_definition.sort()
children = [ebone.name for ebone in palm_ebone.children]
children.sort() # simply assume the pinky has the lowest name
bone_definition.extend(children)
return bone_definition
return [palm_parent.name] + bone_definition
def main(obj, bone_definition, base_names):