white space commit, so the actual changes in the next commiy wont be so hard to find
This commit is contained in:
@@ -306,7 +306,7 @@ def fk(obj, bone_definition, base_names, options):
|
||||
fk_chain = mt_chain.copy(base_names=base_names) # fk has no prefix!
|
||||
fk_chain.foot_e.name = "MCH-" + fk_chain.foot
|
||||
fk_chain.foot = fk_chain.foot_e.name
|
||||
|
||||
|
||||
# Set up fk foot control
|
||||
foot_e = copy_bone_simple(arm, mt.heel, base_names[mt_chain.foot])
|
||||
foot = foot_e.name
|
||||
@@ -396,7 +396,7 @@ def deform(obj, definitions, base_names, options):
|
||||
center = uleg1.center
|
||||
uleg1.tail = center
|
||||
uleg2.head = center
|
||||
|
||||
|
||||
# Create lower leg bones: two bones, each half of the lower leg.
|
||||
lleg1 = copy_bone_simple(obj.data, definitions[2], "DEF-%s.01" % base_names[definitions[2]], parent=True)
|
||||
lleg2 = copy_bone_simple(obj.data, definitions[2], "DEF-%s.02" % base_names[definitions[2]], parent=True)
|
||||
@@ -406,19 +406,19 @@ def deform(obj, definitions, base_names, options):
|
||||
center = lleg1.center
|
||||
lleg1.tail = center
|
||||
lleg2.head = center
|
||||
|
||||
|
||||
# Create a bone for the second lower leg deform bone to twist with
|
||||
twist = copy_bone_simple(obj.data, lleg2.name, "MCH-leg_twist")
|
||||
twist.length /= 4
|
||||
twist.connected = False
|
||||
twist.parent = obj.data.edit_bones[definitions[3]]
|
||||
|
||||
|
||||
# Create foot bone
|
||||
foot = copy_bone_simple(obj.data, definitions[3], "DEF-%s" % base_names[definitions[3]], parent=True)
|
||||
|
||||
|
||||
# Create toe bone
|
||||
toe = copy_bone_simple(obj.data, definitions[4], "DEF-%s" % base_names[definitions[4]], parent=True)
|
||||
|
||||
|
||||
# Store names before leaving edit mode
|
||||
uleg1_name = uleg1.name
|
||||
uleg2_name = uleg2.name
|
||||
@@ -427,10 +427,10 @@ def deform(obj, definitions, base_names, options):
|
||||
twist_name = twist.name
|
||||
foot_name = foot.name
|
||||
toe_name = toe.name
|
||||
|
||||
|
||||
# Leave edit mode
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
|
||||
|
||||
# Get the pose bones
|
||||
uleg1 = obj.pose.bones[uleg1_name]
|
||||
uleg2 = obj.pose.bones[uleg2_name]
|
||||
@@ -438,56 +438,56 @@ def deform(obj, definitions, base_names, options):
|
||||
lleg2 = obj.pose.bones[lleg2_name]
|
||||
foot = obj.pose.bones[foot_name]
|
||||
toe = obj.pose.bones[toe_name]
|
||||
|
||||
|
||||
# Upper leg constraints
|
||||
con = uleg1.constraints.new('DAMPED_TRACK')
|
||||
con.name = "trackto"
|
||||
con.target = obj
|
||||
con.subtarget = definitions[2]
|
||||
|
||||
|
||||
con = uleg1.constraints.new('COPY_SCALE')
|
||||
con.name = "scale"
|
||||
con.target = obj
|
||||
con.subtarget = definitions[1]
|
||||
|
||||
|
||||
con = uleg2.constraints.new('COPY_ROTATION')
|
||||
con.name = "copy_rot"
|
||||
con.target = obj
|
||||
con.subtarget = definitions[1]
|
||||
|
||||
|
||||
# Lower leg constraints
|
||||
con = lleg1.constraints.new('COPY_ROTATION')
|
||||
con.name = "copy_rot"
|
||||
con.target = obj
|
||||
con.subtarget = definitions[2]
|
||||
|
||||
|
||||
con = lleg1.constraints.new('COPY_SCALE')
|
||||
con.name = "copy_rot"
|
||||
con.target = obj
|
||||
con.subtarget = definitions[2]
|
||||
|
||||
|
||||
con = lleg2.constraints.new('COPY_ROTATION')
|
||||
con.name = "copy_rot"
|
||||
con.target = obj
|
||||
con.subtarget = twist_name
|
||||
|
||||
|
||||
con = lleg2.constraints.new('DAMPED_TRACK')
|
||||
con.name = "trackto"
|
||||
con.target = obj
|
||||
con.subtarget = definitions[3]
|
||||
|
||||
|
||||
# Foot constraint
|
||||
con = foot.constraints.new('COPY_ROTATION')
|
||||
con.name = "copy_rot"
|
||||
con.target = obj
|
||||
con.subtarget = definitions[3]
|
||||
|
||||
|
||||
# Toe constraint
|
||||
con = toe.constraints.new('COPY_ROTATION')
|
||||
con.name = "copy_rot"
|
||||
con.target = obj
|
||||
con.subtarget = definitions[4]
|
||||
|
||||
|
||||
bpy.ops.object.mode_set(mode='EDIT')
|
||||
return (uleg1_name, uleg2_name, lleg1_name, lleg2_name, foot_name, toe_name, None)
|
||||
|
||||
@@ -499,4 +499,4 @@ def main(obj, bone_definition, base_names, options):
|
||||
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
blend_bone_list(obj, bone_definition + [None], bones_fk, bones_ik, target_bone=bones_ik[6], target_prop="ik", blend_default=1.0)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user