Tutorial 195: Forklift
Joe Clay | Oct 3, 2019
Master Properties in After Effects enable us to make more complex rigs than we could previously. And because of that, we're going to talk about techniques to rig objects. We start with a simple cube that has some pretty cool behaviors. It can flatten into the ground, which means it comes with its own transition built-in. It can also be scaled without scaling its strokes.
Then we take a look at a rigged forklift. All of the colors have been linked to control layers so you can change the colors of the forklift if you desire. There's an Angle Control that lets us pick between the 4 isometric angles that the forklift can face, even though only two angles were ever illustrated. This is accomplished by scaling our shape layers horizontally to make up the other two angles. While that would normally change our lighting, we've built and rigged luminosity layers—using grey tones and the overlay blend mode—that can swap the lighting back so that the lighting direction doesn't ever change. The forks of the forklift are also rigged so that the main section moves up, and then the rest of the lift sections extend fully.
In short, there's a lot built into this tutorial, and a lot of the techniques are designed to be applicable to all sorts of rigs. For example, one of the expressions shows you how you can build a checkbox that can switch between two keyframes for a property. We use it to change the lighting of the luminosity layers, but you could use to to switch between keyframes on a path, or intensities of an effect. There's a lot of versatility here.
And the best part is that this is only part one. There will at least be a second tutorial, if not a third. The next one will focus on more efficient ways to build this sort of model if you were going to make a whole bunch of different rigs. We're going to show how to take an actual 3D model, render out a minimal amount of frames and yield even more complex animation, versatility, and speed. And there's also something interesting that I want to try, but haven't had a chance to build yet. So please, stay tuned! And if you didn't see Tutorial 188: Isopush, check it out! It's helpful for moving layers in isometric directions.
Expression Code
Make sure to add all of the controls as necessary! If you absolutely want to limit things like the transition slider we used, you can use linear()
or clamp()
. If you use it directly on the slider itself, you can force it to not pass 0 or 100, or whatever arbitrary number you'd like. For example, our Forklift goes up 800 pixels. Instead of building it for percentage, you could build it for pixel values so that you can more easily match other layers to the forklift. You can use an expression like clamp(value, 0, 800)
on the slider to get a slider that only goes from 0-800. There are a lot of possibilities when it comes to rigging with expression controls! Use the expressions below as starting points to build your own rigs!
Scale an object but maintain the stroke width
value/(thisComp.layer("Controller").effect("Scale")("Slider")/100);
Add vertical movement to an object based on percentage
y = thisComp.layer("Controller").effect("Transition")("Slider") * 1.085;
value + [0, y];
Add vertical movement to an object based on percentage after a threshold
y = thisComp.layer("Controller").effect("Lift")("Slider");
y = ease(y, 30, 100, 0, 300);
value - [0, y];
Posterize an Angle Control
a = thisComp.layer("Controller").effect("Angle")("Angle") % 360;
if(a < 0) {
a += 360;
}
a /= 360;
Math.floor(a * 4);
Even Checkbox
if(thisComp.layer("Controller").effect("Side")("Slider") % 2) { 0; } else { 1; }
Upper/Lower Checkbox
i = thisComp.layer("Controller").effect("Side")("Slider");
if(i == 0 || i == 3) { 1; } else { 0; }
Control visibility with a checkbox
thisComp.layer("Controller").effect("Upper")("Checkbox") * 100;
Control visibility with a checkbox (inverted)
(1-thisComp.layer("Controller").effect("Upper")("Checkbox"))*100;
Alternate between keyframes using a checkbox
check = thisComp.layer("Controller").effect("Even")("Checkbox");
thisProperty.valueAtTime(check);
Alternate between keyframes using a checkbox (inverted)
check = Math.abs(1-thisComp.layer("Controller").effect("Even")("Checkbox"));
thisProperty.valueAtTime(check);
And that's it for now! And don't forget to check out part two!
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