ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

add slider control in script

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
rob mcgowan
add slider control in script
on Feb 22, 2017 at 8:42:20 pm

hi,
I'm trying to write code that generates customizable shape layers with their own built in UI.

My problem is I can't find any documentation on adding effects through code.

At the moment I'm trying to add a slider. With nothing to go on I tried

thisLayer.effect.add("Slider Control");

and it returns effect has no add method.

Anyone point the way?


Return to posts index

Dan Ebberts
Re: add slider control in script
on Feb 22, 2017 at 8:50:00 pm

You can do it like this:

var myComp = app.project.activeItem;
myLayer = myComp.layer(1);
myLayer.property("Effects").addProperty("Slider Control");


but it's safer (if there's any chance your script will be used in another language version of AE) to use the match names, like this:

var myComp = app.project.activeItem;
myLayer = myComp.layer(1);
myLayer.property("ADBE Effect Parade").addProperty("ADBE Slider Control");


Dan



Return to posts index

rob mcgowan
Re: add slider control in script
on Feb 22, 2017 at 9:23:22 pm

Thanks that works absolutely great.

I searched the 192 page ADOBE CS6 scripting guide and found about 25 references to ADBE. Thats helpful but its not add anything like a comprehensive overview of the ADOBE class hierarchy that a beginner needs to understand the material. (The 25 references come down to maybe two or three examples mostly involving masks.)

I've tried fiddling around with the data browser thing in the debug tool and it's helpful here and there but not much.

So my question is (and I apologize because I have asked it here before in a slightly different form) if it's not in the docs then where should a beginner progress to understanding this object hierarchy so they don't have to keep nagging the clever people?


Return to posts index


Dan Ebberts
Re: add slider control in script
on Feb 22, 2017 at 9:43:49 pm

I pretty much use three references when I'm writing a script: The AE Scripting Guide; Adobe's JavaScript Tools Guide (for UI and file I/O stuff; and Jeff Almasol's wonderful rd_GimmePropPath.jsx script (available here: http://www.redefinery.com/ae/rd_scripts/) which you can use to suss out property hierarchies and match names.


Dan



Return to posts index

rob mcgowan
Re: add slider control in script
on Feb 24, 2017 at 9:08:32 pm

Jeff Almasol's rd_GimmePropPath.jsx script is just amazing.

I hadn't used it up to now as I'm on CS4 and I couldn't seem to find a compatible version at redefinery.

For the benefit of anyone else on an older version who might not know, there's a copy of version 2.0 which does work on CS4 to be found at github.


Return to posts index

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