Motion Path flipping

Hello, I don’t know if someone has been on the same situation. I want to drive transforms driven by a curve using a motionPath.

I’m using this setup:
Screenshot_1

The thing is when the points on the curved are moved, the object flips in the secondary axis which in this case is “Z”. As far as I know the motion path rotation system works the same as an aim constraint.

flip

Also, I tried the ikHandle singleChainSolver, using the position of the motionPath to control the startJoint and using the tangent to control the ikHandle and the problem doesn’t happen

ikHandle

I could use the ikHandle method, but there are too many dag Nodes per transform

Hey @Steffano ,

It’s true the the motion path orientation parameters are effectively defining an aim constraint. You’re running into this when the vector of the up direction matches the direction of the aim direction. The same thing would happen with an aim constraint. You can see it when the direction of Y on the upObj matches the tangent direction of the curve itself. They are both pointing in the same direction and since the aim direction is primary, the secondary direction gets confused as to which direction, relative forward or backwards, is “correct.” Unless you’re comfortable with linear algebra a bit, the reason for this isn’t obvious.

In order to try and minimize this, you’ll need to establish a relationship where the possibility of the above isn’t there or tricky to achieve. That may wind up just being a limitation on the animator to not pull control points in such a way that the curve overlaps itself. The other option is try to inform that secondary direction a bit more somehow. If it’s possible to orient the upObj to follow the controller you have (aim the Y axis or something towards the controller and then make sure that relationship doesn’t flip) , maybe it can stabilize the vectors. A 100% bullet-proof no-flip system I’ve yet to see because of the math involved, but there’s sometimes a chance for cleverness.

Thanks for replying A_Weider

Yes indeed, both axis in some point matches so maya doesn’t know where to point out. I was used to use ribbons to achieve that, but ribbons has the same problem. I think is by its own nature of a skinned nurbs surface. Besides sometimes a rig part doesn’t need the primary axis when it is animated. I could use ikSpline, but require a joint chains and a dag node, apart from that when it’s stretched tends to be unstable.

I have tested several methods to achieve that. I got a method, using and angleBetwen an pointOnCurveInfo. In vector1 of angleBetween I put 0,0,1. It’s working, but still missing the worldObjUp. I added some quat nodes to operate the worldObjUp. I think I will need to extract the twist from worldObjUp

I’ve spent a lot of time on this, and ended up writing my own plugin.
The best answer I found was to calculate something called a Rotation Minimizing Frame for the spline, and use that as the reference frame for interpolating any rotation keys applied along the path. It’s about as close to 100% no-flip as you can get, I think. (Cusps still cause flips)

Here’s a REALLY useful writeup on the math and coding behind RMF’s (Really, the whole page is just pure gold)

My plugin is open source … but it’s an extra plugin you’d be relying on, and I know that can be a deal breaker sometimes.

1 Like

Hi @tfox_TD, I’ll take a look. Thanks