javascript - After Effects 脚本 - 表达式 Controller 坐标

标签 javascript expression extendscript after-effects

为 After Effects 2015 编写脚本。尝试将坐标数据从点表达式 Controller 复制到图层的位置数据。我似乎找不到指向表达式 Controller 值的方法。

for (i = 1; i <= app.project.activeItem.selectedLayers[0].property("Effects").numProperties;  i++) {
    app.project.items[2].layer(i).property("position").setValue(app.project.activeItem.selectedLayers[0].property("Effects").property(i).value);                         
}

我也尝试过这个:

for (i = 1; i <= app.project.activeItem.selectedLayers[0].property("Effects").numProperties;  i++) {
    app.project.items[2].layer(i).property("position").setValue(app.project.activeItem.selectedLayers[0].property("Effects").property(i).property("Point").value);                         
}

如有任何帮助,我们将不胜感激。我希望我没有犯任何错别字......

最佳答案

这应该能让你继续前进。您需要一个带有表情点 Controller 的图层,并且需要选择它。我在这里使用效果的匹配名称。您也可以使用界面中的名称。我建议获取 rd_GimmePropPath script from redefinery.com 。每次都帮助我。

function main() {
  app.beginUndoGroup("XXX");
  var curComp = app.project.activeItem; // get the current comp
  if (!curComp || !(curComp instanceof CompItem)) {
    // doulble check
    alert("noComp");
    return;
  };
  var layerwithpointcontroller = curComp.selectedLayers[0]; // the first selected layer
  // get the value of the expression controler
  var pointvalue = layerwithpointcontroller.property("ADBE Effect Parade")
    .property("ADBE Point Control")
    .property("ADBE Point Control-0001")
    .value;

  $.writeln(pointvalue); // take a look at it
  var nullobject = curComp.layers.addNull();// add a null
  nullobject.position.setValue(pointvalue);// set its position
  app.endUndoGroup();
}
main();

关于javascript - After Effects 脚本 - 表达式 Controller 坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38319815/

相关文章:

c++ - 在轮廓中寻找点

javascript - 不要将 Indesign 标签添加到根元素?

javascript - Indesign Script 确实起作用了两次

javascript - 将 img HTML 标记与对 C# 函数的调用相结合添加到 JavaScript 脚本内的 ASP.NET 页面

javascript - JSON、JavaScript、错误的日语字符

c# - 使用 Expression 调用属性和对象并判断对象是否为 null

adobe-indesign - 编写脚本以静默方式将 InDesign CS6 转换为 CC,保存对话框问题

javascript - 字数限制或内容高度限制,多看少

javascript - 根据点击更改面板标题颜色并显示面板正文内容

r - 使用带动态下标的希腊字母