ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Reference Using Index

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Liam Campbell
Reference Using Index
on Mar 8, 2018 at 9:15:17 pm

I'm trying to make an expression where I have multiple "Beam" effects and they're going to connect to circles. The circle layers are called "Circle 1, Circle 2, Circle 3...etc". What I want to do is make the start point of the "Beam" effect, which is (Index 1) connect to the position of "Circle 1" and the end point to connect to (Index + 1) so "Circle 2". Essentially I could copy the beam layer for as many circles I have and they should just connect automatically.

An incorrect example would be like:

(In the Starting Point attribute of the "Beam" effect)

thisComp.layer("Circle [index]").position;

(In the Ending Point attribute of the "Beam" effect)

thisComp.layer("Circle [index+1]").position;

Thank you,

Return to posts index

Kevin Camp
Re: Reference Using Index
on Mar 8, 2018 at 9:55:59 pm

i think your looking for something like this...

for the start point:
target = thisComp.layer(index + 1) ;

for the end point:
target = thisComp.layer(index + 2) ;

this would connect the beam start point to the the first layer (circle) bellow the layer that the beam effect is on, and connect the end point to the second layer bellow the beam effect layer.

Kevin Camp
Art Director

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved