Trouble linking Slider to a Shape layer parameter
Posted: June 27th, 2012, 1:51 pm
Hi everyone, this is my first post here.
I’ve been using AE professionally for 10 years, but am only recently delving into scripting. It’s definitely not my forte, but I’ve managed to cob together a couple simple scripts.
Now I’ve started working on something more complicated and have run into trouble with one section.
I have a Shape layer (rectangle) selected and when I run the script, it adds a Null layer and adds a Slider control to the Null.
I want to use this slider to control the Roundness parameter of the Shape layer.
I’ve tried quite a few things, and always get various errors. And after a few hundred tries, I'm feeling defeated.
I’m sure I’m going about this all wrong, since this Java script stuff is so new to me and I find it very hard to understand.
Anyway, here’s the code I’ve got at the moment.
(btw, I'm using After Effects CS5.5 on a Mac)
If anyone can point out my problem(s), I'd sure appreciate the help.
Thanks,
Mark
I’ve been using AE professionally for 10 years, but am only recently delving into scripting. It’s definitely not my forte, but I’ve managed to cob together a couple simple scripts.
Now I’ve started working on something more complicated and have run into trouble with one section.
I have a Shape layer (rectangle) selected and when I run the script, it adds a Null layer and adds a Slider control to the Null.
I want to use this slider to control the Roundness parameter of the Shape layer.
I’ve tried quite a few things, and always get various errors. And after a few hundred tries, I'm feeling defeated.
I’m sure I’m going about this all wrong, since this Java script stuff is so new to me and I find it very hard to understand.
Anyway, here’s the code I’ve got at the moment.
(btw, I'm using After Effects CS5.5 on a Mac)
Code: Select all
//start with a Shape layer that is selected
var picOrigComp = app.project.activeItem;
var curLayer = picOrigComp.selectedLayers[0];
//Create Null layer and rename CONTROLS
mySolid = picOrigComp.layers.addNull();
var controlNULL = mySolid;
controlNULL.name = "CONTROLS";
////Add slider controls
var ctrlLayer = picOrigComp.selectedLayers[0];
var slider = ctrlLayer .property("ADBE Effect Parade").addProperty("ADBE Slider Control")
slider.property(1).setValueAtTime(0, 0);
slider.name = "Frame Roundness";
var slider = ctrlLayer .property("ADBE Effect Parade").addProperty("ADBE Slider Control")
slider.property(1).setValueAtTime(0, 0);
slider.name = "Stroke Thickness";
var color = ctrlLayer .property("ADBE Effect Parade").addProperty("ADBE Color Control");
color.property(1)
color.name = "Stroke Color";
//define null and shape layers
var roundCtrl = app.project.activeItem.layer("CONTROLS").property("Effects").property("Frame Roundness").property("Slider");
var roundShape = app.project.activeItem.layer("Shape Layer 1");
//link slider to shape layer's roundness control.... hopefully?
var shapeOrig = roundShape.property("ADBE Root Vectors Group");
var shapeNew = shapeOrig.addProperty("ADBE Vector Group");
var shapeRnd = shapeNew.property("ADBE Vectors Group").addProperty("ADBE Vector Shape - Rect");
shapeRnd.property("ADBE Vector Rect - Roundness").setValue(roundCtrl);
If anyone can point out my problem(s), I'd sure appreciate the help.

Thanks,
Mark