Animation without hiearchies / bi-directional motion transfer?

I’m still just learning about animation rigging via unity, but here’s one thing that would seem very useful to me, and I’m wondering whether there is some sort of way to access it/use it.

Many times, I’m working with an imported animation, and I’d “just” like to do a small modification on some bone - for example, lower the hips a bit, to make it a bit more “crouch” like walking animation, etc.

Obviously this is problematic, since moving the hips down will cause everything to move down. If it’s some other bone that is a leaf in the hiearchy, everything works fine, but if not, it seems problematic.

It would be great if I could do this procedurally - say an animation is running, and I decide that I due to some impact, I’d like to lower the hips down and back a little bit, without modifying the foot position - the feet will be at the same positions, if the normal animation kept on running.

1, One option that occurs to me, is to just add a constraint for each child object, and make the constraint use the actual animation position at the given time. This seems like a ton of work, and I’m also not even sure if it’s possible to create a constraint that changes the position of some bone, based on the animation position of this bone. There’s probably hacky solutions like having a complete duplicate of the character that does the animations, and you use an override constraint to set the position of the bones, based from this duplicate.

It would be cool if there was some default solution to this - something that let’s you set the positions of all bones to respect the positions in the animation, but all done via constraints, so that when you lower the hips, only the hips move lower.

2, Bi-directional motion transfer might be what I’m looking for? Technically I’m just talking about one direction here (from FK/animations to IK rig, right?). So essentially this would create an IK/constraint based rig, and convert all the animations into this, is that right? With a constraint based rig and the animations actually using it, changing the hip position lower should just result in a crouch-style walk, is that right?

Correct, Bi-directional motion transfer can help you with this. There are no fullbody IK constraints, but your example with hips / feet is completely valid. You can setup TwoBoneIK constraints on both legs. Transfer the FK animation from the legs to the TwoBoneIK constraints. When you now play the animation the curves on the effectors together with the constraints create the motion. (At this point you could delete the FK curves for the legs). After this you could move the hips with another constraint, thereby creating tweaks in the motion.

Thank you, I’ve tried it out and it works great.

One unrelated question - I’m not experienced in profiling etc, but would just using multiple characters (~10-20) like this with real-time two bone IKs for both feet seem feasible? No DOTS. Exactly how costly is using IK like, just for two feet, at real time, not just for authoring? Given that using “foot IK” for foot placement/avoiding gliding feet seems pretty standard these days, and that this is basically the same thing, I’d assume it’s nothing to worry about?

I mean I tested it out with 20 characters, and it didn’t seem to make a difference whether I used a rig with two constraints for the feet that were both animated (the targets + hints), and 20 characters that were just using normal animations of a generic avatar.

Using a fullbody IK rig at run time might be problematic I guess, but a few constraints, on ~20 characters shouldn’t be an issue right? I’m just wondering about this, because while I could author various animations for various things (melee attacks, holding weapons etc) and use FK as much as possible, it might be a waste of effort.

Lastly, suppose I use the transfer and work with IK constraints for the feet, and so I’m basically just using a standard animation clip for the movement for most things, except that I’m also animating the target + hint position for the legs. What would be a good approach to getting foot IK in the sense of them touching the ground? Would this be problematic? I guess technically I could just add another IK rig that would be applied after the first one hah, but that might be a bit too wasteful, using a total of 4 two bone ik constraints… it would make the situation pretty much the same as when using normal FK though, and standard solutions could be used.

For efficiency, I guess it would maybe be better to somehow override the target/hint position of the foot position - cast a ray at certain/whatever, and set ignore the animation clip position.