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

Motion Blur implementation

Explorer ,
Mar 15, 2025 Mar 15, 2025

Hi everyone. Trying to figure out how to implement motion blur for my plugin. In a nutshell, exactly what code I would need would be CC Force Motion Blur. I don't really at all understand how concept of motion blur should work, so any help would be much appreciated. Even better, code example would be great. My plugin mostly uses transform_world. Thanks!

TOPICS
SDK
310
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
Community Expert ,
Mar 15, 2025 Mar 15, 2025

usually, motion blur is an average of the full render of multiple time samples. meaning, between the time of frame 1 and the time of frame 2, you make multiple renders at times 1.0, 1.1, 1.2, 1.3 ect... and then add up each corrsponding pixel from each time sample render and divide by the number of time samples.

that's what AE does whe you activate motion blur on a layer. that's why you select the number of samples. the more samples, the smoother the result (but lower the render). by adjusting the "shutter angle" you tell AE what's the time span of these samples. 180 = from 1.0 to 1.5, and 360 = from 1.0 to 2.0.

 

some software (such as lightwave 3d) did a "deithered" moion blur, where each pixel comes from a slightly different point in time. the result is a "noisy" blur, but it's much faster than rendering the whole frame multiple times.

 

more advanced blurs such as re::vision's notion blur effect AE does on footage, is actually much like an mp4 works. the image is bobarded by a TON of trackes, and "smearing" each segment to where it's going to move int he next frame.

 

that's it in a nutshell. most implementations use the first method of rendering full frames at multiple time samples. users are accustomed to having significantly longer render times when motion blur is activaed.

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
Explorer ,
Mar 15, 2025 Mar 15, 2025

what would we do without @shachar carmi on this forum 🙂

 

So, just few questions to make sure. There is no motion blur implementation within adobe ae sdk, I have to implement it my self, right?

What I'm a bit confused, looking at some forum posts here, is if using transform_world, it should use 2 matricies (in an array) so it should be:

			ERR(in_data->utils->transform_world(in_data->effect_ref,
				in_data->quality,
				PF_MF_Alpha_STRAIGHT,
				in_data->field,
				input,
				&composite_mode,
				NULL,
				matrix,
				2L,
				FALSE,
				&output->extent_hint,
				output));

 

What this gives me is clones (8 or 16, not sure now) between matrix[0] and matrix[1], but how do I determine positions in time?

 

Sorry if it's a bit noobie question, but it's a bit confusing for me. Bascially, my plugin (via smartfx), takes input layer, via dropdown UI, in prerrender, and then in smart render uses transform_world to clone that layer. Of course, this is simplified, but that's what plugin does in a nutshell. It's kind of finished, but lacking motion blur. 

So, where/how do I implement motion blur? Thank you so much for taking your time and explaining these very tough subjects!

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
Community Expert ,
Mar 15, 2025 Mar 15, 2025

transform_world does indeed offer motion blur via the api. not some much a "general" motion blur for the entire api, but rather just for that one callback.

anyways, given or more matrices, transform_world will to a linear interpolation between the matrices and render multiple intances along that polygonal path. if a straight a to b motion blur path is good enough for you, then a "beginning" and an "end" matrices should be enough. if you need a more "curved" motion blur, then create several intermediate matrices breaking the path down to smaller linear segments giving a more "bezier" look.

 

as for the syntax of placing multiple matrices instead of 1... if i recall correctly, instead of "&matrix" put "(&matrix1, &matrix2)".

i never used more than two, so i guess we're all relying on you telling us if using more is just as simple as adding more mtrices to the parenthesis...

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
Explorer ,
Mar 15, 2025 Mar 15, 2025

Thanks! And just one more question, maybe I'm missing something obvious, but if I have, matrix2 positions defined (current one), how do I calculate previous (matrix1) which I then use in array in transform_world matrix?

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
Community Expert ,
Mar 15, 2025 Mar 15, 2025

i'm guessing you constructed the original matrix somehow. you fed it some position, rotation and scale values.

so you do the same for the other matrix, with position rotation and scale values representing the moment in time you want the motion blur to stretch to.

 

if you didn't construct the matrix and got it ready made by some other means... you could either multiply it a a new matrix represnting the change from one position to the other, or you could decompose the original matrix to get the original position scale and rotation. that, however, is not reliable as a matrix can have more than one valid decomposition...

 

if you got a ready made matrix by some call to AE that fetches the layer matrix, perhaps you could get the second matrix using the same call with a different time value.

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
Explorer ,
Mar 15, 2025 Mar 15, 2025

it is not actualy my matrix implementation, but I can copy paste example from shifter.cpp

      float_matrix.mat[0][0] = float_matrix.mat[1][1] = float_matrix.mat[2][2] = 1;
      float_matrix.mat[2][0] = 1; // This is the x translation
      float_matrix.mat[2][1] = FIX2INT(params[SHIFT_DISPLACE]->u.td.y_value); // This is the y translation
So, user chooses with UI position of matrix. I hope that gives a bit more insight....
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
Community Beginner ,
Mar 15, 2025 Mar 15, 2025

To implement motion blur in your After Effects plugin like CC Force Motion Blur, you need to analyze frame-to-frame pixel movement and apply directional blur based on motion vectors. This involves calculating object displacement over time, then using that data to blur elements according to their movement. Key parameters include Shutter Angle (controls blur intensity) and Motion Blur Samples (determines quality). Your plugin should allow users to adjust these settings for flexibility. The effect enhances animations by making motion appear smoother and more natural, especially for layers that don’t support native motion blur.

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
Explorer ,
Mar 15, 2025 Mar 15, 2025
LATEST

Aha, this is then something different and more complicated. I guess I will stay away from this :D, but thanks for your reply. 

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