Copy link to clipboard
Copied
Greetings,
I have a property that is using a matth expression for the bulk of it's values, based on an input value from another layer, but I actually need to use some manual values that do not follow the expression calculation, so I was wondering how I could add keyframes with those manual values and have the expression, use the keyframe value instead, whenever there is a keyframe value present? Thanks for any help on this 🙂
1 Correct answer
I have no idea if this will affect your motion blur in the way you're hoping for, but on any frame where a keyframe exists, it should give the value of the keyframe, rather than the calculation:
x= effect("PanZoom")("Anchor A")[0]-effect("xOffset")("Slider")+effect("shakeDelta")("Point")[0]*effect("x,y movement factor")("Slider")/100-effect("panDelta")("Point")[0]/2;
y= effect("PanZoom")("Anchor A")[1]-effect("yOffset")("Slider")+effect("shakeDelta")("Point")[1]*effect("x,y movement factor")("Sl
...
Copy link to clipboard
Copied
You can call up a keyframe number and a keyframe value. You'll probably also need to add an if/else statement and maybe even an interpolation method to ease in and out of the keyframe value over time.
You could also set up animations based on markers or layer in and out points, then add an if statement that looked for the nearest keyframe and turned off the expression if there were any keyframes in the property.
To be more specific, I would have to see exactly what you are trying to do.
Copy link to clipboard
Copied
As you want to change the expression value when it reaches a keyframe so I think you want to use (valueAtTime(t)) expression, so try to search for that and you will find a lot of example on how to use this expression
Copy link to clipboard
Copied
Not a problem. Yopu simply use a slider that blends between your slider and your keyframed values as represented by the default "value" keyword. Since the slider itself then can be keyframed, it's easy enough to go back and forth using simple linear() functions or whatever you have in mind. All the same, you could of course fully offshore either the keyframe data or the expression to their own sliders and blend between those as well. Really depends on what you want to do.
Mylenium
Copy link to clipboard
Copied
Hi Mylenium, this "linear" slider function sounds interesting to try. I have not used it before, do you have a reference for either how I might use it, or how to use it in general? Thanks for any additional info.
Copy link to clipboard
Copied
What does the "math expression" look like?
Copy link to clipboard
Copied
It's combining different x,y movements to generate a composite camera panning movement, but since I have my Motion Blur turned ON for the foreground and background layers, the blur gets screwed up on the last frame of each panning section because the very next value starts in a completely different x,y location and AE just smears the blur on the last frame since I can't tell AE that I'm "restarting" my panning motion, so I need to make my last keyframe value just use the same x,y value on the second to last frame of each panning section along the timeline.
var x= effect("PanZoom")("Anchor A")[0]-effect("xOffset")("Slider")+effect("shakeDelta")("Point")[0]*effect("x,y movement factor")("Slider")/100-effect("panDelta")("Point")[0]/2;
var y= effect("PanZoom")("Anchor A")[1]-effect("yOffset")("Slider")+effect("shakeDelta")("Point")[1]*effect("x,y movement factor")("Slider")/100-effect("panDelta")("Point")[1]/2;
[x, y]
Copy link to clipboard
Copied
I have no idea if this will affect your motion blur in the way you're hoping for, but on any frame where a keyframe exists, it should give the value of the keyframe, rather than the calculation:
x= effect("PanZoom")("Anchor A")[0]-effect("xOffset")("Slider")+effect("shakeDelta")("Point")[0]*effect("x,y movement factor")("Slider")/100-effect("panDelta")("Point")[0]/2;
y= effect("PanZoom")("Anchor A")[1]-effect("yOffset")("Slider")+effect("shakeDelta")("Point")[1]*effect("x,y movement factor")("Slider")/100-effect("panDelta")("Point")[1]/2;
val =[x, y]
if (numKeys > 0){
f = timeToFrames(nearestKey(time).time);
if (f == timeToFrames(time)) val = value;
}
val
Copy link to clipboard
Copied
Thanks for this one Dan, it did the trick!!! It eliminated the extreme blur at the last frame frame of each panning frame range.

