diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2022-05-04 22:33:48 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2022-05-04 22:34:46 +0300 |
commit | 4efc7da9da28ea8c1c1c1c62e9d1f20336f5ec08 (patch) | |
tree | ba5c410d41f9bd1a3b3b2170f399350c67d57b6f | |
parent | 015248ed8d989a6d17c1969035ad0011285cd24c (diff) |
Fix T96748: split IK toe control does not respect stretch limit.
Split the parent mch bone and its rigging together with the control.
-rw-r--r-- | rigify/rigs/limbs/leg.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/rigify/rigs/limbs/leg.py b/rigify/rigs/limbs/leg.py index 05c606ef..77433101 100644 --- a/rigify/rigs/limbs/leg.py +++ b/rigify/rigs/limbs/leg.py @@ -98,9 +98,13 @@ class Rig(BaseLimbRig): # Toe spin control. # heel: # Foot roll control + # ik_toe: + # If enabled, toe control for IK chain. # mch: # heel[]: # Chain of bones implementing foot roll. + # ik_toe_parent: + # If using split IK toe, parent of the IK toe control. # #################################################### @@ -208,21 +212,35 @@ class Rig(BaseLimbRig): @stage.generate_bones def make_ik_toe_control(self): if self.use_ik_toe: - self.bones.ctrl.ik_toe = self.make_ik_toe_control_bone(self.bones.org.main[3]) + toe = self.bones.org.main[3] + self.bones.ctrl.ik_toe = self.make_ik_toe_control_bone(toe) + self.bones.mch.ik_toe_parent = self.make_ik_toe_parent_mch_bone(toe) def make_ik_toe_control_bone(self, org): return self.copy_bone(org, make_derived_name(org, 'ctrl', '_ik')) + def make_ik_toe_parent_mch_bone(self, org): + return self.copy_bone(org, make_derived_name(org, 'mch', '_ik_parent'), scale=1/3) + @stage.parent_bones def parent_ik_toe_control(self): if self.use_ik_toe: - self.set_bone_parent(self.bones.ctrl.ik_toe, self.get_mch_heel_toe_output()) + mch = self.bones.mch + align_bone_orientation(self.obj, mch.ik_toe_parent, self.get_mch_heel_toe_output()) + + self.set_bone_parent(mch.ik_toe_parent, mch.ik_target, use_connect=True) + self.set_bone_parent(self.bones.ctrl.ik_toe, mch.ik_toe_parent) @stage.configure_bones def configure_ik_toe_control(self): if self.use_ik_toe: self.copy_bone_properties(self.bones.org.main[3], self.bones.ctrl.ik_toe, props=False) + @stage.rig_bones + def rig_ik_toe_control(self): + if self.use_ik_toe: + self.make_constraint(self.bones.mch.ik_toe_parent, 'COPY_TRANSFORMS', self.get_mch_heel_toe_output()) + @stage.generate_widgets def make_ik_toe_control_widget(self): if self.use_ik_toe: |