通过在 After Effects 中编写脚本来添加效果



在这里,我想编写一个脚本,可以通过添加变形稳定器VFX来稳定延时序列,然后使用DEFlicker Time Lapse进行去闪烁,最后渲染和导出视频,该视频在睡眠前运行,这样它就不会在工作时间减慢我的计算机速度。但是,我在 AE 脚本文档中找不到向层添加效果的 API,有人知道如何做到这一点吗?提前感谢!

您可以像这样向图层添加效果:

if (!theLayer.Effects.property("Warp Stabilizer")){   //add only if no such effect applied
    var theEffect = theLayer.property("Effects").addProperty("Warp Stabilizer");  // the regular way to add an effect
}

要测试它,您可以将其添加到所选层,将其应用于所选层的完整代码如下所示:

var activeItem = app.project.activeItem;
if (activeItem != null && activeItem instanceof CompItem) {          // only proceeds if one comp is active
  if (activeItem.selectedLayers.length == 1) {          // only proceeds if one layer is selected
    var theLayer = activeItem.selectedLayers[0];
if (!theLayer.Effects.property("Warp Stabilizer")){
    var theEffect = theLayer.property("Effects").addProperty("Warp Stabilizer");          // the regular way to add an effect
  }
 }
}

解决方案基于 Adobe 论坛:https://forums.adobe.com/thread/1204115

最新更新