【问题标题】:After effects Script - Documentations for passing a regexp text into the Window.add() functionAfter Effects Script - 将正则表达式文本传递到 Window.add() 函数的文档
【发布时间】:2021-09-27 17:27:47
【问题描述】:

我正在学习如何在 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'});

有这种包装的文档吗?

【问题讨论】:

    标签: after-effects


    【解决方案1】:

    示例代码中res 值的“包装”称为“资源字符串”,它类似于由 Adob​​e 框架驱动的 UI 的语义标记。

    这是有关该主题的文档:

    https://extendscript.docsforadobe.dev/user-interface-tools/resource-specifications.html?highlight=resource%20string#resource-specifications

    【讨论】:

    • 这太棒了,非常感谢!
    • @kr17 不客气。如果答案符合您的需要,请将其标记为正确:) 谢谢!
    • 是否可以这样做但使用 JSON 对象创建 res 变量?
    • @arismelachroinos 不幸的是,我并不知道,但是您可以使用三重双引号,我认为这样您就不必在任何地方使用反斜杠字符。例如,这是有效的my_resource="""Group { }"""
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-13
    • 2020-08-16
    • 1970-01-01
    • 2016-06-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多