Page MenuHome

Rigify: Implement T78463: better support unguligrade animals (horse) setup
ClosedPublic

Authored by Alexander Gavrilov (angavrilov) on Aug 7 2020, 5:15 PM.

Details

Summary

This patch implements the procedural generation of the rig provided by @Ivan Cappiello (icappiello) in T78463#972176, as designed for horses and other unguligrade animals. It also adds a rig sample and updated horse metarig, and a new option to super_limbs rig called Rear Paw.

To test the patch, add the Horse metarig or the rear_paw rig sample to an empty armature and hit Generate.

Diff Detail

Event Timeline

The created rig seems to miss some copy rotation constraint that should be set on foot_heel.ik:

Copy Rot 1
sub target: foot_heel_ik.L
Order: Default
use_X, use_Y, use_Z
invert.X
mix_mode: Before Original
target space: Local Space
owner space: Local Space

Copy Rot 2
sub target: foot_ik.L
Orger: Default
use_X, use_Y, use_Z
invert.X
mix_mode: Add
target space: Local Space
owner space: Local Space

This should retain a reverse rotation from foot control.
Except for this issue the sample is generating correctly

This breaks backwards compatibility with previous uses of the rear_paw rig type. This is because the old rear_paw was just substituting in the regular paw, which requires a chain of 4 bones. This new implementation demands a chain of 5 bones. Fixing this backwards compatibility might be possible with some kind of versioning? All that would need to be done is switch any existing uses of the rear_paw rig type to the regular paw rig type. I have no experience with versioning code so I'm not sure if this is possible or a good idea.

About backward compatibility, in current rigify there's no option in "super_limb" for "rear_paw", it just runs te paw code, so older rigs should just run the code with old 4-boned metarigs and regular paw code. The rear paw sample was created for consistency and as a placeholder for possible new sample (which is the case we are working on).

The ideal case is just the ui showing a new "rear_paw" subtype under "super_limb" subtypes list. I'll provide updated metarigs corresponding to new 5-bones setup to be included along as the patch.

Add missing constraint. I hope I understood correctly.

rigify/rigs/limbs/rear_paw.py
93

it's probably better to invert all rotations coming from heel to avoid some rotational issues created by possibly incorrect rotations

96
96

after some testing i believe we should tweak this to avoid undesired double transforms

Updated constraints

  • update metarig and sample

Should be all done I think.

if @Alexander Gavrilov (angavrilov) has no objection on code side, i'd accept the patch

Demeter Dzadik (Mets) edited the summary of this revision. (Show Details)Aug 24 2020, 5:32 PM

more consistent bone shape for 3rd FK bone

Alexander Gavrilov (angavrilov) requested changes to this revision.Aug 25 2020, 12:30 PM
Alexander Gavrilov (angavrilov) added inline comments.
rigify/rigs/limbs/rear_paw.py
76

You don't need to mess with super() unless you actually want to replace what the method does, just define new callbacks. That's what the decorator system is for in the first place.

93

Creating constraints should be done in the rig_bones stage, not configure_bones.

rigify/rigs/limbs/super_limb.py
43 ↗(On Diff #28126)

Don't bother extending super_limb, it's obsolete and deprecated.

This revision now requires changes to proceed.Aug 25 2020, 12:30 PM
  • Don't use super() in stage functions
  • Move constraint creation to appropriate stage
  • No longer touch super_limb
  • Add cat metarig that uses the new rear_paw, courtesy of @Ivan Cappiello (icappiello)
Demeter Dzadik (Mets) marked 3 inline comments as done.Aug 25 2020, 8:15 PM
Alexander Gavrilov (angavrilov) requested changes to this revision.Sep 13 2020, 2:01 PM

Is the IK/FK snap/switch and the FK system really working ideally here?

rigify/rigs/limbs/rear_paw.py
49

I wonder if it's possible to introduce a helper method here in paw rig that receives the two org bone names as parameters, to avoid this huge chunk of copy & paste.

96

This constraint does nothing when the custom pivot control is enabled, so this approach is not correct. What is it even trying to achieve?

127

This is messy - at least check that i == 3, and a more clean way is to also introduce parent_toe_socket_bone and parent_digit_socket_bone here and in the basic paw rig (admittedly I was lazy here too when implementing the paw rig).

192–193

This enum value doesn't exist, and this assignment has to be removed.

This revision now requires changes to proceed.Sep 13 2020, 2:01 PM
Demeter Dzadik (Mets) updated this revision to Diff 29144.EditedSep 21 2020, 7:37 PM
Demeter Dzadik (Mets) marked 4 inline comments as done.
  • addressed in-line comments and removed cat metarig since Ivan at some point said it wasn't meant for inclusion in this patch.

Is the IK/FK snap/switch and the FK system really working ideally here?

You're right, it seems snapping IK to FK fails pretty badly here... and if I think about it, getting it to not fail so badly won't be trivial even for someone who might know the codebase, since the rotation of the heel controls would have to be figured out somehow...

To be fair, it fails even on the old paw rig a little bit, when the heel control is used. So maybe this is something for a separate patch?

rigify/rigs/limbs/rear_paw.py
96

I made the wrong assumption that get_ik_control_output() always returns the ik_control, what I was looking for is simply self.bones.ctrl.ik here.

As for purpose, might be a better question for @Ivan Cappiello (icappiello), but from what I can tell it's there so that when the IK control is rotated, the upper heel counter-rotates.

Implemented multi-layer IK drive for the heel control based on a video by @Pierrick PICAUT (Pieriko).

  • Code reshuffle.
  • Enhanced secondary IK to avoid double scaling.
  • Improved IK to FK snap precision for rear_paw.
  • Added rear_paw to wolf.
  • Applied wolf & horse spine updates by @Ivan Cappiello (icappiello).

Moved 5 bone support to the base limbs.paw class and added limbs.front_paw.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 24 2020, 4:01 PM
This revision was automatically updated to reflect the committed changes.