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

No motion blur on scale attribute calculated with expression

Contributor ,
Mar 01, 2023 Mar 01, 2023

Copy link to clipboard

Copied

I have a footage layer with the scale calculated using an expression. As it stands the expression makes for a 200% zoom over just 12 frames. Motion blur is set to ON for both the layer and global settings, however the scale-up results in no motion blur at all. 

 

For resting purposes, removing the expression, and manually baking-in a 200% zoom over 12 frames, corrects the problem. All of a sudden there is motion blur. 

 

Would love to get this working with the expression. 

 

Any one have any ideas or advice?

TOPICS
Error or problem , Expressions

Views

720

Translate

Translate

Report

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 1 Correct answer

Community Expert , Mar 02, 2023 Mar 02, 2023

My guess is that your Current Frame slider is giving you a stepped result, like you would get if it was driven by an expression like this:

timeToFrames(time)

If you instead drive it with continuous values (like keyframing from 0 to 12) you should see the motion blur.

Votes

Translate

Translate
Community Expert ,
Mar 01, 2023 Mar 01, 2023

Copy link to clipboard

Copied

What's the expression?

Votes

Translate

Translate

Report

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 ,
Mar 02, 2023 Mar 02, 2023

Copy link to clipboard

Copied

Code here: 

currentFrame = thisComp.layer("vars").effect("Current Frame")("Slider");
totalFrames = thisComp.layer("vars").effect("Zoom Duration (Frames)")("Slider");
t = currentFrame/totalFrames; // time

A = 100; // starting scale
finalScale = A + thisComp.layer("vars").effect("Zoom Amount")("Slider");
B = finalScale; // ending scale
C = finalScale; // ending scale

s = (1-t)*(1-t)*A + (2*(1-t)*t*B) + (t*t*C); // hard coded easy ease math

if (currentFrame >= totalFrames) {
	result = [finalScale,finalScale];
} else {
	result = [s,s];
}
result;

Votes

Translate

Translate

Report

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 02, 2023 Mar 02, 2023

Copy link to clipboard

Copied

My guess is that your Current Frame slider is giving you a stepped result, like you would get if it was driven by an expression like this:

timeToFrames(time)

If you instead drive it with continuous values (like keyframing from 0 to 12) you should see the motion blur.

Votes

Translate

Translate

Report

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 ,
Mar 02, 2023 Mar 02, 2023

Copy link to clipboard

Copied

You're right! And I got motion blur working now.

 

I think the issue is that my expression did not use the built-in time variable at all, which I imagine motion blur needs in order to render. 

 

Curious to learn more on "stepped results" if you have a resource. Bascially how AE makes that distinction. 

 

Thanks for your help.

Votes

Translate

Translate

Report

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 02, 2023 Mar 02, 2023

Copy link to clipboard

Copied

LATEST

No resource in particular, but you can look at various expressions applied to a slider in the graph editor. timeToFrames(time), for example, will show a very distinct stair-step result, where time shows a smooth line.

Votes

Translate

Translate

Report

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
LEGEND ,
Mar 01, 2023 Mar 01, 2023

Copy link to clipboard

Copied

Yeah, we need to see the code. Sounds like you are simply quantizing the value steps somehow, in which case of course there would be no motion blur.

 

Mylenium

Votes

Translate

Translate

Report

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 ,
Mar 02, 2023 Mar 02, 2023

Copy link to clipboard

Copied

Sure here's the code:

currentFrame = thisComp.layer("vars").effect("Current Frame")("Slider");
totalFrames = thisComp.layer("vars").effect("Zoom Duration (Frames)")("Slider");
t = currentFrame/totalFrames; // time

A = 100; // starting scale
finalScale = A + thisComp.layer("vars").effect("Zoom Amount")("Slider");
B = finalScale; // ending scale
C = finalScale; // ending scale

s = (1-t)*(1-t)*A + (2*(1-t)*t*B) + (t*t*C); // hard coded easy ease math

if (currentFrame >= totalFrames) {
	result = [finalScale,finalScale];
} else {
	result = [s,s];
}
result;

 

Votes

Translate

Translate

Report

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