Sair
  • Comunidade global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Motion Blur - Accessing Layer's Transforms

Explorador ,
Mar 26, 2025 Mar 26, 2025

Yo

 

I've been trying for quite some time to make Motion Blur as a normal effect plug-in and I want to ask if it is even possible. Can I access the layer's transforms through a normal effect plug-in? What do I need to use?

 

I wanna make sure if it is possible or not. The only other way is making it an AEGP, right? I would like to avoid that.

TÓPICOS
Como fazer , SDK
6.2K
Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Mar 29, 2025 Mar 29, 2025

you can access any effects param values (anyone's. not only your plugins) using AEGP_GetNewStreamValue.

you get the required streamRefH using AEGP_GetNewEffectStreamByIndex.

you get the required effectRefH using AEGP_GetLayerEffectByIndex.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Mar 29, 2025 Mar 29, 2025

Thanks. I really feel bad for asking so many questions, but trust me when I say that you really helped me. I think I do not have any other question tbh. I'll surely come back and ask if I have tho😭

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Mar 29, 2025 Mar 29, 2025

this is a safe place. (everyone: we love you DKT388448781utv )

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Mar 29, 2025 Mar 29, 2025

Lmao and here I am again.

 

First of all, I managed to get the Motion Blur plugin to work with my plugins. I can make it work with other plugins too, but without their code I can't apply proper blur, I can only assume, so I will make it work only with my plugins.

 

Second of all, I want to ask you how to properly allow a plugin to move the layer outside of the layer bounds. For example, my own Oscillate plugin, when the layer gets outside the layer's boundaries, that part that is outside is basically invisible. How can I make it not be invisible. Basically like in the screenshot.

 

And while I am at it, I wanna ask again how to make the plugins not interact weirdly with each other, I know you answered that question once, but I just wanna be sure and have all the info possible. Yk, like my Exposure plugin changes the layer position when I add my Oscillate plugin, for example.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Mar 29, 2025 Mar 29, 2025

Ye another question. I have a problem with the Motion Blur plugin. I can't get it to properly distinguish between a scale change a position change. When I change the Scale, it detects both a scale change and a Position change. How can I separate them?

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Mar 29, 2025 Mar 29, 2025

Yep, another question. I am bomarding you with questions atp and I am actually sorry for that, but I really want to do this properly.😭

 

Example: I have a plugin called Circular Ripple. When i add it with Oscillate, or Random Displacement (my plugins), it does not follow the center of the layer if I apply it below them (It basically stays in the original layer position). Is it possible to make it follow the center of the layer even if it is below the other effects?

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Mar 30, 2025 Mar 30, 2025

Just letting you know I officially finished my Motion Blur plugin. It works on the layer's transforms and on my plugins too.

Thank you so much for the help man. Would've taken me so long to make it without your help.

 

I still need help with the other questions tho. I really need to make my plugins interact correctly with each other😅.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Apr 01, 2025 Apr 01, 2025

congrats! now please repeat the question that still stands... i cound't figure out which one it was...

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Apr 01, 2025 Apr 01, 2025

Yaayy, shachar is back!!!

 

First of all, please teach me how to properly expand the buffer/make a layer go out of bounds. My current Motion Blur is "trapped" inside the layer's bounds which makes it weird. I tried changing the SmartPreRender according to what the SmartFX documentation says and it just does not work, do I need to change something else too?

 

2nd of all, my plugins interact weirdly. Example:
My Circular Ripple plugin interacts weirdly with my Pinch/Bulge plugin and I can only fix it by moving the Circular Ripple above the Pinch/Bulge, how can I make them interact normally regardless of where I put them? It also interacts weirdly with my transform plugins. When I apply it below, the ripple does not follow the center of the layer, only when I apply it above. Is there something I can do to make them interact normally regardless of their position in the Effects panel?

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Apr 04, 2025 Apr 04, 2025

Nah, honestly I just can't get it to work, I've been trying for 5 days to get distorion effects(like pinch/bulge or wave warp or circular ripple) and blur effects (like directional blur or inner blur) to go out of bounds and it just does not work. The SDK is honestly very confusing, there is nothing that tells you how to handle effects like these, it's easy to make transform effects to get out of bounds, but what about this kind of effects?? 

 

Honestly, without your help, I'll just give up, for my own sanity. Sad that you haven't responded in so long, everything was going so smoothly with your help.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
May 19, 2025 May 19, 2025

the basics are:
during pre-render
max_result_rect: tells AE what the largest possible output size that the current request can produce. for example, if you're doing a 10px radius blur, then the biggest possible result would be the input size + 10px in each direction.

result_rect: i set this to the same value as the input rect. i'm not sure it's necessary during pre-render...

lastly, if indeed the max_result_rect is bigger that the input rect, set:

extra->output->flags |= PF_RenderOutputFlag_RETURNS_EXTRA_PIXELS;
to tell ae buffer expansion is happening.


now during SartRender, AE should hand you and output buffer that is as big as the part max_result_rect that is visible in the comp. meaning, if ther's a mask cropping the large image to a small area, AE will try to optimize and ask your plug-in for just that area (plus some extra margins). same for when the part of the layer is outside the comp view, AE will ask only for the visibe portion (plus some extra margins).

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
May 23, 2025 May 23, 2025

Alright, will try it out.

 

Is there any way to make an effect "track" the center of the layer when it gets moved by other effects? 

 

For example if I have a plugin that makes the layer oscillate and then I apply a Ripple plugin (ofc the ripple will have a center) below the oscillate effect, from what I tested, it does not track the center, only if it is above the oscillate effect it tracks it. Can I somehow make it follow the center of the layer even if I apply it below an effect that moves the layer?

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
May 23, 2025 May 23, 2025

Regarding the "out-of-bounds" thingy. Are you sure the only thing I need to change is the PreRender? Like I also have a custom SampleBilinear function and a DirectionalBlurGeneric function, those are handling the edge cases too.

 

Just expanding the buffer does not work. It's weird tho, because if I create a new world (with its own buffer) and fill it with transparent pixels, it works, but if I just expand the buffer, it doesnt. Maybe I am not expanding it correctly?

static PF_Err
PreRender(
    PF_InData* in_dataP,
    PF_OutData* out_dataP,
    PF_PreRenderExtra* extraP)
{
    PF_Err err = PF_Err_NONE;
    PF_CheckoutResult in_result;
    PF_RenderRequest req = extraP->input->output_request;

    extraP->output->flags |= PF_RenderOutputFlag_GPU_RENDER_POSSIBLE;

    BlurInfo* infoP = reinterpret_cast<BlurInfo*>(malloc(sizeof(BlurInfo)));

    if (infoP) {
        PF_ParamDef strength_param, angle_param;
        AEFX_CLR_STRUCT(strength_param);
        AEFX_CLR_STRUCT(angle_param);

        ERR(PF_CHECKOUT_PARAM(in_dataP, DBLUR_STRENGTH, in_dataP->current_time, in_dataP->time_step, in_dataP->time_scale, &strength_param));
        ERR(PF_CHECKOUT_PARAM(in_dataP, DBLUR_ANGLE, in_dataP->current_time, in_dataP->time_step, in_dataP->time_scale, &angle_param));

        infoP->strength = strength_param.u.fs_d.value;
        infoP->angle = angle_param.u.ad.value / 65536.0f;

        ERR(extraP->cb->checkout_layer(in_dataP->effect_ref,
            DBLUR_INPUT,
            DBLUR_INPUT,
            &req,
            in_dataP->current_time,
            in_dataP->time_step,
            in_dataP->time_scale,
            &in_result));

        float angle_rad = -infoP->angle * PF_RAD_PER_DEGREE;
        float velocity_x = cos(angle_rad) * infoP->strength;
        float velocity_y = -sin(angle_rad) * infoP->strength;

        float width = static_cast<float>(in_dataP->width);
        float height = static_cast<float>(in_dataP->height);
        float adjusted_velocity_x = velocity_x * (width / height);

        float expansion_x = fabs(adjusted_velocity_x) * 100.0f;
        float expansion_y = fabs(velocity_y) * 100.0f;

        PF_Rect expanded_rect = in_result.result_rect;
        expanded_rect.left -= static_cast<A_long>(expansion_x);
        expanded_rect.top -= static_cast<A_long>(expansion_y);
        expanded_rect.right += static_cast<A_long>(expansion_x);
        expanded_rect.bottom += static_cast<A_long>(expansion_y);

        extraP->output->pre_render_data = infoP;
        extraP->output->delete_pre_render_data_func = DisposePreRenderData;

        extraP->output->max_result_rect = expanded_rect;

        extraP->output->result_rect = in_result.result_rect;

        extraP->output->flags |= PF_RenderOutputFlag_RETURNS_EXTRA_PIXELS;

        ERR(PF_CHECKIN_PARAM(in_dataP, &strength_param));
        ERR(PF_CHECKIN_PARAM(in_dataP, &angle_param));
    }
    else {
        err = PF_Err_OUT_OF_MEMORY;
    }
    return err;
}
Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
May 24, 2025 May 24, 2025

it all seems correct to me... nothing caught my eye as being wrong.

i'd like to see some numerical data. what are you getting during prerender for:
1. in_result.result_rect.
2. final values of expanded_rect.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
May 24, 2025 May 24, 2025

Here is what the debug says, its correct, isnt it? Yet the blur does not go out of bounds. 

 

PreRender Debug Information
==========================

Parameters:
  Strength: 0.690000
  Angle: 0.000000 degrees

Buffer Information:
  Width: 1080, Height: 1350

Original in_result.result_rect:
  Left: 0, Top: 0, Right: 1080, Bottom: 1350
  Width: 1080, Height: 1350

Blur Vector Calculations:
  angle_rad: -0.000000 radians
  velocity_x: 0.690000, velocity_y: 0.000000
  adjusted_velocity_x: 0.552000
  expansion_x: 55.199997, expansion_y: 0.000000

Final Rects:
  Expanded rect: Left: -55, Top: 0, Right: 1135, Bottom: 1350
  Expanded rect width: 1190, height: 1350

Output settings:
  output->result_rect: Left: 0, Top: 0, Right: 1080, Bottom: 1350
  output->max_result_rect: Left: -55, Top: 0, Right: 1135, Bottom: 1350
Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
May 24, 2025 May 24, 2025

that too looks correct.

so when these values are set in pre-render, what is the output buffer's size on the render call?

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
May 24, 2025 May 24, 2025

You mean this?

 

SmartRender Debug Information
============================

isGPU: true
Time: Sat May 24 16:46:04 2025

Using pre-render data
checkout_layer_pixels result: 0
Input world details:
  Width: 1080, Height: 1350
  Rowbytes: 17408
  Data pointer: 0000000000000000

checkout_output result: 0
Output world details:
  Width: 1080, Height: 1350
  Rowbytes: 17408
  Data pointer: 0000000000000000

Buffer sizes:
  Input buffer size: 23500800 bytes (22950 KB)
  Output buffer size: 23500800 bytes (22950 KB)

Pixel format: 1094992704
Starting GPU rendering...
GPU rendering result: 0
checkin_layer_pixels result: 0

Final error code: 0

 

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
May 24, 2025 May 24, 2025

is the whole of the exteneded output visable in the comp? if the extra bits are out of the comp bounds AE might be clipping them... try scaling down the layer to 50%, and purge the ram cache. is the output buffer still 1350x1080?

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
May 24, 2025 May 24, 2025

Yes, nothing changed.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
May 31, 2025 May 31, 2025

Yo btw, why are the AEGP samples not working? Like they compile but they don't actually load in AE, you can't use them. Is there any issue with the resource file?

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Jun 09, 2025 Jun 09, 2025

So how am I fixing this bro?

The PreRender expands the buffer but the SmartRender still gets the original values, 1080x1350, what am I doing wrong?

Screenshot 2025-06-10 011246.png

 

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Jun 15, 2025 Jun 15, 2025
MAIS RECENTE
Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Mar 26, 2025 Mar 26, 2025

I don't know if this will help with what you are trying to achive or not, but the third-party plugin ReelSmart Motion Blur by RE:Vision Effects is well known for applying a natural-looking motion blur via an effect as an alternative to the built-in Motion Blur Switch.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Mar 26, 2025 Mar 26, 2025

I know about RSMB, but I want to code my own Motion Blur plugin. Thanks anyway.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines