Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesTrainingCreative Cloud DebateFAQ

Re: radnom timeline marker

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Share on Facebook
Respond to this post   •   Return to posts index   •   Read entire thread


Dan EbbertsRe: radnom timeline marker
by on Oct 22, 2009 at 6:53:57 pm

OK - this is a fun one. Once you have all your layers sequenced, precompose them. Enable time remapping for the new pre-comp layer (don't change its name), and apply this time remapping expression:

myComp = comp(name);
n = myComp.numLayers;
seedRandom(index+101,true);
theLayers = [];
for (i = 1; i <= n; i++) theLayers[theLayers.length] = i;

for (i = 0; i < theLayers.length; i++){
idx = i + Math.floor(random(theLayers.length - i));
temp = theLayers[i];
theLayers[i] = theLayers[idx];
theLayers[idx] = temp;
}


accumDur = 0;
for (i = 0; i < n; i++){
myLayer = myComp.layer(theLayers[i]);
nextDur = myLayer.outPoint - myLayer.inPoint;
if ((time >= accumDur) && (time < (accumDur + nextDur))){
break;
}
accumDur += nextDur
}
i = Math.min(1,n-1);
myComp.layer(theLayers[i]).inPoint + time - accumDur



Dan



Posts IndexRead Thread
Reply   Like  
Share on Facebook


Current Message Thread:




LOGIN TO REPLY



FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]