How to set the ending or starting keyframe value in an Expression Control in After Effects?

To set ending keyframe value:

[code]

if (numKeys > 1){
newV2 = comp(“DECAY”).layer(“Grass Controls”).effect(“Wind Speed”)(“Angle”);
v1 = valueAtTime(key(1).time);
v2 = valueAtTime(key(2).time);
linear(value,v1,v2,v1,newV2);
}else{
value
}

[/code]

 

To set starting keyframe value:

[code]

if (numKeys > 1){
newV2 = comp(“DECAY”).layer(“Grass Controls”).effect(“Wind Speed”)(“Angle”);
v1 = valueAtTime(key(1).time);
v2 = valueAtTime(key(2).time);
linear(value,v2,v1,newV2,v1);
}else{
value
}

[/code]

 

Reference:

Expression to Control a Single Keyframe’s value

How to quickly do a surface tracking and adding a picture onto the surface in After Effects using Mocha and planar tracking with corner pins?

  1. Track the surface as usual like tracking an area.
  2. Turn on planar tracking and draw and track the planes.
  3. Switch to the AdjustTracker tab in Mocha to work on the planar plane, this would create keyframes like the usual motion tracking. (See video below)
  4. When all the motion tracking, and planar plane tracking is close and correct, save and close Mocha.
  5. Back in AE, create a new composition of the same shape as the current video composition. So if it’s a wide-screen 1920×1080 video (parent comp), then create a new comp of 1920×1080 (surface comp).
  6. Add the picture to overlay in the surface comp, you can distort the shape to fill up the whole comp.
  7. Now add the surface comp into parent comp.
  8. Select the layer/surface you tracked in Step 1.
  9. In the Mocha effect, select Tracking data > Export Option > Corner Pin (support motion blur)
  10. Select the “surface comp” layer, in “Layer Export to”, and hit “Apply Export”

 

That’s it!

 

See: