Skip to main content
Hey Evgenii
Inspiring
October 30, 2023
Answered

Copy/paste effects behave weird

  • October 30, 2023
  • 1 reply
  • 686 views

Hi guys, I am trying to implement some simple copy-paste function to copy effects from one layer to another using executeCommnad in AE, however it doesn't paste keyframes and adds expressions to all properties 'baking' only one value if the keyframe was applied to a property, what can be the reason and the best way to achieve what I am trying to do? I feel I can go with standard copy/adding effects properties and settings the values for each property with keyframes, but I feel this can be done easier:

//save selected layers
    var reservedSelection = [];
    activeComp.selectedLayers.forEach(function (layer) {
      reservedSelection.push(layer);
    });

    //select the effect and copy it
    app.executeCommand(2004); //deselect all
    storageComp.openInViewer();
    var effects = storageComp.layer(1).property("ADBE Effect Parade");
    for (var i = 1; i <= effects.numProperties; i++) {
      effects.property(i).selected = true;
    }
    app.executeCommand(10313); //copy

    activeComp.openInViewer();
    //restore selection
    reservedSelection.forEach(function (layer) {
      layer.selected = true;
    });
    app.executeCommand(20); //paste

source: 

result:

 

This topic has been closed for replies.
Correct answer Rick Gerard

It sounds like you are using Edit/Copy with Property Links. The expressions are normal. 

 

If you just want to copy and paste a layer, select the layer, press Ctrl/Cmnd + C, go to another comp, and press Ctrl/Cmnd + v. 

 

If you are copying in the same layer just select the layer and press Ctrl/Cmnd + d.

1 reply

Rick GerardCommunity ExpertCorrect answer
Community Expert
October 31, 2023

It sounds like you are using Edit/Copy with Property Links. The expressions are normal. 

 

If you just want to copy and paste a layer, select the layer, press Ctrl/Cmnd + C, go to another comp, and press Ctrl/Cmnd + v. 

 

If you are copying in the same layer just select the layer and press Ctrl/Cmnd + d.

Hey Evgenii
Inspiring
October 31, 2023

Thank you Rick, you were right, I used different command, while copy is just 19