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

SmartFX Expand Layer Bounds - Shifter Example Project

Contributor ,
Nov 21, 2020 Nov 21, 2020

Using SmartFX and expanding on the 'Shifter' Example project, how can I expand the bounds of my square layer here to show the shifted image on top in its entirely, rather than being restricted to the original square? â€ƒ

Screenshot_118.pngexpand image

I know it is something to do with the extra and/or PF_CheckoutResult but cannot pinpoint how by messing with the result_rects!

 

Thanks!

 

TOPICS
SDK
881
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 3 Correct answers

Adobe Employee , Nov 25, 2020 Nov 25, 2020

If you want to go outside the bounds of the original layer to which the effect is applied, you'll need to resize the output buffer; see the (aptly-named) Resizer sample.

Translate
Engaged , Nov 25, 2020 Nov 25, 2020

To expand the buffer in smartFX, in pre render you need to expand the result_rect and max_result_rect and then set the flag 

extra->output->flags = PF_RenderOutputFlag_RETURNS_EXTRA_PIXELS;

Translate
Engaged , Nov 28, 2020 Nov 28, 2020

In my case, I expanded the result_rect, then unioned it with the output rects which also expanded them:

 

PF_Rect expandedRect = in_result.result_rect;

expandedRect.left -= stuffP->innerExpansion.left; // expand by subtracting on the left and top
expandedRect.top -= stuffP->innerExpansion.top;
expandedRect.right += stuffP->innerExpansion.right;
expandedRect.bottom += stuffP->innerExpansion.bottom;

UnionLRect(&expandedRect, &in_result.result_rect);
UnionLRect(&expandedRect, &in_result.max_result_rect);

 

U

...
Translate
Community Expert ,
Nov 22, 2020 Nov 22, 2020

Try applying Grow Bounds before you apply Shifter.

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
Contributor ,
Nov 22, 2020 Nov 22, 2020

Rick, I don't believe there are any example projects or code for that! I'm asking how to do it via the SDK, not applying premade effects.

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
Adobe Employee ,
Nov 25, 2020 Nov 25, 2020

If you want to go outside the bounds of the original layer to which the effect is applied, you'll need to resize the output buffer; see the (aptly-named) Resizer sample.

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
Engaged ,
Nov 25, 2020 Nov 25, 2020

To expand the buffer in smartFX, in pre render you need to expand the result_rect and max_result_rect and then set the flag 

extra->output->flags = PF_RenderOutputFlag_RETURNS_EXTRA_PIXELS;

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
Contributor ,
Nov 28, 2020 Nov 28, 2020

@James Whiffin Which rects are we talking about, the extra or the input? I have tried on the extra and the input in various places in the PreRender(), but I get 'AEGP Magic Error'. Is this the right format? 

Screenshot_123.pngexpand image

 

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
Engaged ,
Nov 28, 2020 Nov 28, 2020

In my case, I expanded the result_rect, then unioned it with the output rects which also expanded them:

 

PF_Rect expandedRect = in_result.result_rect;

expandedRect.left -= stuffP->innerExpansion.left; // expand by subtracting on the left and top
expandedRect.top -= stuffP->innerExpansion.top;
expandedRect.right += stuffP->innerExpansion.right;
expandedRect.bottom += stuffP->innerExpansion.bottom;

UnionLRect(&expandedRect, &in_result.result_rect);
UnionLRect(&expandedRect, &in_result.max_result_rect);

 

UnionLRect(&in_result.result_rect, &extra->output->result_rect);

UnionLRect(&in_result.max_result_rect, &extra->output->max_result_rect);

 

I don't quite understand why your code gave a magic error though.

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
Contributor ,
Nov 16, 2021 Nov 16, 2021
LATEST
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