manually sync rigify with render branch
authorCampbell Barton <ideasman42@gmail.com>
Mon, 3 May 2010 19:12:11 +0000 (19:12 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 3 May 2010 19:12:11 +0000 (19:12 +0000)
fixes [#22231] Rigify Script Error When Generate From Human(Meta-Rig)

17 files changed:
release/scripts/modules/rigify/arm_biped.py
release/scripts/modules/rigify/eye_balls.py
release/scripts/modules/rigify/eye_lid.py
release/scripts/modules/rigify/finger_curl.py
release/scripts/modules/rigify/leg_biped.py
release/scripts/modules/rigify/leg_quadruped.py
release/scripts/modules/rigify/mouth.py
release/scripts/modules/rigify/neck.py
release/scripts/modules/rigify/neck_flex.py
release/scripts/modules/rigify/palm_curl.py
release/scripts/modules/rigify/shape_key_control.py
release/scripts/modules/rigify/shape_key_distance.py
release/scripts/modules/rigify/shape_key_rotdiff.py
release/scripts/modules/rigify/spine_pivot_flex.py
release/scripts/modules/rigify/tail_control.py
release/scripts/modules/rigify/tongue.py
release/scripts/modules/rigify_utils.py

index b75b26b5f2f79f02ac6d88ed0b3e8c2869bf4d6c..7a99eb5d80ac0c0a9d8c174ee7d3d5b2097e102d 100644 (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
 
 
index 20bb08f39a89d91e654ac86dce6f34cd5a14aa6b..48f0448dfb39fc1faf2b7005a5f7d77aaa953c33 100644 (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]
index 30492e4e138cdc1aefbcd1c1eb769484b2c078d2..bb9749011c20d030eb4257955b11d53d13a311cc 100644 (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()
index 27ed437b5ac0fd39c727fd64c1548018b23c4607..63f1816012bbae8e86afb7b6fe307c0c86915e58 100644 (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'
index 2ea217847d7a35200f78b83184800989d7a54684..53028986873c803cee21a0f8f4013a4f5ae56b7f 100644 (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'
index 3ee9065af6136fd80dfbfc826b56ce7356c37c8b..688387bbd53b5bf8aac2da7630513e07d1c70055 100644 (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'
index 9d36c60eede362c6fcabfbfd28885238ecccbc1a..d516a48ec95012e0b29d1dfc5a8eff15271eb87d 100644 (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()
index 7d220663256a5f9bf76b6c91dc11f20423ea0d52..0d2ab25bcc96f833ecb79ffc4e92df62f260e7f1 100644 (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"
index 514d443a1f92e5fa48cce2ac83c91fb2e668fdd3..08f963434d1d2156d5987257cd9abdc8c8e7fd4d 100644 (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"
index ed656cf224341cad5d30301a96457ce8a2592005..2bdd28a348a0e396fc32c45e3f69d416927f1b3c 100644 (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
 
index fd0e900a7b5208b7c7fbe5f286a7509aa4d8584f..ac3987ca7e14565f2a3a6eecce21d95b9ed202eb 100644 (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
 
index 68501ac829b10a75a229172b6e9cda7f13aa79d8..06dd3d67d4b1c7434d1c01ee69ba9e376f88a5d0 100644 (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
index 2c30d95e666f45438c4e4c09d69c42b375aef861..7049bcf74bb03f4b682da8f514abbeb61fa151ed 100644 (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
index 025074490cb3cf9f77912bf08f3fe4509bad137d..d3bab72d9a1b875de0e5c41c46e729b8f6b30296 100644 (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'
index 76eaf6dd4d9b1f24084d3da21e37a81297720215..47da977891392e53733d55f80a0c03a5a2da265b 100644 (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()
index 43a8c2125ce61545e8b109c61c2c42f92e8b75df..b6dfe756b71292aae1ffe8cd00e490bb466c1e55 100644 (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"
index 1d5768e7f22bc219eed7cfdc4bd71db4f13dfc5c..25ab6bebf48da5644bfe0cdf4616bd66727a4718 100644 (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: