Skip to main content
babichfx
Inspiring
July 19, 2024
Answered

sourceRectAtTime like function in SDK, boudaries of shape layers or clipped by mask

  • July 19, 2024
  • 1 reply
  • 356 views

So the question is

How to get the dimentions, boundraies of the particular layer if it dont have a source or was clipped by mask?

 

Here how I get it for AEGP_ObjectType_AV:

 

A_long extraDimetions[2] = {0, 0};
AEGP_ObjectType extraObjectType = AEGP_ObjectType_NONE;
ERR(suites.LayerSuite8()->AEGP_GetLayerObjectType(extraLayerH, &extraObjectType));
if(extraObjectType == AEGP_ObjectType_AV){
AEGP_ItemH extraItem = nullptr;
ERR(suites.LayerSuite8()->AEGP_GetLayerSourceItem(extraLayerH, &extraItem));
if(extraItem != nullptr){
ERR(suites.ItemSuite9()->AEGP_GetItemDimensions(extraItem, &extraDimetions[0], &extraDimetions[1]));
}

 


In another words, how to get the same or similar for AEGP_ObjectType_TEXT and AEGP_ObjectType_VECTOR?

And also how to get the boundaries for masked/clipped layer.

This topic has been closed for replies.
Correct answer James Whiffin

Yes it's a very handy way to get the dimensions of the layer at float precision, even if it doesn't have a mask 🙂 

1 reply

babichfx
babichfxAuthor
Inspiring
July 19, 2024

Seems masked layer dimentions I found:

A_FloatRect masked;
AEGP_LTimeMode tm = AEGP_LTimeMode_CompTime;;
ERR(suites.LayerSuite8()->AEGP_GetLayerMaskedBounds(extraLayerH, tm, &timeCompForCurrentFrame, &masked));

 The shapes dimentions and txt's still relevant

babichfx
babichfxAuthor
Inspiring
July 19, 2024

O! The same works for the shapes too...
And for the fonts...
And for the layers without masks...

Is it a kind of general way to get the boudaries actually!?

James Whiffin
James WhiffinCorrect answer
Legend
July 20, 2024

Yes it's a very handy way to get the dimensions of the layer at float precision, even if it doesn't have a mask 🙂