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?
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.
Copy link to clipboard
Copied
What's the expression?
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;
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.
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.
Copy link to clipboard
Copied
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.
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
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;