FORUMS: list search recent posts

Select random layer as a Value

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James Barry
Select random layer as a Value
on Jun 20, 2015 at 8:40:36 am

I've created randomly seeding dots that move, and I would like to connect the dots with lines. I've created the dots and I know to use BEAM to connect the dots using the dots positions as begin and end points for the BEAM.

What I would like to do is to put in an expression for the beginning and end points for the BEAM an expression that randomly selects which dot is connected to the next dot.

So like something like

thisComp.layer("Dot <b>(random number between 1-60)</b>").transform.position

With "Dot" being the layer names for the dots (eg: Dot 1, Dot 2, Dot 3, Dot 4, etc)

Is this possible?

Thank you in advance.


Return to posts index

Dan Ebberts
Re: Select random layer as a Value
on Jun 20, 2015 at 2:24:11 pm

I haven't test it, but this should work:

thisComp.layer("Dot " + (Math.floor(random(60))+1)).transform.position

Dan



Return to posts index

James Barry
Re: Select random layer as a Value
on Jun 20, 2015 at 4:25:58 pm

Perfect, thanks.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]