パラメータ監視
監視とは、一部のパラメータの値を他のパラメータの値に基づいて動的に変更することを意味します。パラメータを監視するには、PF_Cmd_PARAM_SETUP 中にパラメータを追加する前に PF_ParamFlag_SUPERVISE を設定します。変更されるたびに PF_Cmd_USER_CHANGED_PARAM が届きます。変更されたパラメータの (プラグインのパラメータ配列への) インデックスは、PF_UserChangedParamExtra (追加) パラメータで送信されます。 PF_Cmd_USER_CHANGED_PARAM 中に、パラメーターの値と外観を変更できます。
パラメータ UI の更新
Section titled “パラメータ UI の更新”いずれかのパラメータに PF_ParamFlag_SUPERVISE を設定すると、After Effects は PF_OutFlag_SEND_UPDATE_PARAMS_UI を設定した場合と同様に PF_Cmd_UPDATE_PARAMS_UI を送信します。
PF_Cmd_UPDATE_PARAMS_UI 中には、外観の変更とパラメータの状態の有効化のみが可能です。 PF_ParamUtilSuite3 の PF_UpdateParamUI() を使用して UI を更新し、変更するパラメータの コピー を渡します。オリジナルを変更しないでください。 PF_OutFlag_REFRESH_UI を設定する必要はありません。 PF_UpdateParamUI() がそれを処理します。
パラメータ値の更新
Section titled “パラメータ値の更新”パラメータの値 (UI だけでなく) は、PF_Cmd_USER_CHANGED_PARAM および PF_Cmd_EVENT (PF_Event_DO_CLICK、PF_Event_DRAG、および PF_Event_KEYDOWN) 中に変更できます。 After Effects は、他の時点で行われた変更を受け入れません。
パラメータの 値 (UI だけでなく) を変更する場合は、元のパラメータを変更し、PF_Paramdef.uu.change_flags を PF_ChangeFlag_CHANGED_VALUE に設定します。
この変更により UI も更新され、ユーザーは元に戻すことができます。 PF_ChangeFlag_CHANGED_VALUE はレイヤー パラメーターとしてサポートされていないことに注意してください。
このスイートは、AEGP スイートの使用を必要とせずに、エフェクトプラグインにパラメーター ストリームへのアクセスを提供するために提供されています。これらの機能の少なくとも一部は、いくつかのサードパーティ ホストによって提供されます。これらの関数は、監視パラメータを持つエフェクトの場合に特に便利です。
PF_ParamUtilSuite3
Section titled “PF_ParamUtilSuite3”| Function | Purpose |
|---|---|
PF_UpdateParamUI | PF_UpdateParamUI(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. |
PF_GetCurrentState | PF_GetCurrentState(This API, combined with PF_AreStatesIdentical below, lets you determine if a set of inputs (either layers, other properties, or both) are different between when you first called PF_GetCurrentState and a current call, so it can be used for caching. You can specify a range of time to consider or all of time.Updated in CS6 to add param_index, startPT0, and durationPT0. Pre-defined constants for param_index are as follows:- PF_ParamIndex_CHECK_ALL - check every parameter, including every layer referred to by a layer parameter.- PF_ParamIndex_CHECK_ALL_EXCEPT_LAYER_PARAMS - omit all layers. Pass a specific layer parameter index to include that as the only layer parameter tested.- PF_ParamIndex_CHECK_ALL_HONOR_EXCLUDE - Similar to CHECK_ALL, but honor PF_ParamFlag_EXCLUDE_FROM_HAVE_INPUTS_CHANGED.Passing in NULL for both start and duration indicates all time. For effects that do simulation across time and therefore set PF_OutFlag2_AUTOMATIC_WIDE_TIME_INPUT, when you ask about a time range, it will be expanded to include any times needed to produce that range.Populates a PF_State, an opaque data type used as a receipt for the current state of the effect’s parameters (the PF_State is used in our internal frame caching database). |
PF_AreStatesIdentical | PF_AreStatesIdentical(New in CS6. Compare two different states, retrieved using PF_GetCurrentState, above. |
PF_HasParamChanged | No longer supported in PFParamUtilsSuite3.PF_HasParamChanged(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 PF_HaveInputsChangedOverTimeSpan below instead.Pre-defined constants for param_index are as follows:- PF_ParamIndex_CHECK_ALL - check every parameter, including every layer referred to by a layer parameter.- PF_ParamIndex_CHECK_ALL_EXCEPT_LAYER_PARAMS - omit all layers. Pass a specific layer parameter index to include that as the only layer parameter tested. |
PF_HaveInputsChangedOverTimeSpan | No longer supported in PFParamUtilsSuite3. Use PF_AreStatesIdentical() instead. |
PF_IsIdenticalCheckout | PF_IsIdenticalCheckout(Returns TRUE if a parameter’s value is the same at the two passed times. Note: the times need not be contiguous; there could be different intervening values. |
PF_FindKeyframeTime | PF_FindKeyframeTime(Searches (in the specified direction) for the next keyframe in the parameter’s stream. The last three parameters are optional. |
PF_GetKeyframeCount | PF_GetKeyframeCount(Returns the number of keyframes in the parameter’s stream. |
PF_CheckoutKeyframe | PF_CheckoutKeyframe(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. |
PF_CheckinKeyframe | PF_CheckinKeyframe(All calls to PF_CheckoutKeyframe must be balanced with this check-in, or pain will ensue. |
PF_KeyIndexToTime | PF_KeyIndexToTime(Returns the time (and timescale) of the specified keyframe. |