问题描述
我正在尝试使用 PHP 开发 API,它将接收来自用户的文本作为输入.我需要更改 aepx 文件中的文本.在我的研究中,我发现 标签和 分别包含文本值及其对应的十六进制值.
我能够解析和替换 aepx 中 标签的文本.我还可以更改 的 bdata 属性的十六进制值.
但是在我进行了所有更改之后,它没有渲染(尝试使用 aerender 命令运行).此外,After Effect Application(最新的 -cc 2018)在打开更改的 aepx 文件时崩溃.
示例:
原创
< ldta BDATA = 0000000c00020000000000010000000000005da80000000000005da8000afc8000005da80000008700 0000000000000000000000000000000000000100010000506c616365686f6c6465722074657874000000000000 000000000000000000000000000200000000000000000000000100000000000000000000000000000000000000 0300000000000000000000000000000000000000000000000000000000"/><string>占位符文本</string>
变更后
< ldta BDATA = 0000000c00020000000000010000000000005da80000000000005da8000afc8000005da80000008700 000000000000000000000000000000000000010001000048656C6C6F20576F726C642100000000000000000000 000000000000000000020000000000000000000000010000000000000000000000000000000000000003000000 00000000000000000000000000000000000000000000000000"/><string>Hello World!</string>
您可以使用 After Effects 表达式执行此操作.以下是对我有用的步骤:
- 在 AfterEffects 中打开项目
- 转到要修改的文本层
- 单击箭头图标,显示带有秒表图标和文本源文本"的子部分
- ALT + 单击秒表图标,您将在其下方看到另一个部分,其中包含文本表达式源文本"
- 将其值指定为thisLayer.name"
- 点击文件>另存为>另存为xml
- 这将为您创建一个 aepx 文件.
- 在任何文本编辑器中打开 aepx 文件并搜索您要修改的文本.确认它在附加的示例 aepx 图像中看起来像.以下是我们在上述步骤中通过 AfterEffects 创建的表达式行thisLayer.name".
- 现在将文本这是要更改的文本"更改为您想要的任何内容,
- 渲染并检查.如果一切正常,则必须对其进行更改.
附加图片:
- After Effects 设置表达式的步骤
- 示例 aepx 一瞥.
I am trying to develop an API using PHP, Which will receive Text from user as Input.I need to change text inside the aepx file. On my research I found <string> tag and <ldata> contains text value and corresponding its hexadecimal value respectively.
I am able to parse and replace text of <string> tags in aepx.I am also able to change the hexadecimal values of bdata attribute of <ldata>.
But after all the changes I have made, it is not rendering(tried to run using aerender command). Also After Effect Application(latest -cc 2018) is crashing while opening changed aepx file.
Example:
Original
<ldta bdata="0000000c00020000000000010000000000005da80000000000005da8000afc8000005da80000008700 0000000000000000000000000000000000000100010000506c616365686f6c6465722074657874000000000000 000000000000000000000000000200000000000000000000000100000000000000000000000000000000000000 0300000000000000000000000000000000000000000000000000000000"/>
<string>Placeholder text</string>
After Change
<ldta bdata="0000000c00020000000000010000000000005da80000000000005da8000afc8000005da80000008700 000000000000000000000000000000000000010001000048656C6C6F20576F726C642100000000000000000000 000000000000000000020000000000000000000000010000000000000000000000000000000000000003000000 00000000000000000000000000000000000000000000000000"/>
<string>Hello World!</string>
You can do this using After Effects Expressions. Following are the steps which worked for me:
- Open the project in AfterEffects
- Go to Text layer you wish to modify
- Click arrow icon which shows a sub section with a stopwatch icon and the text "Source Text"
- ALT + click the stopwatch icon, you will see another section underneath it with text "Expression Source Text"
- Give its value as "thisLayer.name"
- Click File > Save as > Save as xml
- This will create you a aepx file.
- Open aepx file in any text editor and search for the text you wish to modify. Confirm that it looks like in the attached sample aepx image. The following is the expression line "thisLayer.name" that we created through AfterEffects in above steps.
- Now change the text "This is the text to be changed" to whatever you wish,
- Render and check. If all ok then it must be changed.
Attached images:
- After Effects steps to setup expression
- Sample aepx glimpse.
这篇关于以编程方式更改 aepx 文件中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!