Activity › Forums › Adobe After Effects Expressions › After Effects Position Expression
-
After Effects Position Expression
Posted by Mirco Lanz on April 25, 2022 at 11:25 pmHey, I’m searching for an expression which randomly targets the position from random layers.
Mirco Lanz replied 4 years, 5 months ago 2 Members · 5 Replies -
5 Replies
-
Dan Ebberts
April 26, 2022 at 12:09 amI think we need more info. Please be more descriptive about what you’re trying to do.
-
Mirco Lanz
April 26, 2022 at 7:18 amI want to build a Lightning Effect with “advanced lighting” The idea is that i have a fixed point for the beginning of the Lightning and the End is jumping to different tracked positions in the room.
-
Dan Ebberts
April 26, 2022 at 2:58 pmThis should randomly select the position of any layer except the one with the expression:
minDur = .5;
maxDur = 1.5;
t = tPrevT = inPoint;
seedRandom(index,true);
while (t <= time){
tPrev = t;
t += random(minDur,maxDur);
}
seedRandom(tPrev,true);
L = [];
for (i = 1; i <= thisComp.numLayers; i++){
if (i == index) continue;
L.push(i);
}
fromComp(thisComp.layer(L[Math.floor(random(L.length))]).transform.position)
-
Mirco Lanz
April 27, 2022 at 5:06 pmI tested your expression today and it works wonderfully! Thank you very much! You have helped me a lot ❤
Reply to this Discussion! Login or Sign Up