After Effects Extendscript - 更改addlight的中心点

时间:2014-07-23 08:35:14

标签: javascript adobe extendscript after-effects

使用此示例代码:

app.project.item(index).layers.addLight(name, centerPoint)

我创建了以下测试代码,我在项目的第二个场景(合成)中添加了一个灯光以创建阴影:

var s2light1 = scene2.layers.addLight("s2light1", [1143,121]);

这完美无缺。但我现在也想在Extendscript中设置centerPoint的第3个(Z)值(在After Effects中可能)。

但是根据After Effects CS6脚本指南,您似乎只能设置X和Y值:" 新摄像机的中心,浮点数组[x,y]。这用于设置新摄像机的Point of Interest属性的初始x和y值。 z值设置为0. "

是否有其他方法或解决方法为Extendscript设置中心点的Z值我可以尝试?

1 个答案:

答案 0 :(得分:0)

newLight = app.project.item(1).layers.addLight("foo", [22, 33]);
//now set the point of interest ('center point') value:
newLight.property("Point of Interest").setValue([22, 33, 11]);

并使灯不自动定向(单节点):

newLight.autoOrient = AutoOrientType.NO_AUTO_ORIENT;

在这种情况下,您将控制“位置”和“旋转”属性 - 没有兴趣点。