ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Extendscript: how to duplicate a solid inside a composition?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Frank Peeters
Extendscript: how to duplicate a solid inside a composition?
on Apr 30, 2020 at 7:50:37 am

I'm thinking I might be wrong in my thinking process, but I'm unable to duplicate a solid layer inside my composition.

Let's say my layer is named "##background".


for (var i = 1; i <= app.project.activeItem.numLayers; i++) {
var layer = app.project.activeItem.layer(i);
if (layer.name === '##background') {
var newLayer = layer.duplicate();
}
}


When I run that command AE and Extendscript Toolkit hang.

I read up on things, and though I would need to duplicate it in the project window with a menu command for duplication, but that yielded the same result.

Can someone enlighten me what I'm doing wrong?


Return to posts index

Andrei Popa
Re: Extendscript: how to duplicate a solid inside a composition?
on Apr 30, 2020 at 9:43:32 am

var newLayer = app.project.activeItem.layer('##background').duplicate()

Andrei
My Envato portfolio.


Return to posts index

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