How to find the text animator with the earliest keyframe?
So here's my code so far:
var animRot=lays[0].text.animator(i)("Properties").rotation.numKeys;
var animRotKey=lays[0].text.animator(i)("Properties").rotation;
var rotTimeCheck = [];
var earlyRot = 0;
if (animRot>0)
{
for(var x=1; x<animRot; x++)
{
if (x==1){rotTimeCheck
= animRotKey.keyTime(x); earlyRot=rotTimeCheck ;} else
{
rotTimeCheck
=animRotKey.keyTime(x); if (rotTimeCheck[x-1]<rotTimeCheck
) {earlyRot = rotTimeCheck[x-1];}
else
{earlyRot = rotTimeCheck
;} }
}
}
var earlyKey = [];
var earliestKey = 0;
var earliestAnim = undefined;
earlyKey = Math.max(earlyOpa,earlyPos,earlySca,earlyRot);
if (i==1)
{earliestAnim = lays[0].text.animator(i);}
else
{
if (earlyKey<earlyKey[i-1])
{earliestAnim = lays[0].text.animator(i);}
}
earliestAnim.name = "dontdeleteplz";
So to spare you a huge chunk of code imagine that there is three more pieces (for opacity, position, and scale,)
and this code always returns earliestAnim as the first animator on my layer. I'm pretty sure I just have some sort of syntax error but I can't seem to figure out what it is.
