Sorry for the bump. I read this thread and the expression worked for me =D
However, when I tried to add more frames I ran into a problem.
I’m trying to switch between 5 frames of a cartoon nose for a character rig I’m working on. Two 90 degree angles (frame 0 and 4), two 45 degree angles (frame 1 and 3), and one center drawing (frame 2).
When I move the layer they’re linked to “Eye_Marker” the nose layer cycles through all the frames, except the last one, frame 4.
I’ve gone over it, and I’m completely stumped. Is there a limit to how many times you can use “else if”?
x = comp("H.M. Character Rig").layer("Eye_Marker (CONTROL)").transform.position[0];
if (x < -200) f = 0;
else if (x < -80) f = 1;
else if (x > 170) f = 3;
else if (x > 250) f = 4;
else f = 2;
framesToTime(f);