Skip to main content
Participant
October 7, 2015
Answered

How to apply animation preset to a selected or all layers through a script?

  • October 7, 2015
  • 1 reply
  • 3285 views

Hello all,

I have several layers and I want to apply a random animation preset to each layer through a script.

I know how to apply an effect, for eg. [somelayer].property("Effects").addProperty("Block Dissolve"),

but how to apply a whole animation preset (eg. Block Dissolve - digital or Card Wipe - 3D pixelstorm).

Thanks!

This topic has been closed for replies.
Correct answer Dan Ebberts

Once you have the file path to the preset, you can do it like this:

myLayer.applyPreset(File(myPresetPath));

Dan

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
October 7, 2015

Once you have the file path to the preset, you can do it like this:

myLayer.applyPreset(File(myPresetPath));

Dan

Participant
October 7, 2015

Thank you for such a fast answer!!!

P.S.

It works but only on a currently selected layer. If none of the layers are selected, AE simply creates a new Solid layer and applies preset on it:

var activeComp = app.project.activeItem;

var compLayers = activeComp.layers;

var preset = File('C:\\Program\ Files\\Adobe\\Adobe\ After\ Effects\ CS5.5\\Support\ Files\\Presets\\Transitions\ -\ Movement\\Card\ Wipe\ -\ 2D\ fractured.ffx')

for (var i = 1; i  <=compLayers.length; i++){

    compLayers.applyPreset(preset);

}

Participant
April 29, 2016

What does the ffx file do? If it makes a shape - preset, AE will make a layer for the shape. . . as opposed to say a blur effect that can be applied to a footage layer.


The Preset Animates the scale and the rotation.  That's it.