Skip to content

UIコールバック

After Effects は、推測や OS に直接問い合わせることなく、座標系間で転置し、描画コンテキストに関する OS 固有の情報を取得するためのコールバックを提供します。これらのコールバックを使用してください。これらのコールバックへのポインタは、PF_EventCallbacks で提供されます。これらのルーチンにアクセスするには、AE_EffectUI.h および AE_EffectCB.h のマクロを使用します。

座標系転置コールバックを実装せずに、カスタム UI を利用する機能するプラグインを構築することができます。ただし、ユーザーがレイヤー パネルにズームインしたり、レイヤーを回転したりすると、プラグインの動作がおかしくなります。これらのマクロとコールバックを追加したことで、開発者にユーザー インターフェイスのオーバーヘッドを与えることなく、カスタム ユーザー インターフェイスを After Effects UI に簡単に統合できるようになりました。またぜひご利用ください!

これらのマクロは、簡略化するために refcon およびコンテキスト ハンドルをデフォルトに設定します。 refcon は、「extra」という名前のローカル変数があることを前提としています。デフォルトのコンテキストは現在のコンテキストです。これらのデフォルト パラメーターは、PF_EventCallbacks 構造体 (AE_EffectUI.h 内) で定義されます。 PF_EventExtra 構造体を通じてコールバックにアクセスすることで、デフォルトをオーバーライドできます。ヘッダー ファイル内のマクロの変更はお勧めしません (またはサポートしません)。やめてください!

FunctionPurpose
layer_to_compTransforms layer panel coordinates to the composition panel coordinates.

PF_Err layer_to_comp (
void *refcon,
PF_ContextH context,
A_long curr_time,
A_long time_scale,
PF_FixedPoint *pt);
comp_to_layerTransforms composition panel coordinates to the layer panel coordinates.

PF_Err comp_to_layer (
void *refcon,
PF_ContextH context,
A_long curr_time,
A_long time_scale,
PF_FixedPoint *pt);
get_comp2layer_xformReturns the matrix used to convert from the composition panel to the layer panel.

If *exists returns FALSE, the matrix cannot be computed because the layer scales to zero.

PF_Err get_comp2layer_xform (
void *refcon,
PF_ContextH context,
A_long curr_time,
long time_scale,
long *exists,
PF_FloatMatrix *comp2layer);
get_layer2comp_xformReturns the transformation matrix used to convert from the layer panel to the composition panel.

This always exists.

PF_Err get_layer2comp_xform (
void *refcon,
PF_ContextH context,
A_long curr_time,
A_long time_scale,
PF_FloatMatrix *layer2comp);
source_to_frameTransforms the source coordinates in the current context to screen coordinates.

Screen (frame) coordinates are affected by the current zoom level.

PF_Err source_to_frame(
void *refcon,
PF_ContextH context,
PF_FixedPoint *pt);
frame_to_sourceTransforms the screen coordinates identified by *pt to the source coordinates of the current context.

PF_Err frame_to_source(
void *refcon,
PF_ContextH context,
PF_FixedPoint *pt);
PF_GET_PLATFORM_DATARetrieves platform-specific data. For plug-ins loaded with localized resource files, PF_PlatData_RES_FILE_PATH will point to the external file, not the plug-in file.

Use PF_PlatData_EXE_FILE_PATH if you want the path of your plug-in.

Starting in CS6, use PF_PlatData_EXE_FILE_PATH_W and PF_PlatData_RES_FILE_PATH_W instead of the old non-wide calls.

PF_Err PF_GET_PLATFORM_DATA (
PF_PlatDataID which,
void *ppData);


PF_PlatDataID can have the following values:

- PF_PlatData_MAIN_WND
- PF_PlatData_EXE_FILE_PATH_DEPRECATED
- PF_PlatData_RES_FILE_PATH_DEPRECATED
- PF_PlatData_RES_REFNUM // macOS
- PF_PlatData_RES_DLLINSTANCE // Win
- PF_PlatData_BUNDLE_REF
- PF_PlatData_EXE_FILE_PATH_W // new CS6
- PF_PlatData_RES_FILE_PATH_W // new CS6