「这是我参与11月更文挑战的第 26 天,活动详情查看:2021最后一次更文挑战」。
参加该活动的第 43 篇文章
正文
这些消息通信有哪些差别
在 PF_Cmd_USER_CHANGED_PARAM 和 PF_Cmd_UPDATE_PARAMS_UI 之间有细微的差别。
效果需要区分用户是实际更改参数值( PF_Cmd_USER_CHANGED_PARAM )还是只是遍历时间轴( PF_Cmd_UPDATE_PARAMS_UI ),这也是在插件首次加载时发送的)。
只有前几个命令选择器是可预测的; 调用序列的其余部分由用户操作决定。
当第一次应用时,插件接收 PF_Cmd_GLOBAL_SETUP ,然后是 PF_Cmd_PARAM_SETUP 。每次用户向一个层添加效果时,都会发送 PF_Cmd_SEQUENCE_SETUP 。
对于由基础的非 SmartFX 效果渲染的每一帧,After Effects 发送PF_Cmd_FRAME_SETUP,然后是 PF_Cmd_RENDER,然后是PF_Cmd_FRAME_SETDOWN。所有效果插件必须响应 PF_Cmd_RENDER 。
PF_Cmd_SEQUENCE_SETDOWN is sent on exit, when the user removes an effect or closes the project. PF_Cmd_SEQUENCE_RESETUP is sent when a project is loaded or when the layer to which it’s applied changes. PF_Cmd_SEQUENCE_FLATTEN is sent when the After Effects project is written out to disk.
对于 SmartFX, PF_Cmd_SMART_PRE_RENDER 可以被发送任意次数,在单个 PF_Cmd_SMART_RENDER 被发送之前。
PF_Cmd_SEQUENCE_SETDOWN 在退出时发送,当用户删除一个效果或关闭项目时。
PF_Cmd_SEQUENCE_RESETUP 在项目被加载或它所应用的层发生变化时被发送。
PF_Cmd_SEQUENCE_FLATTEN 是在 After Effects 项目写入磁盘时发送的。
PF_Cmd_ABOUT 当用户从效果控制窗口(ECW)中选择 About… 时发送。
PF_Cmd_GLOBAL_SETDOWN 当 After Effects 关闭时或当效果的最后一个实例被删除时发送。不要依赖此消息来确定插件何时从内存中删除; 使用操作系统特定的入口点。
What’s The Difference?
There is a subtle difference between
PF_Cmd_USER_CHANGED_PARAMandPF_Cmd_UPDATE_PARAMS_UI.Effects need to distinguish between the user actually changing a parameter value (
PF_Cmd_USER_CHANGED_PARAM), and just scrubbing around the timeline (PF_Cmd_UPDATE_PARAMS_UI), which is also sent when the plug-in is first loaded).Only the first few command selectors are predictable; the rest of the calling sequence is dictated by user action.
When first applied, a plug-in receives
PF_Cmd_GLOBAL_SETUP, thenPF_Cmd_PARAM_SETUP. Each time the user adds the effect to a layer,PF_Cmd_SEQUENCE_SETUPis sent.For each frame rendered by a basic non-SmartFX effect, After Effects sends
PF_Cmd_FRAME_SETUP, thenPF_Cmd_RENDER, thenPF_Cmd_FRAME_SETDOWN. All effect plug-ins must respond toPF_Cmd_RENDER.For SmartFX,
PF_Cmd_SMART_PRE_RENDERmay be sent any number of times, before a singlePF_Cmd_SMART_RENDERis sent.
PF_Cmd_SEQUENCE_SETDOWNis sent on exit, when the user removes an effect or closes the project.PF_Cmd_SEQUENCE_RESETUPis sent when a project is loaded or when the layer to which it’s applied changes.PF_Cmd_SEQUENCE_FLATTENis sent when the After Effects project is written out to disk.
PF_Cmd_ABOUTis sent when the user chooses About… from the Effect Controls Window (ECW).
PF_Cmd_GLOBAL_SETDOWNis sent when After Effects closes, or when the last instance of the effect is removed. Do not rely on this message to determine when your plug-in is being removed from memory; use OS-specific entry points.