Skip to main content
Richard Rosenman
Inspiring
May 11, 2022
Answered

How to control motion blur amount when using Transform World?

  • May 11, 2022
  • 1 reply
  • 752 views

Hi gang;

 

Slowly but surely I am getting motion blur to work in my plugin. 

 

I've got it working but it seems to be at a default extreme level. When I compare it to a default layer moved with motion blur, it is much more extreme. Browsing through the SDK I came across this:

Effects handle their own motion blur, using PF_InData>shutter_angle along with PF_InData>shutter_phase. The plug-in must set PF_OutFlag_I_USE_SHUTTER_ANGLE so After Effects knows it needs this information. They must check out their own parameters at other times to examine their change over the shutter interval.

 

I assume shutter_angle and shutter_phase will allow me to control the degree of motion blur. However, there is once again no example anywhere to show how to achieve this or how it works. I took a look at the old CCU example (prior to CS5) but no dice...

 

Can anyone help me out and give me some tips or examples on how to use shutter_angle and shutter_phase? If that is even what I should be using to control the degree of motion blur?

 

Thank you,

-Richard

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

Hi Richard

The amount of motion blur is determined by the difference in the two matrices you used in transform world. If it's based on your params, I use the following code:

 

    // measured as a decimal: 1.0 = 360 degrees or 1024 steps
    PF_FpLong shutterPhaseF     = FIX_2_FLOAT(in_data->shutter_phase);
    PF_FpLong shutterDurationF  = FIX_2_FLOAT(in_data->shutter_angle);
 
    A_long shutterDurationSteps = shutterDurationF * in_data->local_time_step;
    A_long shutterPhaseSteps    = shutterPhaseF * in_data->local_time_step;
    A_long previousTimeStep     = in_data->current_time + shutterPhaseSteps;
    A_long nextTimeStep         = previousTimeStep + shutterDurationSteps;
 
Checkout the motion blurred params at previousTimeStep and nextTimeStep.

1 reply

James Whiffin
James WhiffinCorrect answer
Legend
May 11, 2022

Hi Richard

The amount of motion blur is determined by the difference in the two matrices you used in transform world. If it's based on your params, I use the following code:

 

    // measured as a decimal: 1.0 = 360 degrees or 1024 steps
    PF_FpLong shutterPhaseF     = FIX_2_FLOAT(in_data->shutter_phase);
    PF_FpLong shutterDurationF  = FIX_2_FLOAT(in_data->shutter_angle);
 
    A_long shutterDurationSteps = shutterDurationF * in_data->local_time_step;
    A_long shutterPhaseSteps    = shutterPhaseF * in_data->local_time_step;
    A_long previousTimeStep     = in_data->current_time + shutterPhaseSteps;
    A_long nextTimeStep         = previousTimeStep + shutterDurationSteps;
 
Checkout the motion blurred params at previousTimeStep and nextTimeStep.
Richard Rosenman
Inspiring
May 11, 2022

Hi James!

 

Thank you so much for taking the time to post this and provide an explanation. It helped tremendously and I was able to control the degree of motion blur based on your explanation. 

 

Thanks again!

-Rich

James Whiffin
Legend
May 12, 2022

No worries Richard 🙂