ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

applyPreset Method Not finding Path

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tim Franklin
applyPreset Method Not finding Path
on Oct 26, 2015 at 6:17:55 pm
Last Edited By Tim Franklin on Oct 26, 2015 at 6:18:13 pm

Hi all,

I'm writing a script where I'll need to apply an animation preset to a group of layers. I have the exact path pasted into a path variable, and I believe everything else is correct, but it's still saying "unable to call applyPreset" because of parameter 1.

Any ideas on why this is not working?
Also, is there a way to get script error messages on a bigger window somewhere other than just the info panel on the bottom of extend script?

Below is part of the code.

Thanks!
-Tim

app.beginUndoGroup("Undo");

var proj = app.project;

var myLayers = app.project.items.layers;
var items = app.project.items;
var myComp, myLayer, myTime, myName;
var presetPath = "C:\Program Files\Adobe\Adobe After Effects CC 2015\Support Files\Presets\Backgrounds\Apparition.ffx";
var myPreset = File(presetPath);


function creation(name,number,time,duration){

this.name= name;
this.number = number;
this.time=time;
this.duration = duration;

//myName = name.toString;
myComp = items.addComp(name, 1920,1080,1,duration,29.976);
i = 0;
var width = myComp.width;
var height = myComp.height;
var aspect = myComp.pixelAspect;
var duration = duration-time;
var myLayer = myComp.layers.addSolid([0,0,0],name,width,height,aspect,duration);
myLayer.applyPreset(myPreset);

};

creation("Begin",6,15,300);


Tim Franklin
Watchout System Programmer/Compositor - CBS Sports
Freelance Visual Effects Artist/ Video Editor
http://www.TimSFranklin.com


Return to posts index

Dan Ebberts
Re: applyPreset Method Not finding Path
on Oct 26, 2015 at 6:22:07 pm

Try specifying your path this way:

"/C/Program Files/Adobe/Adobe After Effects CC 2015/Support Files/Presets/Backgrounds/Apparition.ffx"


Dan



Return to posts index

Tim Franklin
Re: applyPreset Method Not finding Path
on Oct 26, 2015 at 6:30:25 pm

Phew, I thought I was going crazy. Thanks so much for the quick reply on this, works perfectly!

Tim Franklin
Watchout System Programmer/Compositor - CBS Sports
Freelance Visual Effects Artist/ Video Editor
http://www.TimSFranklin.com


Return to posts index

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