Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

PF_PathVertexInfo data not updating every frame

Community Beginner ,
Jun 02, 2018 Jun 02, 2018

Hi, I have inserted the following code in the Render function of the PathMaster effect example. When i apply the effect to a text layer and animate the position of the text layer I expect the pathVertexInfo to update on every frame of the animation, however it just shows the vert info at frame 0 or the vert info at the last frame of the animation, no in between. I've tried various combinations of checking in and out the shapes and disposing text outlines. I've also tried putting current_time into the A_Time parameter (not sure what it's meant to represent). Not sure what else to try. Any suggestions would be appreciated.

AEGP_LayerH layerH;

const A_Time GG_time{ 0 ,1};

A_long GGtime_step = in_data->time_step;

A_u_long GGtime_scale = in_data->time_scale;

A_long GGwhat_time = in_data->current_time;

AEGP_TextOutlinesH GGTextOutlines;

PF_PathOutlinePtr GGPathPointer;

PF_ProgPtr GGEffectRef = in_data->effect_ref;

PF_PathVertex GGvertexP;

PF_PathID GGUniqueIDP = NULL;

ERR(suites.PFInterfaceSuite1()->AEGP_GetEffectLayer(in_data->effect_ref, &layerH));

ERR(suites.TextLayerSuite1()->AEGP_GetNewTextOutlines(layerH, &GG_time, &GGTextOutlines));

ERR(suites.TextLayerSuite1()->AEGP_GetIndexedTextOutline(GGTextOutlines, 0, &GGPathPointer));

ERR(suites.PathQuerySuite1()->PF_CheckoutPath(

GGEffectRef,

0,

GGwhat_time,

GGtime_step,

GGtime_scale,

&GGPathPointer));

ERR(suites.PathDataSuite1()->PF_PathVertexInfo(GGEffectRef, GGPathPointer, 0, &GGvertexP));

ERR(suites.PathQuerySuite1()->PF_CheckinPath(

GGEffectRef,

GGUniqueIDP,

FALSE,

GGPathPointer));

//ERR(suites.TextLayerSuite1()->AEGP_DisposeTextOutlines(GGTextOutlines));

TOPICS
SDK
665
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jun 07, 2018 Jun 07, 2018

I solved the problem by changing the integers in  GG_time to current_time and time_scale with time_scale. It now works as intended.

Translate
Enthusiast ,
Jun 04, 2018 Jun 04, 2018

Hi,

your code looks correct... I don't think the problem is here.

Is your mask animated? From what you describe, I would say no.

So, PF_PathVertexInfo probably gives you the path at the right time (which is the same value than at time 0), but you seem to expect the path + the position at local time.

In that case, you should get the layer matrix and multiply the path info with the matrix.

Hope it helps,

François

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 04, 2018 Jun 04, 2018

Hi François, thanks for your reply.

The only animated property is the position of the text layer.

I was expecting the PF_PathVertexInfo to give me the updated positions of a vertex on a text outline every frame (taking into account the new position of the text layer as it is animated). If I apply PF_PathVertexInfo to a checked out mask it gives me this information, so I expected the same for a text outline vertex.

Having investigated more thoroughly, PF_PathVertexInfo, when applied to a text outline vertex seems to give me the position value at the final keyframe no matter what frame I set the current time indicator to in AE. Why would it give me the value at the final keyframe?

The AE SDK help document states:

"the AEGP_TextLayerSuite provides access to the actual outlines of the text used by text layers. One(sic) you have a xxx(sic), you can

manipulate it with PF_PathQuerySuite and PF_PathDataSuite ."

I don't believe that you can use PF_PathQuerySuite to manipulate textOutlines, since "This suite is used to identify and access (check out) the paths associated with the effect’s source layer" (AE SDK help doc). But PF_PathVertexInfo is valid for outlines belonging to any specified text layer.

So it seems PF_CheckoutPath is not intended to be deployed on textOutlines. Further investigation seems to corroborate this  suggesting it just accesses masks applied to the effect layer when given an index.

So I think I can remove this from my code. I then have the following shorter code which is nice, but still no convenient way to get the current position of the moving vertex. Perhaps, as suggested, there is none. Any further insights on this (or corrections) would be gratefully received.

AEGP_LayerH layerH;

const A_Time GG_time{ 0 ,1};

AEGP_TextOutlinesH GGTextOutlines;

PF_PathOutlinePtr GGPathPointer;

PF_ProgPtr GGEffectRef = in_data->effect_ref;

PF_PathVertex GGvertexP;

ERR(suites.PFInterfaceSuite1()->AEGP_GetEffectLayer(in_data->effect_ref, &layerH));

ERR(suites.TextLayerSuite1()->AEGP_GetNewTextOutlines(layerH, &GG_time, &GGTextOutlines));

ERR(suites.TextLayerSuite1()->AEGP_GetIndexedTextOutline(GGTextOutlines, 0, &GGPathPointer));

ERR(suites.PathDataSuite1()->PF_PathVertexInfo(GGEffectRef, GGPathPointer, 0, &GGvertexP));

ERR(suites.TextLayerSuite1()->AEGP_DisposeTextOutlines(GGTextOutlines));

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 07, 2018 Jun 07, 2018
LATEST

I solved the problem by changing the integers in  GG_time to current_time and time_scale with time_scale. It now works as intended.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines