From 240b164a87517ad616ff500cbf16ba901e2ea461 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 27 Aug 2010 00:05:00 +0000 Subject: fix some errors in rigify caused by recent api changes --- release/scripts/modules/rigify/neck_flex.py | 4 ++-- release/scripts/modules/rigify/palm_curl.py | 2 +- release/scripts/modules/rigify/spine_pivot_flex.py | 4 ++-- release/scripts/modules/rigify/tongue.py | 4 ++-- release/scripts/modules/rigify_utils.py | 2 +- release/scripts/ui/properties_data_bone.py | 20 +++++++++++--------- 6 files changed, 19 insertions(+), 17 deletions(-) (limited to 'release/scripts') diff --git a/release/scripts/modules/rigify/neck_flex.py b/release/scripts/modules/rigify/neck_flex.py index 1ab14e281b9..7daf3d3bb4b 100644 --- a/release/scripts/modules/rigify/neck_flex.py +++ b/release/scripts/modules/rigify/neck_flex.py @@ -262,7 +262,7 @@ def main(obj, bone_definition, base_names, options): fcurve = ex.head_ctrl_p.driver_add('["bend_tot"]') driver = fcurve.driver driver.type = 'SUM' - fcurve.modifiers.remove(0) # grr dont need a modifier + fcurve.modifiers.remove(fcurve.modifiers[0]) # grr dont need a modifier for i in range(len(neck_chain)): var = driver.variables.new() @@ -301,7 +301,7 @@ def main(obj, bone_definition, base_names, options): driver.type = 'SCRIPTED' driver.expression = "bend/bend_tot" - fcurve.modifiers.remove(0) # grr dont need a modifier + fcurve.modifiers.remove(fcurve.modifiers[0]) # grr dont need a modifier # add target diff --git a/release/scripts/modules/rigify/palm_curl.py b/release/scripts/modules/rigify/palm_curl.py index 369d6928e45..c063e2b31c9 100644 --- a/release/scripts/modules/rigify/palm_curl.py +++ b/release/scripts/modules/rigify/palm_curl.py @@ -194,7 +194,7 @@ def main(obj, bone_definition, base_names, options): driver.expression = "(1.0-cos(x))-s" for fcurve in driver_fcurves: - fcurve.modifiers.remove(0) # grr dont need a modifier + fcurve.modifiers.remove(fcurve.modifiers[0]) # grr dont need a modifier var = driver.variables.new() var.name = "x" diff --git a/release/scripts/modules/rigify/spine_pivot_flex.py b/release/scripts/modules/rigify/spine_pivot_flex.py index 645ee4045cc..7782380eedb 100644 --- a/release/scripts/modules/rigify/spine_pivot_flex.py +++ b/release/scripts/modules/rigify/spine_pivot_flex.py @@ -353,7 +353,7 @@ def main(obj, bone_definition, base_names, options): fcurve = ex.ribcage_copy_p.driver_add('["bend_tot"]') driver = fcurve.driver driver.type = 'SUM' - fcurve.modifiers.remove(0) # grr dont need a modifier + fcurve.modifiers.remove(fcurve.modifiers[0]) # grr dont need a modifier for i in range(spine_chain_len - 1): var = driver.variables.new() @@ -390,7 +390,7 @@ def main(obj, bone_definition, base_names, options): driver.type = 'SCRIPTED' driver.expression = "bend/bend_tot" - fcurve.modifiers.remove(0) # grr dont need a modifier + fcurve.modifiers.remove(fcurve.modifiers[0]) # grr dont need a modifier # add target diff --git a/release/scripts/modules/rigify/tongue.py b/release/scripts/modules/rigify/tongue.py index fd32f3d0556..36c4316adc5 100644 --- a/release/scripts/modules/rigify/tongue.py +++ b/release/scripts/modules/rigify/tongue.py @@ -266,7 +266,7 @@ def main(obj, bone_definition, base_names, options): fcurve = ex.head_ctrl_p.driver_add('["bend_tot"]') driver = fcurve.driver driver.type = 'SUM' - fcurve.modifiers.remove(0) # grr dont need a modifier + fcurve.modifiers.remove(fcurve.modifiers[0]) # grr dont need a modifier for i in range(len(neck_chain)): var = driver.variables.new() @@ -313,7 +313,7 @@ def main(obj, bone_definition, base_names, options): driver.type = 'SCRIPTED' driver.expression = "bend/bend_tot" - fcurve.modifiers.remove(0) # grr dont need a modifier + fcurve.modifiers.remove(fcurve.modifiers[0]) # grr dont need a modifier # add target diff --git a/release/scripts/modules/rigify_utils.py b/release/scripts/modules/rigify_utils.py index a270af949da..1ffe366e0d5 100644 --- a/release/scripts/modules/rigify_utils.py +++ b/release/scripts/modules/rigify_utils.py @@ -157,7 +157,7 @@ def blend_bone_list(obj, apply_bones, from_bones, to_bones, target_bone=None, ta fcurve = con.driver_add("influence") driver = fcurve.driver driver.type = 'AVERAGE' - fcurve.modifiers.remove(0) # grr dont need a modifier + fcurve.modifiers.remove(fcurve.modifiers[0]) # grr dont need a modifier blend_target(driver) diff --git a/release/scripts/ui/properties_data_bone.py b/release/scripts/ui/properties_data_bone.py index 4df6177c1fc..ee1c33daee7 100644 --- a/release/scripts/ui/properties_data_bone.py +++ b/release/scripts/ui/properties_data_bone.py @@ -224,7 +224,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel): row.prop(ob.pose, "ik_solver") split = layout.split(percentage=0.25) - split.prop(pchan, "lock_ik_x", text="Lock X") + split.prop(pchan, "lock_ik_x", icon='LOCKED' if pchan.lock_ik_x else 'UNLOCKED', text="X") split.active = pchan.is_in_ik_chain row = split.row() row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True) @@ -241,8 +241,8 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel): sub.active = pchan.lock_ik_x == False and pchan.use_ik_limit_x and pchan.is_in_ik_chain split = layout.split(percentage=0.25) - split.prop(pchan, "lock_ik_y", text="Y") - split.active = pchan.is_in_ik_chain and pchan.is_in_ik_chain + split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y") + split.active = pchan.is_in_ik_chain row = split.row() row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True) row.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain @@ -259,8 +259,8 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel): sub.active = pchan.lock_ik_y == False and pchan.use_ik_limit_y and pchan.is_in_ik_chain split = layout.split(percentage=0.25) - split.prop(pchan, "lock_ik_z", text="Z") - split.active = pchan.is_in_ik_chain and pchan.is_in_ik_chain + split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z") + split.active = pchan.is_in_ik_chain sub = split.row() sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True) sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain @@ -274,10 +274,12 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel): sub.prop(pchan, "ik_min_z", text="") sub.prop(pchan, "ik_max_z", text="") sub.active = pchan.lock_ik_z == False and pchan.use_ik_limit_z and pchan.is_in_ik_chain - split = layout.split() - split.prop(pchan, "ik_stretch", text="Stretch", slider=True) - split.label() - split.active = pchan.is_in_ik_chain + + split = layout.split(percentage=0.25) + split.label(text="Stretch:") + sub = split.row() + sub.prop(pchan, "ik_stretch", text="", slider=True) + sub.active = pchan.is_in_ik_chain if ob.pose.ik_solver == 'ITASC': split = layout.split() -- cgit v1.2.3