after-effects - After Effects Script - 将正则表达式文本传递到 Window.add() 函数的文档
问题描述
我正在学习如何在 AE 中制作 UI 面板,并且我在 Youtube 上有这段代码
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Dockable Script", undefined, {resizeable:true, closeButton: false});
res = "group{orientation:'column',\
groupOne: Group{orientation:'row',\
createCompButton: Button{text:'Create Comp'},\
},\
groupTwo: Panel{orientation:'row',\
deleteCompButton: Button{text:'-'},\
deleteText: StaticText{text:'Delete Active Comp'},\
},\
groupThree: Group{orientation:'row',\
closeButton: Button{text:'Close'},\
},\
}";
myPane.grp = myPanel.add(res);
但是我找不到任何关于这种将每件事都包装成正则表达式文本的文档。我发现的都是这样的:
myPanel.createCompButton = myPanel.add('button', [10,10, 120, 60], "Create Comp", {name: 'create'});
有这种包装的文档吗?
解决方案
示例代码中值的“包装”res
称为“资源字符串”,它类似于由 Adobe 框架驱动的 UI 的语义标记。
这是有关该主题的文档: