Rigify:
- Added two driven-shape-key rig types that create and drive shape keys on a mesh/meshes based on the distance or rotation difference between two bones. - Fixed bug in finger curl rig type where secondary finger controls were not created. Finger type can also now (optionally) have a hinge switch (useful when using it for wings). - Changed the blending system in rigify_utils to use copy_transforms constraints instead of copy_loc+copy_rot. - Finished the quadruped leg type. Now has both ik and fk control and ik/fk switching. Also uses a rotating bone to control the knee direction instead of a pole target (seems to work more consistently for quadruped setups). There's still one annoying bug regarding foot roll, but it's not blocking. I'll track it down later. - Mouth rig now creates corrective shape keys on the face mesh for dealing with mouth corners when they spread open. - Biped arm and leg types now cause mesh to scale when you scale the fk controls. - Misc improvements to the rig types.
This commit is contained in:
@@ -145,28 +145,12 @@ def blend_bone_list(obj, apply_bones, from_bones, to_bones, target_bone=None, ta
|
||||
var.targets[0].id = obj
|
||||
var.targets[0].data_path = driver_path
|
||||
|
||||
def blend_location(new_pbone, from_bone_name, to_bone_name):
|
||||
con = new_pbone.constraints.new('COPY_LOCATION')
|
||||
def blend_transforms(new_pbone, from_bone_name, to_bone_name):
|
||||
con = new_pbone.constraints.new('COPY_TRANSFORMS')
|
||||
con.target = obj
|
||||
con.subtarget = from_bone_name
|
||||
|
||||
con = new_pbone.constraints.new('COPY_LOCATION')
|
||||
con.target = obj
|
||||
con.subtarget = to_bone_name
|
||||
|
||||
fcurve = con.driver_add("influence", 0)
|
||||
driver = fcurve.driver
|
||||
driver.type = 'AVERAGE'
|
||||
fcurve.modifiers.remove(0) # grr dont need a modifier
|
||||
|
||||
blend_target(driver)
|
||||
|
||||
def blend_rotation(new_pbone, from_bone_name, to_bone_name):
|
||||
con = new_pbone.constraints.new('COPY_ROTATION')
|
||||
con.target = obj
|
||||
con.subtarget = from_bone_name
|
||||
|
||||
con = new_pbone.constraints.new('COPY_ROTATION')
|
||||
con = new_pbone.constraints.new('COPY_TRANSFORMS')
|
||||
con.target = obj
|
||||
con.subtarget = to_bone_name
|
||||
|
||||
@@ -187,12 +171,8 @@ def blend_bone_list(obj, apply_bones, from_bones, to_bones, target_bone=None, ta
|
||||
|
||||
new_pbone = obj.pose.bones[new_bone_name]
|
||||
|
||||
# if the bone is connected or its location is totally locked then dont add location blending.
|
||||
if not (new_pbone.bone.connected or (False not in new_pbone.lock_location)):
|
||||
blend_location(new_pbone, from_bone_name, to_bone_name)
|
||||
blend_transforms(new_pbone, from_bone_name, to_bone_name)
|
||||
|
||||
if not (False not in new_pbone.lock_rotation): # TODO. 4D chech?
|
||||
blend_rotation(new_pbone, from_bone_name, to_bone_name)
|
||||
|
||||
|
||||
def add_pole_target_bone(obj, base_bone_name, name, mode='CROSS'):
|
||||
|
||||
Reference in New Issue
Block a user