docsforadobe / after-effects-scripting-guide

87 stars 20 forks source link

layer.applyPreset acts on selected layers #4

Closed mamoworld closed 3 years ago

mamoworld commented 3 years ago

Here is the relevant email communication with @jthomascolombo about that topic:


From: Mathias Möhl

Hi John,

I just noticed that Layer.applyPreset() always applies the preset to the selected layers and not to the layer from which the function is actually called.

steps to reproduce (I tested with Ae 17.7.0 on Mac OS Big Sur):

1) create a comp with two (AV) layers. 2) select the first of these layers 3) run this code (adjust path to the ffx file to fit your Ae installation) app.project.activeItem.layers[2].applyPreset(File('/Applications/Adobe After Effects 2020/Presets/Backgrounds/Blocks.ffx'));

It applies the preset to the first layer instead of the second one.

Side notes:

Do you know if this odd behavior is consistent among all Ae versions?

Cheers, Mathias

From: John Colombo

Hi Mathias,

This rang a bell for me, so I searched and found that this appears to have been an issue for quite a while: https://creativecow.net/forums/thread/ae-script-applypreset/. That forum post is from 2009.

This appears to me to be by design so that the scripting call matches the behavior in the UI, but this was implemented long before I joined the team. However, I do agree with you that the expected behavior would be to apply the preset to the layer on which the method was called. I'm not sure if updating the behavior could be called a bug fix per se, but it would certainly be an improvement and a good feature request. John, AE QE