以编程方式更改 aepx 文件中的文本 [英] Change text in aepx file programmatically

查看:76
本文介绍了以编程方式更改 aepx 文件中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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 表达式执行此操作.以下是对我有用的步骤:

  1. 在 AfterEffects 中打开项目
  2. 转到要修改的文本层
  3. 单击箭头图标,显示带有秒表图标和文本源文本"的子部分
  4. ALT + 单击秒表图标,您将在其下方看到另一个部分,其中包含文本表达式源文本"
  5. 将其值指定为thisLayer.name"
  6. 点击文件>另存为>另存为xml
  7. 这将为您创建一个 aepx 文件.
  8. 在任何文本编辑器中打开 aepx 文件并搜索您要修改的文本.确认它在附加的示例 aepx 图像中看起来像.以下是我们在上述步骤中通过 AfterEffects 创建的表达式行thisLayer.name".
  9. 现在将文本这是要更改的文本"更改为您想要的任何内容,
  10. 渲染并检查.如果一切正常,则必须对其进行更改.

附加图片:

  1. After Effects 设置表达式的步骤
  2. 示例 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:

  1. Open the project in AfterEffects
  2. Go to Text layer you wish to modify
  3. Click arrow icon which shows a sub section with a stopwatch icon and the text "Source Text"
  4. ALT + click the stopwatch icon, you will see another section underneath it with text "Expression Source Text"
  5. Give its value as "thisLayer.name"
  6. Click File > Save as > Save as xml
  7. This will create you a aepx file.
  8. 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.
  9. Now change the text "This is the text to be changed" to whatever you wish,
  10. Render and check. If all ok then it must be changed.

Attached images:

  1. After Effects steps to setup expression
  2. Sample aepx glimpse.

这篇关于以编程方式更改 aepx 文件中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆