Page 1 of 1

Apply preset and strange result

Posted: February 19th, 2012, 3:31 pm
by Simma
I'm probably missing something obvious here but if I run the attached code without a layer selected, a new solid is created and the preset is applied to that layer. If I select the first layer it works as expected.

Code: Select all

var path = "D:/vfx_tools/aftereffects_tools/animation_presets/jpegEdgeFix.ffx"

var myLayer = app.project.item(1).layer(1);

var preset = new File (path)

var addPreset = myLayer.applyPreset(preset);

Re: Apply preset and strange result

Posted: February 21st, 2012, 6:28 am
by Simma
Looks like the layer needs to be selected (myLayer.selected = true). Weird.

Re: Apply preset and strange result

Posted: July 31st, 2013, 3:42 pm
by everydayme
Awesome, helped me out!

My script was looping through all selected layers and supposed to apply a preset according to layer name, but would only apply to the first one. Select fixed it!


Thanks.