Automate changes across keyframes on duplicate layers

This might be too complicated, but I figure it can’t hurt to ask. Is it possible to write an automation that copies changes from one layer to its duplicate in the same comp?

In my specific case I have a mask layer from an Auto-trace I completed. I duplicated it. Now when I make small tweaks to the original mask (deleting errant keyframes, changing opacity etc.) I need to manually copy those changes to the duplicated mask.

Is it possible to automate?

Hello @efraser88,

Indeed, it is both possible and complex to automate the process you’re describing. But don’t worry, I’ve taken care of the complexity for you!

I’ve created an automation that copies all the masks from the primary selected layer to all the other selected layers. This should be helpful when you want to update your duplicate layers. Here’s how it works:

First, select the original layer and then all the duplicated layers you want to update. Next, run the automation. It will automatically override all the masks on the selected layers with the mask from the original layer.

Creating this automation required approximately 50 lines of code, as copy&paste multiple keyframes in After Effects necessitates pasting them at the time of the earliest keyframe to maintain correct timing. This, along with other steps involving menu commands, contributes to the complexity of the automation. Therefore, don’t worry if you find this intricate — it’s not your everyday task!

Now, to further refine this automation, we can eliminate the manual selection process for the original layer. The automation could identify duplicated layers based on their names or other similar attributes. For example, if the original layer is named “Layer 1”, the automation could search for other layers named “Layer 1” containing the word “duplicate”. There are various ways to identify duplicate layers, so if you follow a specific naming convention, let me know. I can modify the automation to find duplicate layers more efficiently based on your convention.

You can download the automation from the following link:
Copy Masks Changes.zip (4.7 KB)

Thanks,
Alon

Wow, that worked flawlessly, I’m stunned! You are a wizard.