Tutorial 196: Better Forklift

Joe Clay | Oct 11, 2019

Before watching this one, make sure you've seen Part 1! Again, Master Properties in After Effects enable us to make complex rigs. This week, instead of building our forklift in Affinity, we built a model in C4D. I built the initial model and lighting setup, and Sev set it up with Redshift lights for a clay render, and built puzzle mattes so that we could color our objects. By rendering a greyscale version, we can use the overlay blend mode to add both highlights and shadows. So essentially, we've separated our lighting from our colors so we can tweak colors pretty heavily in AE, as you have probably seen by the thumbnail.

In this particular setup, we'll take a look at adding in renders that contain motion—our wheels and tires in this case—as well as adding in keyframed shape animation that we tie to sliders for hydraulic lines on our forklift and shadows for the cab and forks. The fork shadow is pretty cool as it gets softer and then disappears as the forks are raised.

At the end, we also go over a bug I found in master properties. Although I can't figure out how to reproduce it. The gist of it is that sometimes if you add new controls—and I think it's especially likely if you reorder them as this has happened to me before—sometimes After Effects will bug out and the controls may stop working entirely, or one control will actually change another control in your setup. But there will also not be any feedback that it's changed something else. So they can invisibly affect each other. So keep an eye out for that. To fix it, you basically have to start a new comp and add properties to a new Essential Graphics Template.

So this will probably conclude our rigging tutorials for now, but I wouldn't close the book on it just yet.

Expression Code

Make sure to add all of the controls as necessary!

Retime an image sequence to an angle control

f = thisComp.layer("Controller").effect("Wheel Rotation")("Angle") % 60;
if(f < 0) {
    f += 60;
}
f /= 2;
f * thisComp.frameDuration;

Note: we used a 30 frame sequence to make up 60 degrees of travel. So instead of 1 degree per frame—which is what we'd normally render—we did 2 degrees of movement per frame.

Animate a keyframed path from 0-1 second to match a slider

lift = thisComp.layer("Controller").effect("Lift")("Slider")/100;
thisProperty.valueAtTime(lift);

Our slider is intended to go from 0-100 so mapping it from 0-1 second is easy. While AE can interpolate pretty well, you might need to extend that. Just keep in mind value at time is in seconds.

Animate a keyframed path from 0-4 seconds to match a slider

lift = thisComp.layer("Controller").effect("Lift")("Slider");
t = linear(lift, 0, 900, 0, 4);
thisProperty.valueAtTime(t);

The other expressions shown are variations of the above, and are going to change depending upon what you're building. And that's it for now!

Grab the Project Files

The best way to get our project files is to become a patron on Patreon. For $5 a month, you get access to all of the tutorial project files we've made available as well as other monthly projects, rigs, R&D, elements, early product previews, and BTS content not available anywhere else! You can also purchase just this project file on our Gumroad Store if you would rather do that.

Get access to all of our project files on Patreon or Get this single project file on Gumroad

Workbench tools are used by designers at hundreds of amazing companies