Hi all, I am primarily looking how to efficiently (game performance wise) limit the bone rotations. My goal is to use this for mainly retargeting purposes as well as procedural purposes. For Procedural purposes, I may want the hand to be attached to a part of a gun, but also prevent the wrist and other parts from rotating weirdly during the procedural process. For retargeting, if the character is a lot thicker than the character I originally created or got the animations from; then I would want bone limits on the arm for example, so that the arm can not be rotated in as much as to avoid clipping into the body, since a thicker person may not be able to bring their arms as close to their sides as a thinner person for example.
Here are my current findings.
-
When creating a Control Rig, after creating a control for the head for example, then selecting the control, you can set the min and max in the details panel. The issue with this method is it only works if everything else stays in the same position and rotation. So if you rotate the spine to be parallel with the floor, the head rotation default position will not be the same, so a min/max of 10 will give a different/abnormal result.
-
My second idea was to do what is attached in the control rig photo below. This works great for the head when I set the min/max to -10 and 10. Even if I rotate the spine to be parallel with the ground in all different direction. The issue then comes when for example i try to set a rotation limit on the clavical_l of -10 and 10. It will then be crazily positioned. I am guessing this is because it’s initial rotation is not all zeroed out. I was thinking maybe I could get the initial transform value using the construction script to initially set the values of all the bones or something, to then +10 and -10 from that value on the clamps. If that could work, the issue with that is I do not see a way to get the initial starting value.
- I also thought of using the method in the Content Example project, by creating an IK Rig, adding full body IK bone settings to each bone, and applying limits in each setting. The issue with that seems like it would be costly GPU/CPU wise with many characters. To get limits to work, you need to set goals and then in the AnimBP, expose those goals pins to control them manually in the AnimBP. My thought is that I would have to use the event graph to manually set the goal location to the hand location each frame or something like that to be able to activate the other bone limits (and do the same for the feet).
Is there a better, but game performant way to limit the bone rotations?