Skip to content

パスの扱い

パスは、その値に直接アクセスできないという点で、他のパラメーター タイプとは異なります。チェックアウトおよびチェックイン (レイヤー パラメーターなど) に加えて、パス データ関数スイートを使用して、特定の時点でのパスの詳細を取得する必要があります。 PF_PathQuerySuite1 および PF_PathDataSuite を参照してください。パス パラメーターが渡されたときに、最初にチェックアウトせずに、その値を決して使用しないでください。削除されたパスは利用できなくなりますが、さらなる更新は「遅れて」 (後で) 行われます。パスをチェックアウトしない限り、エフェクトにはこれらの変更が表示されません。


AEGP_MaskOutlineSuite3 を使用してパスを操作することもできます。 Cheating Effect Usage of AEGP Suitesを参照してください。パス パラメーターは、データの不透明な塊として扱われます。これらにアクセスして操作するには、get 関数と set 関数を使用する必要があります。レイヤー パラメータと同様に、それらにアクセスするエフェクトによってチェックアウト (およびチェックイン) する必要があります。


パスの頂点は単純な点よりも複雑です。すべてのメンバー変数は PF_FpLong (double) であり、レイヤーの座標空間内にあります。


メンバー説明
x頂点の位置。
y
tan_in_x入ってくる接点。
tan_in_y
tan_out_x出方向の接点。
tan_out_y

このスイートは、パス (頂点のシーケンス) に関する情報を提供します。

FunctionDescription
PF_PathIsOpenReturns TRUE if the path is not closed (if the beginning and end vertex are not identical).

PF_PathIsOpen(
PF_ProgPtr effect_ref0,
PF_PathOutlinePtr pathP,
PF_Boolean *openPB);
PF_PathNumSegmentsRetrieves the number of segments in the path.
N segments means there are segments [0.N-1]; segment J is defined by vertex J and J+1.

PF_PathNumSegments(
PF_ProgPtr effect_ref0,
PF_PathOutlinePtr pathP,
A_long *num_segmentsPL);
PF_PathVertexInfoRetrieves the PF_PathVertex for the specified path.

The range of points is [0.num_segments]; for closed paths, vertex[0] == vertex[num_segments].

PF_PathVertexInfo(
PF_ProgPtr effect_ref0,
PF_PathOutlinePtr pathP,
A_long which_pointL,
PF_PathVertex *vertexP);
PF_PathPrepareSegLengthThis fairly counter-intuitive function informs After Effects that you’re going to ask for the length of a segment (using PF_PathGetSegLength below), and it’d better get ready.

frequencyL indicates how many times you’d like us to sample the length; our internal effects use 100.

PF_PathPrepareSegLength(
PF_ProgPtr effect_ref0,
PF_PathOutlinePtr pathP,
A_long which_segL,
A_long frequencyL,
PF_PathSegPrepPtr *lengthPrepPP);
PF_PathGetSegLengthRetrieves the length of the given segment.

PF_PathGetSegLength(
PF_ProgPtr effect_ref0,
PF_PathOutlinePtr pathP,
A_long which_segL,
PF_PathSegPrepPtr *lengthPrepP0,
PF_FpLong *lengthPF);
PF_PathEvalSegLengthRetrieves the location of a point lengthF along the given path segment.

PF_PathEvalSegLength(
PF_ProgPtr effect_ref0,
PF_PathOutlinePtr pathP,
PF_PathSegPrepPtr *lengthPrepPP0,
A_long which_segL,
PF_FpLong lengthF,
PF_FpLong *x,
PF_FpLong *y);
PF_PathEvalSegLengthDeriv1Retrieves the location, and the first derivative, of a point lengthF along the given path segment.

If you’re not sure why you’d ever need this, don’t use it. Math is hard.

PF_PathEvalSegLengthDeriv1(
PF_ProgPtr effect_ref0,
PF_PathOutlinePtr pathP,
PF_PathSegPrepPtr *lengthPrepPP0,
A_long which_segL,
PF_FpLong lengthF,
PF_FpLong *x,
PF_FpLong *y,
PF_FpLong *deriv1x,
PF_FpLong *deriv1y);
PF_PathCleanupSegLengthCall this when you’re finished evaluating that segment length, so After Effects can properly clean up the PF_PathSegPrepPtr.

PF_PathCleanupSegLength(
PF_ProgPtr effect_ref0,
PF_PathOutlinePtr pathP,
A_long which_segL,
PF_PathSegPrepPtr *lengthPrepPP);
PF_PathIsInvertedReturns TRUE if the path is inverted.

PF_PathIsInverted(
PF_ProgPtr effect_ref,
PF_PathID unique_id,
PF_Boolean *invertedB);
PF_PathGetMaskModeRetrieves the mode for the given path.

PF_PathGetMaskMode(
PF_ProgPtr effect_ref,
PF_PathID unique_id,
PF_MaskMode *modeP);


Mask mode is one of the following:

- PF_MaskMode_NONE
- PF_MaskMode_ADD
- PF_MaskMode_SUBTRACT
- PF_MaskMode_INTERSECT
- PF_MaskMode_LIGHTEN
- PF_MaskMode_DARKEN
- PF_MaskMode_DIFFERENCE
- PF_MaskMode_ACCUM
PF_PathGetNameRetrieves the name of the path (up to PF_MAX_PATH_NAME_LEN long).

PF_PathGetName(
PF_ProgPtr effect_ref,
PF_PathID unique_id,
A_char *nameZ);

This suite is used to identify and access the paths associated with the effect’s source layer.

FunctionPurpose
PF_NumPathsRetrieves the number of paths associated with the effect’s source layer.

PF_NumPaths(
PF_ProgPtr effect_ref,
A_long *num_pathsPL);
PF_PathInfoRetrieves the PF_PathID for the specified path.

PF_PathInfo(
PF_ProgPtr effect_ref,
A_long indexL,
PF_PathID *unique_idP);
PF_CheckoutPathAcquires the PF_PathOutlinePtr for the path at the specified time.

PF_CheckoutPath(
PF_ProgPtr effect_ref,
PF_PathID unique_id,
A_long what_time,
A_long time_step,
A_u_long time_scale,
PF_PathOutlinePtr *pathPP);
PF_CheckinPathReleases the path back to After Effects. Always do this, regardless of any error conditions encountered.

Every checkout must be balanced by a checkin, or pain will ensue.

PF_CheckinPath(
PF_ProgPtr effect_ref,
PF_PathID unique_id,
PF_Boolean changedB,
PF_PathOutlinePtr pathP);