Automation renaming layer unintentionally

Me again. :slight_smile: I’m almost done with this automation, but I’m having one glitch that I can’t figure out. I create a duplicate of a Displacement Map precomp and put it at the top of the order, changing its blending mode and opacity. I also rename it to “Displacement Map Shadow.” But I need to make a duplicate of it and rename that. However, when I do, it appears to rename “Displacement Map Shadow” to “Displacement Map Shadow 2.” It’s not the end of the world, but I want to make sure that the automation can pick the correct layer for the final few steps, and so I need to figure out what’s going wrong. I’ve attached the settings. Any help would be greatly appreciated!

Refraction lines Displacement v02.json (115.5 KB)

Hi @skimber ,
after running the “duplicate” action the current loop layer still holds the original layer that you duplicate so changing the name after duplicating will change the name of the layer that you duplicated and not the duplicate itself.
after duplicating a layer the duplicate will be added to the end of the loop so the loop will go through all the original layers and then through the duplicated layers at the end.

you can find the duplicated layer with the “isDuplicate” layer property, this property will be true only for a layer that was created during the specific loop with the duplicate action.
you need to find the layer you want to duplicate, duplicate it and then ask if a layer is the duplicate change it’s name.

I duplicated the layers in separate loops so it will be easy to find the duplicate because there is just one duplicate per loop so you can be sure its the right layer.

Download -
Refraction lines Displacement v03.json (127.0 KB)


Ah! I didn’t notice that parameter. Thank you!