Affect layers in another comp with values from a collection

Hello Alon,

I am working on a “responsive” project. Basically I am building a template file with a few automations.
I have a “main” composition with a few sequences (compositions) and transitions meant to be placed between them.
A “Set timings” composition was created where the user can input the duration they want each sequence to be. They also input the duration of all the sequences and the overlap between sequences and sections.

So far, retrieval of these values is going smoothly.
It’s the part where you apply these values to the sequences that doesn’t make sense to me. I want to be able to use the inputs that I store in collections (mentioned above) and use them to set the start time of each sequence layer.
Then I would just set the duration of each sequence to the desired one and move the transitions to be placed between sequences.

Just to make it clear, this automation is meant to remove the tedious work of manipulating comps and moving them, adjusting them all the time. That way you can just focus on animating stuff inside each sequence.
Also, if you realize you need your sequence to be longer, you can just change the input value and run the automation again. This way, all the compositions will be moved to start 2 seconds later for example, if you add 2 seconds to your sequence.
Same goes for the transitions, if I use a different transition for a different client and it’s longer, I can just adjust the value.

I commented with my intentions on every important line.
Can you tell me what I’m doing wrong?
Thanks a ton!

Hi @Max ,
Thank for reaching out!

From your automation I can see that you have an advance understanding of Automation Toolkit, so well done! most users do not get to this level.


I needed to make assumptions of how exactly this automation works, because some of the loops are hidden and collapsed and also I am not sure what layers the main composition already contains.

it would be preferable to send the automation as json file and maybe the starting point of the composition as an example, a result composition would be great too.


As for the first part of the automation,
you started by collecting the inputs from the active composition, I can see that you are using double loops, which are unnecessary, it works but it should be written differently with less lines and more efficiently, but the efficiency is negligible.

For example here is your first loop -

The outer loop is doing nothing, it runs once and then stops, so it only runs 1 time in total and its value not used by any other line, its like to run the inner lines without this loop so we can just remove it.

Here is the improved version of this loop (we use 1 loop and stops at the correct time here) -


As for the second part that you have problems with,
I couldn’t find the problem,
I recreated this part almost identically as yours and it works fine for me, the layers moves to the correct times.

here is my automation for testing it, I copied your automation but created the collection with predefined numbers.

Download -
distribute layers test.zip (1.6 KB)


you can try to run this automation and check if it works for you too,
I will need additional info to find out why it doesn’t work.

Hi Alon,

Thanks a lot for your time and sorry for the late reply.
Also thank you for your work on this plugin, it’s very rewarding to learn how to use it and I truly think it has crazy potential. :exploding_head:

I followed your instructions for the loops optimization :v:

Last time I didn’t unwrap all the loops, that’s my bad. In this new screenshot you will see the whole automation :

Here you can see the “MAIN” composition :
Ideally I want the end result to look something like that

And the “Set Timing” composition from which I execute the automation :

Keep in mind : Intro is *SEQ0. Sorry that’s a bit confusing but it helps keep the code as simple as possible.


The automation you sent works perfectly for me too. I’m failing to see where mine goes wrong still


The issues I have :

  • For some reason the duration value of intro (*SEQ0) is 265 ? I don’t think I even touched that part of the automation but now it’s wrong :frowning:

  • The sequences in MAIN comp still don’t move


Don’t hesitate to ask for any additional info, I will be available :+1:

Hi @Max ,
Thanks for all the information, it helped me understand the whole process much better.

Its hard to pinpoint exactly what was the problem with such a long automation, there could be a lot of small problems, each part should be checked separately.

a noticeable problem I could find that caused the layers in “MAIN” comp to not move is in this line:

You tried to set the index of the collection to 0 but the index in collection starts from 1, so this line did not affect the index of the collection. as a result in the next lines you didn’t get correct start times so it did not set the layers and they didn’t move.

  • another problem was how you calculated the duration collection, you used the wrong loop so it did not work as expected.

I recreated your automation with small changes here and there but kept the same functionality.

In this example automation I colored each part in different color,
Here is a summery of what each part does:

  1. Blue: we save the transition duration and transition overlap as variable, and create the duration collection with the duration of the layers that include “duration” in their name.
  2. yellow: we create the start time collection and populate the collection based on the durations collection and the transition duration and overlaps.
  3. green: we loop over the layers in the “MAIN” comp and move each *SEQ layer to its start time based on the start time collection, we also set the in point and out point based on the duration collection and the start time collection.
  4. purple: move the *TRANS transition layers to the correct time in the “MAIN” comp.

Download -
timings v10.zip (4.2 KB)

Please let me know if you have questions or you need more help

Thanks again for your help, this seems to be working perfectly :star_struck:
It seems I was a bit off but it was really fun trying to solve this puzzle.
I am going to be adding more automations to this project and will probably come back here if I’m at a dead end :eyes:

THANKS