Buffer Expansion - SmartFX
- June 10, 2025
- 3 replies
- 712 views
So I modified the Skeleton sample plugin by adding SmartFX and by making it move the layer based on 2 parameters, X and Y, because I want to understand how to make it go out of bounds.
If I set the rects like this:
extra->output->result_rect = in_result.result_rect;
extra->output->max_result_rect = expanded_rect;
Then the expansion is not happening or whatever, because the pixels are clearly still limited by the bounds.
If I set them like this:
extra->output->result_rect = expanded_rect;
extra->output->max_result_rect = expanded_rect;
Then the effect just gets completely bugged and moves the layer to top-left.
What am I missing? I tried so many things...such a sad thing that we don't have a sample plugin in the SDK that shows how to do this.
Here's my currect PreRender btw:
static PF_Err
PreRender(
PF_InData* in_data,
PF_OutData* out_data,
PF_PreRenderExtra* extra)
{
PF_Err err = PF_Err_NONE;
PF_RenderRequest req = extra->input->output_request;
PF_CheckoutResult in_result;
ERR(extra->cb->checkout_layer(in_data->effect_ref,
SKELETON_INPUT,
SKELETON_INPUT,
&req,
in_data->current_time,
in_data->time_step,
in_data->time_scale,
&in_result));
PF_LRect expanded_rect = in_result.result_rect;
expanded_rect.left -= 200;
expanded_rect.top -= 200;
expanded_rect.right += 200;
expanded_rect.bottom += 200;
extra->output->result_rect = in_result.result_rect;
extra->output->max_result_rect = expanded_rect;
extra->output->flags |= PF_RenderOutputFlag_RETURNS_EXTRA_PIXELS;
return err;
}