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

Get the project file through our Gumroad Store. This project file contains everything shown in the tutorial. It also includes other elements used in the thumbnail and GIF animation as well as the C4D models used to construct the shape layers—fair warning, the models are slammed together as we tried a lot of things. The After Effects project was built in AE CC 2019 but a version that works in 2018 is included. You might get a notice that you need a plugin or a font, but they aren't required to use this file. They're mainly used for the thumbnail.

If you're buying project files, consider becoming a Patron. At the $5/mo. tier, you get access to project files as they come out and some tutorials also come with additional BTS content showing more of the builds.

Get the project on Gumroad

Become a Patron

If you'd like to help support Workbench, check out our Patreon page. Thank you for even considering clicking this link to support what we're doing. We appreciate it. Patrons get all sorts of benefits, from additional files to early product releases depending upon the tier.

Check out our Patreon Today