I have seen people and previously me myself using twist joint setup (usually while rigging forearm twist) using the good old rotational weighted constraints or direct rotational connection with offset values to give even twisting. It works great for straight aligned joint rotated or twisted in just single direction for example rotate X, but once you start rotating in all direction which we all tend to, some thing weird happens, something not so good that is known as flipping. This flipping behavior is the result of GIMBAL LOCK! Well then, that is a major issue.
Basically, the flipping can be avoided if we stay out of rotational constraints or connections. I am going to show two methods on how this can be achieved.
1st Method (Aim Constraint with Up Vector) : The first method deals with setting up a joint twist using the power of aim constraint. The twisting of each joint is controlled by World Up Objects, which are basically locators re-positioned on top of each joint. Once the locators are moved, the joint twist evenly without any flipping. Check out the images below for detail!
2nd Method (Spline IK with Up Vector) : The second method is pretty straight forward. Create a regular spline IK on a given joint chain. From the advance twist option, make sure that World Up Type is object Up (Start/End). Just like the aim constraint, the up locators are used to setup the advance twist for the entire joint chain. Again, check out the images below for detail!
Therefore, both of the method shown above can be applied for creating a non – flipping GIMBAL LOCK friendly twist setup which can be applied for regular forearm twist or whatever. Spline IK Advance Twist doesn’t seem to work very well with mirrored joint, in such case just re-root the mirrored joint chain so that the end joint becomes the parent (Maya Bug). I hope this post could be useful to you, let me know if you have any concerns. Cheers ๐
P.S. here is another cool alternative for no flipping twist by Cedric Bazillou. He used a custom Quaternion based Aim Constraint node to achieve the result. More info can be gathered from his blog!