manually sync rigify with render branch

fixes [#22231] Rigify Script Error When Generate From Human(Meta-Rig)
This commit is contained in:
2010-05-03 19:12:11 +00:00
parent 6cb02a1672
commit 20fd05abc1
17 changed files with 72 additions and 71 deletions

View File

@@ -192,7 +192,7 @@ def fk(obj, definitions, base_names, options):
# shoulder is used as a hinge
fk_chain.rename("shoulder", "MCH-%s_hinge" % base_names[mt.arm])
fk_chain.shoulder_e.translate(Vector(0.0, fk_chain.shoulder_e.length / 2, 0.0))
fk_chain.shoulder_e.translate(Vector((0.0, fk_chain.shoulder_e.length / 2, 0.0)))
# upper arm constrains to this.
ex.socket_e = copy_bone_simple(arm, mt.arm, "MCH-%s_socket" % base_names[mt.arm])
@@ -240,7 +240,7 @@ def fk(obj, definitions, base_names, options):
con.name = "hinge"
con.target = obj
con.subtarget = mt.shoulder
driver_fcurve = con.driver_add("influence", 0)
driver_fcurve = con.driver_add("influence")
driver = driver_fcurve.driver

View File

@@ -57,7 +57,7 @@ def addget_shape_key_driver(obj, name="Key"):
if driver_s.data_path == driver_path:
fcurve = driver_s
if fcurve == None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value", 0)
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
new = True
@@ -217,7 +217,7 @@ def control(obj, definitions, base_names, options):
eyes += ["ORG-"+name]
# Get the average position of the eyes
center = Vector(0,0,0)
center = Vector((0, 0, 0))
for eye in eyes:
center += eb[eye].head
if len(eyes) != 0:
@@ -295,7 +295,7 @@ def control(obj, definitions, base_names, options):
con.target = obj
con.subtarget = head
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
mod = fcurve.modifiers[0]

View File

@@ -299,14 +299,15 @@ def control(obj, definitions, base_names, options):
lid8 = copy_bone_simple(obj.data, definitions[9], base_names[definitions[9]]).name
size = eb[lid1].length
eb[lid1].tail = eb[lid1].head + Vector(0,size,0)
eb[lid2].tail = eb[lid2].head + Vector(0,size,0)
eb[lid3].tail = eb[lid3].head + Vector(0,size,0)
eb[lid4].tail = eb[lid4].head + Vector(0,size,0)
eb[lid5].tail = eb[lid5].head + Vector(0,size,0)
eb[lid6].tail = eb[lid6].head + Vector(0,size,0)
eb[lid7].tail = eb[lid7].head + Vector(0,size,0)
eb[lid8].tail = eb[lid8].head + Vector(0,size,0)
size_y = Vector(0.0, size, 0.0)
eb[lid1].tail = eb[lid1].head + size_y
eb[lid2].tail = eb[lid2].head + size_y
eb[lid3].tail = eb[lid3].head + size_y
eb[lid4].tail = eb[lid4].head + size_y
eb[lid5].tail = eb[lid5].head + size_y
eb[lid6].tail = eb[lid6].head + size_y
eb[lid7].tail = eb[lid7].head + size_y
eb[lid8].tail = eb[lid8].head + size_y
eb[lid1].roll = 0
eb[lid2].roll = 0
@@ -438,7 +439,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance*2
con.maximum = distance
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -457,7 +458,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance*2
con.maximum = distance
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -475,7 +476,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance*2
con.maximum = distance
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -493,7 +494,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance*2
con.maximum = distance
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -511,7 +512,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance*2
con.maximum = distance
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -530,7 +531,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance
con.maximum = distance*2
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -548,7 +549,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance
con.maximum = distance*2
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -566,7 +567,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance
con.maximum = distance*2
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -584,7 +585,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance
con.maximum = distance*2
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -602,7 +603,7 @@ def control(obj, definitions, base_names, options):
con.minimum = -distance
con.maximum = distance*2
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()

View File

@@ -291,7 +291,7 @@ def main(obj, bone_definition, base_names, options):
hinge_driver_path = pb[control].path_from_id() + '["hinge"]'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'

View File

@@ -201,7 +201,7 @@ def ik(obj, bone_definition, base_names, options):
ik.knee_target_e.local_location = False
# roll the bone to point up... could also point in the same direction as ik.foot_roll
# ik.foot_roll_02_e.matrix * Vector(0.0, 0.0, 1.0) # ACK!, no rest matrix in editmode
# ik.foot_roll_02_e.matrix * Vector((0.0, 0.0, 1.0)) # ACK!, no rest matrix in editmode
ik.foot_roll_01_e.align_roll((0.0, 0.0, -1.0))
bpy.ops.object.mode_set(mode='OBJECT')
@@ -298,7 +298,7 @@ def fk(obj, bone_definition, base_names, options):
ex.thigh_socket_e = copy_bone_simple(arm, mt_chain.thigh, "MCH-%s_socket" % base_names[mt_chain.thigh], parent=True)
ex.thigh_socket = ex.thigh_socket_e.name
ex.thigh_socket_e.tail = ex.thigh_socket_e.head + Vector(0.0, 0.0, ex.thigh_socket_e.length / 4.0)
ex.thigh_socket_e.tail = ex.thigh_socket_e.head + Vector((0.0, 0.0, ex.thigh_socket_e.length / 4.0))
ex.thigh_hinge_e = copy_bone_simple(arm, mt.hips, "MCH-%s_hinge" % base_names[mt_chain.thigh], parent=False)
ex.thigh_hinge = ex.thigh_hinge_e.name
@@ -351,7 +351,7 @@ def fk(obj, bone_definition, base_names, options):
# add driver
hinge_driver_path = fk_chain.thigh_p.path_from_id() + '["hinge"]'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'

View File

@@ -160,7 +160,7 @@ def ik(obj, bone_definition, base_names, options):
ik.foot_roll_e.parent = ik_chain.foot_e
ik.foot_roll_e.head -= mt_chain.toe_e.vector.normalize() * mt_chain.foot_e.length
ik.foot_roll_e.tail = ik.foot_roll_e.head - (mt_chain.foot_e.vector.normalize() * mt_chain.toe_e.length)
ik.foot_roll_e.align_roll(mt_chain.foot_e.matrix.rotation_part() * Vector(0.0, 0.0, -1.0))
ik.foot_roll_e.align_roll(mt_chain.foot_e.matrix.rotation_part() * Vector((0.0, 0.0, -1.0)))
# MCH-foot
ik.foot_roll_01_e = copy_bone_simple(arm, mt_chain.foot, "MCH-" + base_names[mt_chain.foot])
@@ -213,7 +213,7 @@ def ik(obj, bone_definition, base_names, options):
con = mt_chain.thigh_p.constraints.new('COPY_TRANSFORMS')
con.target = obj
con.subtarget = ik_chain.thigh
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -225,7 +225,7 @@ def ik(obj, bone_definition, base_names, options):
con = mt_chain.shin_p.constraints.new('COPY_TRANSFORMS')
con.target = obj
con.subtarget = ik_chain.shin
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -237,7 +237,7 @@ def ik(obj, bone_definition, base_names, options):
con = mt_chain.foot_p.constraints.new('COPY_TRANSFORMS')
con.target = obj
con.subtarget = ik.foot_roll_02
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -249,7 +249,7 @@ def ik(obj, bone_definition, base_names, options):
con = mt_chain.toe_p.constraints.new('COPY_TRANSFORMS')
con.target = obj
con.subtarget = ik_chain.toe
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -371,7 +371,7 @@ def fk(obj, bone_definition, base_names, options):
hinge_driver_path = pb[fk_chain.thigh].path_from_id() + '["hinge"]'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'

View File

@@ -77,7 +77,7 @@ def addget_shape_key_driver(obj, name="Key"):
if driver_s.data_path == driver_path:
fcurve = driver_s
if fcurve == None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value", 0)
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
new = True
@@ -173,7 +173,7 @@ def deform(obj, definitions, base_names, options):
jopen1 = copy_bone_simple(obj.data, jaw, "MCH-"+base_names[jaw]+".track1", parent=True).name
eb[jopen1].connected = False
eb[jopen1].head = eb[jaw].tail
eb[jopen1].tail = eb[jopen1].head + Vector(0, 0, eb[jaw].length/4)
eb[jopen1].tail = eb[jopen1].head + Vector((0, 0, eb[jaw].length/4))
jopen2 = copy_bone_simple(obj.data, jopen1, "MCH-"+base_names[jaw]+".track2").name
eb[jopen2].parent = eb[jaw]
@@ -427,7 +427,7 @@ def control(obj, definitions, base_names, options):
# Jaw open tracker
jopent = copy_bone_simple(obj.data, jaw_e.name, "MCH-"+base_names[jaw_e.name]+".track", parent=True).name
eb[jopent].connected = False
eb[jopent].tail = jaw_e.tail + Vector(0,0,jaw_e.length)
eb[jopent].tail = jaw_e.tail + Vector((0.0, 0.0, jaw_e.length))
eb[jopent].head = jaw_e.tail
bpy.ops.object.mode_set(mode='OBJECT')
@@ -548,7 +548,7 @@ def control(obj, definitions, base_names, options):
con.minimum = 0.0
con.maximum = 1.0
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -566,7 +566,7 @@ def control(obj, definitions, base_names, options):
con.minimum = 0.0
con.maximum = 1.0
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -584,7 +584,7 @@ def control(obj, definitions, base_names, options):
con.minimum = 0.0
con.maximum = 1.0
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -602,7 +602,7 @@ def control(obj, definitions, base_names, options):
con.minimum = 0.0
con.maximum = 1.0
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -620,7 +620,7 @@ def control(obj, definitions, base_names, options):
con.minimum = 0.0
con.maximum = 1.0
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -638,7 +638,7 @@ def control(obj, definitions, base_names, options):
con.minimum = 0.0
con.maximum = 1.0
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -656,7 +656,7 @@ def control(obj, definitions, base_names, options):
con.minimum = 0.0
con.maximum = 1.0
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -674,7 +674,7 @@ def control(obj, definitions, base_names, options):
con.minimum = 0.0
con.maximum = 1.0
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()

View File

@@ -222,7 +222,7 @@ def main(obj, bone_definition, base_names, options):
hinge_driver_path = pb[neck_ctrl].path_from_id() + '["hinge"]'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -256,7 +256,7 @@ def main(obj, bone_definition, base_names, options):
hinge_driver_path = pb[head_ctrl].path_from_id() + '["hinge"]'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -301,7 +301,7 @@ def main(obj, bone_definition, base_names, options):
if i < (len(neck_head)-1):
inf = (i+1) / len(neck_head)
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
var.name = "ext"

View File

@@ -176,7 +176,7 @@ def main(obj, bone_definition, base_names, options):
ex.neck_socket_e.connected = False
ex.neck_socket_e.parent = mt.body_e
ex.neck_socket_e.head = mt.head_e.head
ex.neck_socket_e.tail = mt.head_e.head - Vector(0.0, neck_chain_segment_length / 2.0, 0.0)
ex.neck_socket_e.tail = mt.head_e.head - Vector((0.0, neck_chain_segment_length / 2.0, 0.0))
ex.neck_socket_e.roll = 0.0
@@ -239,7 +239,7 @@ def main(obj, bone_definition, base_names, options):
# add driver
hinge_driver_path = ex.head_ctrl_p.path_from_id() + '["hinge"]'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -259,7 +259,7 @@ def main(obj, bone_definition, base_names, options):
target_names = [("b%.2d" % (i + 1)) for i in range(len(neck_chain))]
ex.head_ctrl_p["bend_tot"] = 0.0
fcurve = ex.head_ctrl_p.driver_add('["bend_tot"]', 0)
fcurve = ex.head_ctrl_p.driver_add('["bend_tot"]')
driver = fcurve.driver
driver.type = 'SUM'
fcurve.modifiers.remove(0) # grr dont need a modifier
@@ -296,7 +296,7 @@ def main(obj, bone_definition, base_names, options):
con.owner_space = 'LOCAL'
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'SCRIPTED'
driver.expression = "bend/bend_tot"

View File

@@ -254,7 +254,7 @@ def main(obj, bone_definition, base_names, options):
child_pbone_02 = obj.pose.bones[children[1]].bone
rel_vec = child_pbone_01.head - child_pbone_02.head
x_vec = child_pbone_01.matrix.rotation_part() * Vector(1.0, 0.0, 0.0)
x_vec = child_pbone_01.matrix.rotation_part() * Vector((1.0, 0.0, 0.0))
return degrees(rel_vec.angle(x_vec)) > 90.0

View File

@@ -57,7 +57,7 @@ def addget_shape_key_driver(obj, name="Key"):
if driver_s.data_path == driver_path:
fcurve = driver_s
if fcurve == None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value", 0)
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
new = True

View File

@@ -54,7 +54,7 @@ def addget_shape_key_driver(obj, name="Key"):
if driver_s.data_path == driver_path:
fcurve = driver_s
if fcurve == None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value", 0)
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
return fcurve

View File

@@ -54,7 +54,7 @@ def addget_shape_key_driver(obj, name="Key"):
if driver_s.data_path == driver_path:
fcurve = driver_s
if fcurve == None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value", 0)
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
return fcurve

View File

@@ -177,11 +177,11 @@ def main(obj, bone_definition, base_names, options):
# copy the pelvis, offset to make MCH-spine_rotate and MCH-ribcage_hinge
ex.ribcage_hinge_e = copy_bone_simple(arm, mt.pelvis, "MCH-%s_hinge" % base_names[mt.ribcage])
ex.ribcage_hinge = ex.ribcage_hinge_e.name
ex.ribcage_hinge_e.translate(Vector(0.0, spine_chain_segment_length / 4.0, 0.0))
ex.ribcage_hinge_e.translate(Vector((0.0, spine_chain_segment_length / 4.0, 0.0)))
ex.spine_rotate_e = copy_bone_simple(arm, mt.ribcage, "MCH-%s_rotate" % spine_chain_basename)
ex.spine_rotate = ex.spine_rotate_e.name
ex.spine_rotate_e.translate(Vector(0.0, spine_chain_segment_length / 2.0, 0.0))
ex.spine_rotate_e.translate(Vector((0.0, spine_chain_segment_length / 2.0, 0.0)))
ex.spine_rotate_e.connected = False
ex.spine_rotate_e.parent = ex.pelvis_copy_e
@@ -294,7 +294,7 @@ def main(obj, bone_definition, base_names, options):
con.subtarget = ex.pelvis_copy
# add driver
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -350,7 +350,7 @@ def main(obj, bone_definition, base_names, options):
rib_driver_path = ex.ribcage_copy_p.path_from_id()
ex.ribcage_copy_p["bend_tot"] = 0.0
fcurve = ex.ribcage_copy_p.driver_add('["bend_tot"]', 0)
fcurve = ex.ribcage_copy_p.driver_add('["bend_tot"]')
driver = fcurve.driver
driver.type = 'SUM'
fcurve.modifiers.remove(0) # grr dont need a modifier
@@ -385,7 +385,7 @@ def main(obj, bone_definition, base_names, options):
del spine_p
# add driver
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'SCRIPTED'
driver.expression = "bend/bend_tot"
@@ -440,7 +440,7 @@ def main(obj, bone_definition, base_names, options):
if i == spine_chain_len:
con.head_tail = 1.0
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'

View File

@@ -135,7 +135,7 @@ def main(obj, bone_definitions, base_names, options):
# Add drivers
bone_path = pb[bones[0]].path_from_id()
driver_fcurve = con_f.driver_add("influence", 0)
driver_fcurve = con_f.driver_add("influence")
driver = driver_fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()
@@ -148,7 +148,7 @@ def main(obj, bone_definitions, base_names, options):
mod.coefficients[0] = 1.0
mod.coefficients[1] = -1.0
driver_fcurve = con_h.driver_add("influence", 0)
driver_fcurve = con_h.driver_add("influence")
driver = driver_fcurve.driver
driver.type = 'AVERAGE'
var = driver.variables.new()

View File

@@ -179,7 +179,7 @@ def main(obj, bone_definition, base_names, options):
ex.neck_socket_e.connected = False
ex.neck_socket_e.parent = mt.body_e
ex.neck_socket_e.head = mt.head_e.head
ex.neck_socket_e.tail = mt.head_e.head - Vector(0.0, neck_chain_segment_length / 2.0, 0.0)
ex.neck_socket_e.tail = mt.head_e.head - Vector((0.0, neck_chain_segment_length / 2.0, 0.0))
ex.neck_socket_e.roll = 0.0
@@ -243,7 +243,7 @@ def main(obj, bone_definition, base_names, options):
# add driver
hinge_driver_path = ex.head_ctrl_p.path_to_id() + '["hinge"]'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
var = driver.variables.new()
driver.type = 'AVERAGE'
@@ -263,7 +263,7 @@ def main(obj, bone_definition, base_names, options):
target_names = [("b%.2d" % (i + 1)) for i in range(len(neck_chain))]
ex.head_ctrl_p["bend_tot"] = 0.0
fcurve = ex.head_ctrl_p.driver_add('["bend_tot"]', 0)
fcurve = ex.head_ctrl_p.driver_add('["bend_tot"]')
driver = fcurve.driver
driver.type = 'SUM'
fcurve.modifiers.remove(0) # grr dont need a modifier
@@ -308,7 +308,7 @@ def main(obj, bone_definition, base_names, options):
con.owner_space = 'LOCAL'
con.target_space = 'LOCAL'
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'SCRIPTED'
driver.expression = "bend/bend_tot"

View File

@@ -154,7 +154,7 @@ def blend_bone_list(obj, apply_bones, from_bones, to_bones, target_bone=None, ta
con.target = obj
con.subtarget = to_bone_name
fcurve = con.driver_add("influence", 0)
fcurve = con.driver_add("influence")
driver = fcurve.driver
driver.type = 'AVERAGE'
fcurve.modifiers.remove(0) # grr dont need a modifier
@@ -204,12 +204,12 @@ def add_pole_target_bone(obj, base_bone_name, name, mode='CROSS'):
offset.length = distance
elif mode == 'ZAVERAGE':
# between both bones Z axis
z_axis_a = base_ebone.matrix.copy().rotation_part() * Vector(0.0, 0.0, -1.0)
z_axis_b = parent_ebone.matrix.copy().rotation_part() * Vector(0.0, 0.0, -1.0)
z_axis_a = base_ebone.matrix.copy().rotation_part() * Vector((0.0, 0.0, -1.0))
z_axis_b = parent_ebone.matrix.copy().rotation_part() * Vector((0.0, 0.0, -1.0))
offset = (z_axis_a + z_axis_b).normalize() * distance
else:
# preset axis
offset = Vector(0, 0, 0)
offset = Vector((0.0, 0.0, 0.0))
if mode[0] == "+":
val = distance
else: