[Maya] - Expressions help

Simple expression logic is not followed as expected…

Expressions are double printing in the console…

I made a video to show the issue… All of this SHOULD be very straight forward and I’m very curious as to what is causing all of this. I have ZERO clue why the crank would be going in reverse in the video example at 4 minutes in.

Attached is an example file of this issue… This issue is also true in 2016 SP5 of Maya which leads me to believe this is due to user error… That or it’s a deep bug that’s been around for a while.

Youtube video - https://youtu.be/UgtFhm3h-eY

Example File DL - http://ge.tt/6SIqLCi2

Please give me some input if you have it! Many thanks.

I’ve simplified the expression to show the problem more clearly, but still getting the same bunk results.

DL Link to simplified scene -http://ge.tt/7rp7PCi2

Youtube video of simplified scene - https://youtu.be/x8rEVdz452g

Once again, thank you for any help.

Turns out the accumulation of the rotational value wasn’t being compounded. That was my issue and that is what caused the rotational value to reverse. A nice chap over at the Area gave me a hand with the solution-

if (frame == 1)
rot_grp.rotateZ = 0;
else
{
rot_grp.rotateZ = rot_grp.rotateZ + (10 * getAttr rot_grp.rotMult * (frame/24));
}