Skip to content

Commit

Permalink
Set IK stretch to 0.0 for hands and feet
Browse files Browse the repository at this point in the history
Perhaps just a personal preference but i tired of setting the hands and feet to 0.0 IK stretch every time in order to prevent my body parts from deforming and stretching in their animations. When working with standard skeletons i want to work within the bounds of their joints, and so i've set the new default to 0.0
  • Loading branch information
catprisbrey committed Mar 19, 2024
1 parent 2a5d1b3 commit 359fece
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def check_and_remove(bone_name) :
if bone_name in ob.data.edit_bones :
ob.data.edit_bones.remove(ob.data.edit_bones[bone_name])


class GodotMecanim_Panel(bpy.types.Panel):
bl_label = "Rigify to Godot converter"
bl_space_type = "PROPERTIES"
Expand All @@ -58,6 +59,7 @@ class GodotMecanim_Convert2Godot(bpy.types.Operator):
def execute(self, context):
ob = bpy.context.object


bpy.ops.object.mode_set(mode='OBJECT')

if 'DEF-breast.L' in ob.data.bones :
Expand Down Expand Up @@ -206,7 +208,15 @@ def execute(self, context):
#for edit_bone in ob.data.edit_bones:
# if edit_bone.name.startswith("DEF-"):
# edit_bone.name = edit_bone.name[len("DEF-"):]


bpy.ops.object.posemode_toggle()
# Set IK_Stretch property to 0 for specified bones
armature = bpy.context.object
armature.pose.bones["upper_arm_parent.L"]["IK_Stretch"] = 0.0
armature.pose.bones["upper_arm_parent.R"]["IK_Stretch"] = 0.0
armature.pose.bones["thigh_parent.L"]["IK_Stretch"] = 0.0
armature.pose.bones["thigh_parent.R"]["IK_Stretch"] = 0.0

bpy.ops.object.mode_set(mode='OBJECT')
self.report({'INFO'}, 'Godot ready rig!')

Expand All @@ -217,7 +227,6 @@ def execute(self, context):
# ob.display_type = 'WIRE'



return{'FINISHED'}

def register():
Expand Down

0 comments on commit 359fece

Please sign in to comment.