Skip to main content
babichfx
Inspiring
Jul 19, 2024 10:14 AM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
James Whiffin
James WhiffinCorrect answer
Legend
Jul 20, 2024 3:55 AM UTC

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 🙂 

3 replies

babichfx
babichfxAuthor
Inspiring
Jul 19, 2024 12:08 PM UTC

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

Translate
babichfx
babichfxAuthor
Inspiring
Jul 19, 2024 12:15 PM UTC

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!?

Translate
James Whiffin
James WhiffinCorrect answer
Legend
Jul 20, 2024 3:55 AM UTC

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 🙂 

Translate