I am trying to make an expression, which would take picture from composition "layer_1" and move it from one corner of the screen to another in main comp. 1st layer go to the next corner, 2nd layer start moving near first one, then third one starts.. coordinates are just optional.
The reason why I am asking for help, is because I am not sure whether it is possible to do so as I want. In composition "layer_1" there are 4 layers with pictures, but no matter what layer index I put into layer(i), it still shows me the first one... So maybe layers length should be different, from marker to market... or what?
Could someone give me a shot whether I am doing something wrong?
Re: Accesing composition layers position by Dan Ebberts on Jun 4, 2012 at 12:12:15 am
It's not exactly clear to me what you're trying to do, and if you already know this, I apologize, but a single expression can only affect the property to which it is applied. It appears that you want one expression to affect multiple layers, but you'll have to apply an expression to each layer.
This is why I was asking for help, because I was not sure whether if is possible at all to make it work.
Here i will try to explain better:
There is a composition "Layer_1", which contains 4 layers. By writing this line (comp("layer_1").layer(i).position), I hoped that i can access each of compositions layer by index. Is it not possible? And the reason why Im doing this, is because I want pictures to slide from one corner of the screen to another in a period of time(chosen this method, because there can be not constant amount of pictures). For now I am trying to accomplish only this step, to do not make it too complex, but it might be that Im trying to do what is impossible.
If this way is bad, could you try to suggest me another algorithm?
Re: Accesing composition layers position by Dan Ebberts on Jun 4, 2012 at 3:25:18 pm
>I hoped that i can access each of compositions layer by index. Is it not possible?
You can access layers that way, you just can't change anything. If you want to change something, the expression has to be on that layer's property. You can, however, set up an expression to do something different, depending on its own layer index, so your expression could do something like this: