-
Script Issue
Hi all
I am new scripting in After effects. The problem is that I have a GUI with a button that creates a shape and a second button should change the opacity of this shape. But when I click the second button nothing happens. I tried several things and hierarchies but the sintax to recall the shape layer isnt working somehow.Any Ideas???
var groupTwo = myWin.add(“group”, undefined, “GroupTwo”);
groupTwo.alignment =[“fill”,”fill”];
groupTwo.orientation = “row”;
var p2 = groupTwo.add (“panel”,undefined, ” Cursor type”);
p2.alignment = [“fill”,”fill”];
p2.orientation = “row”;
p2.alignChildren = [“”,”fill”];var btn4 = p2.add(“iconbutton”, undefined, “image.png”,”IconButton”);
var btn5 = p2.add(“iconbutton”, undefined, “image2.png”,”IconButton”);btn4.onClick = function(){
var testComp = app.project.items.addComp(‘testComp’,200,200,1,20,25);
var shapeLayer = testComp.layers.addShape();
shapeLayer.property(“Contents”).addProperty(“ADBE Vector Group”);
shapeLayer.property(“Contents”).addProperty(“ADBE Vector Shape – Ellipse”);
shapeLayer.property(“Contents”).addProperty(“ADBE Vector Graphic – Fill”);}
btn5.onClick = function(){
//———->> HERE NOTHING IS HAPPENING <<------------------- var opaCity = shapeLayer.property("Transform").property("Opacity").setValue(10); }