diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2022-02-11 23:27:26 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2022-02-11 23:40:22 +0300 |
commit | 7120e9c9e08720c20833a334fee197ed9a11dc64 (patch) | |
tree | 1900e8544142f3ac4bcc91059fb94a8fae9eb840 /rigify/rigs/limbs/super_finger.py | |
parent | 01c94f43a6ddc174c3f90aa9fa9c247ea79b4b76 (diff) |
Rigify: allow aligning IK control location channels to world space.
For IK controls that move freely in space without being tied to
a parent it makes sense to align the location channels to world
(or root), while keeping rotation channels aligned to the limb
end orientation.
Blender already has a Local Location parenting option for this
very use case, but Rigify wasn't using it. This adjusts the
switchable parent mechanism so that the option works as intended,
and provides a Rigify option that controls its value for IK controls.
Note that now it is possible to enable the Local Location option
directly on the control bones after generation and it will work
correctly - it is not required to enable IK Local Location.
Diffstat (limited to 'rigify/rigs/limbs/super_finger.py')
-rw-r--r-- | rigify/rigs/limbs/super_finger.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rigify/rigs/limbs/super_finger.py b/rigify/rigs/limbs/super_finger.py index 9eed5415..2229c0c0 100644 --- a/rigify/rigs/limbs/super_finger.py +++ b/rigify/rigs/limbs/super_finger.py @@ -152,6 +152,12 @@ class Rig(SimpleChainRig): no_fix_rotation=True, no_fix_scale=True, ) + @stage.parent_bones + def parent_ik_control(self): + if self.make_ik: + bone = self.get_bone(self.bones.ctrl.ik) + bone.use_local_location = self.params.ik_local_location + @stage.configure_bones def configure_ik_control(self): if self.make_ik: @@ -366,6 +372,12 @@ class Rig(SimpleChainRig): description = "Create an optional IK control" ) + params.ik_local_location = bpy.props.BoolProperty( + name = 'IK Local Location', + default = True, + description = "Specifies the value of the Local Location option for IK controls, which decides if the location channels are aligned to the local control orientation or world", + ) + ControlLayersOption.TWEAK.add_parameters(params) ControlLayersOption.EXTRA_IK.add_parameters(params) @@ -380,6 +392,9 @@ class Rig(SimpleChainRig): layout.prop(params, 'bbones') layout.prop(params, 'make_extra_ik_control', text='IK Control') + if params.make_extra_ik_control: + layout.prop(params, 'ik_local_location') + ControlLayersOption.TWEAK.parameters_ui(layout, params) if params.make_extra_ik_control: |