【问题标题】:Adding effects by scripting in After Effects在 After Effects 中通过脚本添加效果
【发布时间】:2019-01-05 15:53:08
【问题描述】:
这里我想写一个脚本,可以通过添加Warp Stabilizer VFX来稳定延时序列,然后使用DEFlicker Time Lapse进行去闪烁,最后渲染和导出视频,该视频在睡眠前运行,这样它就不会变慢在工作时间关闭我的电脑。但是,我在 AE 脚本文档中找不到向图层添加效果的 API,有谁知道如何做到这一点?提前致谢!
【问题讨论】:
标签:
scripting
adobe
extendscript
after-effects
【解决方案1】:
您可以像这样向图层添加效果:
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