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

Hi Alon, I’m back!
I have been working on an automatic transitions tool to implement in this same project.

We have transition precomps named “*TransX” that contain “*ContentTransX” (a placeholder).
The goal is to replace the latter with transitions that the user selects.
In a specific comp you select 1 transition among 97 low res previews of them by making it a solo layer.
You do this for all transitions
Automation gets the name of the selected ones and finds the corresponding transition in the project.
Then you just replace the placeholders with them.

Now, my issue is that I tried different versions of these and ended up with this simpler one.
Except, I can’t test it anymore for some reason. When I execute the automation it shows the busy cursor from time to time and nothing happens until I press esc. key. After pressing it, I get the message (translated in english) “Can’t execute the script at line 6. Execution halted”.
Tried many things but nothing seems to fix it.

Could you help with this?
Are there any flaws with the automation?

Sending the screenshot in my next post, sorry

Thank you in advance!

Hi @Max, it’s great to hear from you again!

It seems like a bug in Automation Toolkit. It would be helpful to understand what causes this bug so I can fix it. I don’t encounter bugs like this often, so it will be a nice catch.

I don’t see any problems in the screenshot you provided, but it seems to show only part of the automation. Perhaps the issue lies earlier in the script?


I recreated the automation based on your screenshot, and it works without problems. Please check if it works for you as well:
Transitions V5.1.zip (1.5 KB)

If you still experience this issue, please provide more details, such as the full automation(as json file), a screen recording of the problem, or anything else you think might help.