Hi Dan,
Thank you once again! The code works when it’s used outright, but I I’m having trouble implementing it into the script that I’m working on.
Without the no keyframe script, it reads the following:
Y=thisComp.layer(“Y2 – L”).transform.yPosition; //position of the animated layer (2 keyframes, key1=720 & key2=320)
N=Y.numKeys;
K = value+(Y-Y.valueAtTime(0))/2;
var YY=Y.key(N).value;
if(YY<360){[K];} else {value;}
when I add the condition that there may be no keyframes, the script above fails to function. However, I am able to delete the keyframes without receiving any errors; so the first bit is working. I just don’t know how to write: if (keyframes don’t exist AND any value smaller than 360) then do {K}.
Y=thisComp.layer(“Y2 – L”).transform.yPosition;
N=Y.numKeys;
K = value+(Y-Y.valueAtTime(0))/2);
if(N > 1&YY<360) {var YY=Y.key(N).value;[K];} else {value;}
Any ideas how to get the two conditions to work together? Thanks!