FORUMS: list search recent posts

Duplicate layer without changing name

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
criis daw
Duplicate layer without changing name
on Sep 20, 2019 at 10:09:34 am

Does any body know of a way ro duplicate a layer but have the name remain the same ?

for example.

Layer_01 duplicates to Layer_02

but i would like it to remain Layer_01

any ideas ??


Return to posts index

Walter Soyka
Re: Duplicate layer without changing name
on Sep 20, 2019 at 9:04:38 pm

You could do this with a script.

Save this code as "01-duplicateLayerPreserveName.jsx" in your Scripts folder. (The number is important to force it to the top of the list, alphabetically, so we can assign a keyboard shortcut to it later.)

// duplicate selected layers and rename dupes to match originals exactly

app.beginUndoGroup("Duplicate selected layers and preserve exact names");

if (app.project.activeItem instanceof CompItem) {
var renamedLayerCount = 0;
for (var i = 0; i < app.project.activeItem.selectedLayers.length; i++) {
try {
var originalLayer = app.project.activeItem.selectedLayers[i];
var newLayer = originalLayer.duplicate();
newLayer.name = originalLayer.name;
renamedLayerCount++;
} catch (err) {};
}
writeLn("Renamed " + renamedLayerCount + " layer(s).");
}

app.endUndoGroup();


Reload Ae, then Edit > Keyboard Shortcuts. Search the command list for "script" and find the "01-duplicateLayerPreserveName" entry. Assign it a keyboard shortcut, and then you can easily rename layers without incrementing their names. (Note that this can cause unexpected results if you're using expressions that refer to layers by name!)

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

criis daw
Re: Duplicate layer without changing name
on Sep 20, 2019 at 9:50:46 pm

thanks for that.

ill test it and let you know



Return to posts index


criis daw
Re: Duplicate layer without changing name
on Sep 20, 2019 at 10:17:36 pm

THANK YOU SO MUCH !!!!



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]