Copy link to clipboard
Copied
Expression needed! Using the trim paths mask, I need the paths to end at random times. I have already looked online and I found this expression,
minDur = 1; maxDur = 5;
seedRandom(index,true);
dur = random(minDur,maxDur);
linear(time,0,dur,0,100)
and apparently it worked for the reipriant, but it doesn't work for me, please help.
Thanks,
The expression you found wont be random across invocations; that's by design. It will always generate the same random end point for the given layer # it is on (random seed is based on layer #, which is the variable 'index'). You can change the random # selected for the invocation by varying the seed, for example statically like this: (100 is arbitrary - use any number to change the seed):
seedRandom(100,true);
You can also vary the seed based on a dynamic element, like the layer's position in time
...Copy link to clipboard
Copied
And what exactly doesn't work? You need to explain better and in more detail rather than just saying it wouldn't work.
Mylenium
Copy link to clipboard
Copied
Oops, edit - hadn't woken up yet. It works for me. Perhaps you don't think it was working because the randomly-selected duration is longer than you want. The "minDur" and "maxDur" values specify the minimum and maximum duration (in seconds) that will be randomly selected for the trim paths to complete (ie, reach 100%). Try tweaking those values to taste.
Copy link to clipboard
Copied
thanks for you help, I don't think I need to do it anymore, i have done something that suits my needs better I think, but just to clarify, I put the expression in the 'end' value in the 'trim paths' (which is what Im using to animate it), and the only changes I have been making to this expression has been the numbers, I have been playing around with it with the vague knowledge of how you describe it and it is never been random for some reason, its always been uniform and sometimes a bit glitchy, I will carry on playing around with it because I'm new to AE so it might well be me missing something obvious.
Copy link to clipboard
Copied
The expression you found wont be random across invocations; that's by design. It will always generate the same random end point for the given layer # it is on (random seed is based on layer #, which is the variable 'index'). You can change the random # selected for the invocation by varying the seed, for example statically like this: (100 is arbitrary - use any number to change the seed):
seedRandom(100,true);
You can also vary the seed based on a dynamic element, like the layer's position in time. But doing that would require some modifications to the expression.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more