Hi everyone, I’m new to Automation Toolkit and I can’t figure out how to create a simple automation that can parent a group selected layer to the one above (or below), i.e. if I select layers 2 and 4, I want that layer 2 to be linked to layer 1 and layer 4 to layer 3. Can someone help me?
Hi @Daniele, welcome to the forum!
It’s great that you’re reaching out for help as you get started with Automation Toolkit.
To parent each selected layer to the one above it, you can follow these streamlined steps:
- Loop through the layers in the active composition.
- Identify the selected layers.
- For each selected layer, calculate the index of the layer directly above it. This is simply the current layer’s index minus 1. For example, if a selected layer is at index 5, the layer above it is at index 4.
- Create a variable to store this calculated index.
- Loop through all layers in the composition again.
- When you find a layer whose index matches the stored index, set it as the parent of the current selected layer.
This process ensures each selected layer is correctly parented to the layer immediately above it.
Here’s an automation for this process:
Parent Above.zip (1.6 KB)
Feel free to ask if you have any more questions or need further assistance!
thank you very much, it works perfectly!