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

Fail to add new mask vertex

Community Beginner ,
Jul 20, 2014 Jul 20, 2014

Copy link to clipboard

Copied

Hey guys,

  I'm trying to add a mask to my layer using sdk, but I can't get it work right!

  Here's my code,

  AEGP_MaskRefH maskItem;

  A_long maskIndex;

  AEGP_StreamRefH maskStream;

  AEGP_StreamValue2 maskStreamValue;

  AEGP_MaskOutlineValH outlineValue;

  AEGP_VertexIndex vertexIndex = 0;

  ERR(suites.MaskSuite6()->AEGP_CreateNewMask(*layer, &maskItem, &maskIndex));

  ERR(suites.StreamSuite4()->AEGP_GetNewMaskStream(aegp_plugin_id, maskItem, AEGP_MaskStream_OUTLINE, &maskStream));

  A_Time time;

  time.scale = 1;

  time.value = 0;

  ERR(suites.StreamSuite4()->AEGP_GetNewStreamValue(aegp_plugin_id, maskStream, AEGP_LTimeMode_LayerTime, &time, TRUE, &maskStreamValue));

  outlineValue = maskStreamValue.val.mask;

  ERR(suites.MaskOutlineSuite3()->AEGP_CreateVertex(outlineValue, vertexIndex));

  AEGP_MaskVertex newVertex;

  newVertex.x = x;

  newVertex.y = y;

  newVertex.tan_in_x = inX;

  newVertex.tan_in_y = inY;

  newVertex.tan_out_x = outX;

  newVertex.tan_out_y = outY;

  ERR(suites.MaskOutlineSuite3()->AEGP_SetMaskOutlineVertexInfo(outlineValue, vertexIndex, &newVertex));

  ERR(suites.MaskSuite6()->AEGP_DisposeMask(maskItem));// dispose the mask item

  ERR(suites.StreamSuite4()->AEGP_DisposeStreamValue(&maskStreamValue)); // dispose the stream value

  ERR(suites.StreamSuite4()->AEGP_DisposeStream(maskStream)); // dispose the stream

  I did add a new mask to my layer, but there's no vertex on it!

  What I'm doing wrong?

TOPICS
SDK

Views

491

Translate

Translate

Report

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

Enthusiast , Jul 21, 2014 Jul 21, 2014

Hi Zhiqing Li!

You're almost there (I had the same problem...).

Once you've set the MaskOutlineVertices, what you already did, you still need to set the stream value.

So, at line 31:

ERR(suites.StreamSuite4()->AEGP_SetStreamValue( aegp_plugin_id, maskStream, &outlineValue));

Cheers,

François

Votes

Translate

Translate
Enthusiast ,
Jul 21, 2014 Jul 21, 2014

Copy link to clipboard

Copied

Hi Zhiqing Li!

You're almost there (I had the same problem...).

Once you've set the MaskOutlineVertices, what you already did, you still need to set the stream value.

So, at line 31:

ERR(suites.StreamSuite4()->AEGP_SetStreamValue( aegp_plugin_id, maskStream, &outlineValue));

Cheers,

François

Votes

Translate

Translate

Report

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 ,
Jul 21, 2014 Jul 21, 2014

Copy link to clipboard

Copied

LATEST

It's working now!!!! Thanks François!!

Votes

Translate

Translate

Report

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