Copy link to clipboard
Copied
Hi,
I want to loop the start and end of trim path but randomly for each line.. like line 1 start it's loop at 2 second, line 3 at 4 second. and none of them will overlap with one another's animation timing, I mean suddenly line 2 start its loop and line 3 and line 1 are not looping, again when line 1 looping line 2 and 3 not animating. . they will happen solo at their own time. And I want this to continue for as long as the main comp goining on, say 20 second, each line will be in a loop but different timing... . How can I write the expression? Thank you.
Here's an example. It's probably not exactly what you're after, but it might be close enough to get you started. Add a null, name it "Controls" and add a Point Control named "Line and Percent". Add this expression to the Point Control:
minLine = 1; // minimum line number participating
maxLine = 3; // maximum line number participating
runDur = 1; // duration of animation time
seed = Math.floor((time-inPoint)/runDur);
seedRandom(seed,true);
curLine = Math.floor(random(minLine,maxLine + 1));
curP
...
Copy link to clipboard
Copied
Here's an example. It's probably not exactly what you're after, but it might be close enough to get you started. Add a null, name it "Controls" and add a Point Control named "Line and Percent". Add this expression to the Point Control:
minLine = 1; // minimum line number participating
maxLine = 3; // maximum line number participating
runDur = 1; // duration of animation time
seed = Math.floor((time-inPoint)/runDur);
seedRandom(seed,true);
curLine = Math.floor(random(minLine,maxLine + 1));
curPct = (((time-inPoint)%runDur)/runDur)*100;
[curLine,curPct]
For each of the line shape layers (named in the format "Line n") add this expression for the Trim Path's Start parameter:
ctrl = thisComp.layer("Controls").effect("Line and Percent")("Point");
curLine = parseInt(ctrl.value[0],10);
curPct = ctrl.value[1];
if (curLine == index){
ease(curPct,20,100,0,100)
}else
0
and this for the End parameter:
ctrl = thisComp.layer("Controls").effect("Line and Percent")("Point");
curLine = parseInt(ctrl.value[0],10);
curPct = ctrl.value[1];
if (curLine == index){
ease(curPct,0,30,0,100)
}else
0
You may need to fiddle with the numbers.
Copy link to clipboard
Copied
Thank you so much. I needed this guidance. Thank you.
Copy link to clipboard
Copied
You are the GOAT of all the GOAT of entire universe... I just applied it and its exactly what I needed. I cant stop being happy. Thank you so much.
GOAT= Greatest of All Time
Find more inspiration, events, and resources on the new Adobe Community
Explore Now