【发布时间】:2021-11-29 17:31:25
【问题描述】:
在 After Effects 脚本中,如果您希望脚本能够停靠在程序的工作区中,据我所知,唯一的方法是使用这样的资源字符串:
var res = "Group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\
group1: Group{orientation:'column', alignment:['fill', ''], alignChildren:['fill', ''],\
button1: Button{text: 'Button'},\
},\
}";
myPanel.grp = myPanel.add(res);
上面的代码创建了一个脚本 UI,其中一个按钮(“button1”)在一个组(“group1”)内。
我想知道创建相同资源字符串的其他方法。是否可以使用 JSON 对象然后对其进行字符串化??
我知道它可以通过某种方式完成,因为我检查了可停靠的 Duik Bassel 脚本,例如,添加了如下元素:
var button1 = myPal.add( 'button' );
但我自己不明白该怎么做。
TL;DR:我想制作一个可停靠的 scriptUI,而不是一次编写一个巨大的字符串,而是一点一点,就像一个浮动脚本。
【问题讨论】:
标签: scripting adobe extendscript after-effects adobe-scriptui