Parameter Supervision¶
Supervision means dynamically changing the values of some parameters based on the values of others. To supervise a parameter, set PF_ParamFlag_SUPERVISE before adding it during PF_Cmd_PARAM_SETUP. Whenever it is changed, you will receive PF_Cmd_USER_CHANGED_PARAM. The index (into the plug-in's parameter array) of the changed parameter is sent in the PF_UserChangedParamExtra (extra) param. During PF_Cmd_USER_CHANGED_PARAM, you may change the values and appearance of any of your parameters.
Updating Parameter UI¶
If you set PF_ParamFlag_SUPERVISE
on any parameter, After Effects will send you PF_Cmd_UPDATE_PARAMS_UI, just as if you had set PF_OutFlag_SEND_UPDATE_PARAMS_UI.
During PF_Cmd_UPDATE_PARAMS_UI, you may only change the appearance and enable state of parameters. Use PF_UpdateParamUI()
from PF_ParamUtilSuite3 to update the UI, passing it a copy of the parameter you wish to modify. Do not attempt to modify the original. It is not necessary to set PF_OutFlag_REFRESH_UI
; PF_UpdateParamUI()
handles that for you.
Note
This is the only way to update the UI of PF_PUI_STD_CONTROL_ONLY
parameters.
Updating Parameter Values¶
A parameter's value (not just UI) can be modified during PF_Cmd_USER_CHANGED_PARAM and during PF_Cmd_EVENT (PF_Event_DO_CLICK, PF_Event_DRAG, & PF_Event_KEYDOWN). After Effects will not honor changes made at other times.
When changing parameter values (and not just the UI), modify the original parameter, and set PF_Paramdef.uu.change_flags
to PF_ChangeFlag_CHANGED_VALUE
.
This change will be also update the UI, and will be undoable by the user. Note that PF_ChangeFlag_CHANGED_VALUE
isn't supported for layer parameters.
This suite is provided to give effect plug-ins some access to their parameter streams, without requiring AEGP suite usage. At least some of these functions are provided by several third-party hosts. These functions are especially handy for effects with supervised parameters.
PF_ParamUtilSuite3¶
Function |
Purpose |
---|---|
|
Force After Effects to refresh the parameter's UI, in the effect controls palette. Starting in CC 2014, After Effects will now honor a change to a custom UI height. Simply change the ui_height of your custom UI PF_ParamDef and then call PF_UpdateParamUI. The effect's custom UI height will be updated in the Effect Control Window. Starting in CS6, when a plug-in disables a parameter, we now save that state in the UI flags so that the plug-in can check that flag in the future to see if it is disabled. Danger Never pass param[0] to this function. |
|
This API, combined with Updated in CS6 to add
Passing in NULL for both start and duration indicates all time. For effects that do simulation across time and therefore set Populates a |
|
New in CS6. Compare two different states, retrieved using |
|
No longer supported in
Given a PF_State, passes back true if any of the tested parameters differ from the saved state. Contrary to the name, the call does not provide a way to test a single parameter. At a minimum, all non-layer parameters will be tested. For finer granularity to test a specific set of parameters, use Pre-defined constants for
|
|
No longer supported in |
|
Returns |
|
Searches (in the specified direction) for the next keyframe in the parameter's stream. The last three parameters are optional. |
|
Returns the number of keyframes in the parameter's stream. |
|
Checks a keyframe for the specified parameter out of our keyframe database. param_index is zero-based. You can request time, timescale, or neither; useful if you're performing your own motion blur. |
|
All calls to PF_CheckoutKeyframe must be balanced with this check-in, or pain will ensue. |
|
Returns the time (and timescale) of the specified keyframe. |