我正在尝试编写一个创建矩形的脚本,然后在After Effects中更改默认" Red"的颜色。
这就是我所拥有的。它创造了形状,但从不改变"填充1"颜色。
function createBackgroundShape() {
var currentComp = app.project.activeItem;
if (currentComp) {
var shapeLayer = currentComp.layers.addShape();
var shapeGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group");
shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Rect");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Stroke");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
var myRGBColor = [0, 255, 0, 255]/255;
shapeLayer.content("Group 1").content("Fill 1").color = myRGBColor;
shapeLayer.content("Group 1").content("Stroke 1").color = myRGBColor;
}
}
createBackgroundShape ()
答案 0 :(得分:0)
想出来。它应该是:
shapeLayer.content("Group 1").content("Fill 1").color.setValue(myRGBColor);