Ae

Spinning Tumbler Box

Intermediate

Want to add some spin to your motion graphics? Let’s create a box you can easily customise.

Setting up the Composition for the sides of our box

Starting in a new After Effects project, we’re going to create a new composition. This will be our “text” composition, and the dimensions of it will be the dimensions of one side of our box.

We’ll set the Width to 1000px and the Height 300px, and change the Duration to being only 10 frames long. Each frame will present as one side of our box.

Next we’ll create the background by going to the Layer menu, and adding a New Solid.

Then we will grab the text tool to add in the Text Layer that will be the words that we show on the side of the box. Click in the middle and position it into the centre of the composition (you can use the align panel to help with this).

Now we want the text to be different each frame, so toggling the options on the Text Layer until we see Source Text, we can click on the stopwatch to create a keyframe. The keyframes appear as Squares, indicating that it is a held keyframe, or one that holds its value until the next keyframe (which makes sense, as text doesn’t interpolate between each other).

Going through add your new text for each frame of the composition.

Setting up our Main composition

Let’s grab our Text composition in our project window, and drag it onto the composition button at the bottom of the panel. That is going to both create a new composition, and add the composition we dragged to be a layer in this newly created composition.

We’ll adjust the Composition settings of this new composition to be the final dimensions of our video, so 1920px wide and 1080px high, and we’ll increase the duration to the length we want to animate the box within.

Let’s make our Text composition a 3D layer by clicking the 3D box icon on the layer.

Next add a New Null Object and this will be the controller that all the sides of the box rotate around. We will also make this a 3D layer, and we will parent the Text Comp to the Null Object.

Add a Slider Control to the Null Object by selecting it and then going Effect -> Expression Controls -> Slider Control. Hit Enter to rename it to “Slide”.

Our first expression is on the Text Comp Anchor Point property, which we can find by selecting the layer and then pressing A. Then holding Alt and clicking on the stopwatch we can write in our expression.

 

Code Snippet
Text Comp Anchor Point
value + [0,0,height/2-0.5];
Time remap on Text Comp

Our most complex expression will go on the Time Remap property of the Text Comp layer.

Selecting it, Right Click and under Time select Enable Time Remapping. This will automatically make this property appear, and we can hold Alt and click on the stopwatch to write the next expression on it.

Code Snippet
Text Comp Time Remap
var offset = 1;

value = framesToTime( ( Math.floor
Math.floor(value)

A classic Math expression that takes a decimal number value and rounds it down to nearest whole number. e.g. 1.45 would round down to 1, and 2.9999 would round down to 2.

( ( parent.effect("Slide")("Slider") + (4-offset) ) /4 ) * 4 + offset - 1 ) % timeToFrames( source.duration ) );
Adding some shading

Next we want to add an effect to the Text Comp to add some shading. Selecting the layer go to Effect -> Color Correction -> Brightness & Contrast. On the effect you can see the stopwatch next to “Brightness”, holding Alt and clicking on the stopwatch will let us add the following expression onto its value.

Code Snippet
Text Comp Brightness Effect
var offset = 1;

var slide = parent.effect("Slide")("Slider");

var frame = Math.floor
Math.floor(value)

A classic Math expression that takes a decimal number value and rounds it down to nearest whole number. e.g. 1.45 would round down to 1, and 2.9999 would round down to 2.

( ( slide + ( 4 - offset ) ) / 4 ) * 4 + offset - 1;

value = linear
linear(x,xMin,xMax,yMin,yMax)

The Linear Expression interpolates values by calculating where “x” falls between “xMin” and “xMax” and then giving a result that is the value equivalently positioned between “yMin” and “yMax“.

(slide - frame,0,1,0,-50);
Rotating the box

We’re going to add the final expression which is to our Controller Null Object. Selecting it we press R to show the rotation properties, and we want to add an expression to the X Rotation by holding Alt and clicking on the stopwatch.

Code Snippet
Null Object X Rotation
effect("Slide")("Slider") * 90;
Adding all sides of the box

Selecting the Text Comp we want to duplicate it by selecting it and pressing Ctrl + D. And then double tapping the U key will present us with all the properties we’ve changed, including our expressions.

As this is the second side of the box we want to change our Time Remap and Brightness expressions where we set the offset value, and make that = 2.

We then want to press R to show the rotation, and for the X Rotation set the value to -90.

Repeat the process two more times, increasing the offset value by one each time and setting the X Rotation to -180 and -270 as appropriate, to give us the final two sides of the box.

Now when you change the Controller slider value, the box rotates, looping through the frames of the Text Comp consecutively. You can keyframe the slider value in order to animate between different sides of the box. Whole values correspond to only one side facing forward.

Adding some effects

If you want to add some effects such as a motion blur, we can create a new Composition and place our Main Composition in it.

We can distort the box by going to the Effect menu and selecting Distort -> Transform and use the Skew property to place the box on a slant.

We can add motion blur by going to Effect -> Time -> CC Force Motion Blur. We blur the box animation in another composition rather than using the in-built motion blur of the comp we built the box in because it gives a cleaner blur, without letting the back faces of the sides peaking through the blurring motion of the front faces of the box.

So that’s how you make the spinning box effect. Any questions reach out and I’ll be happy to answer them, or leave a comment on the video on YouTube.

You can also download the project file for this tutorial on Patreon.

GET ACCESS TO THE PROJECT FILE FOR THIS TUTORIAL

Grab some Merch

Express your inner creative outwardly whilst supporting all that we do...

View Merch store

Need some help

Run into an issue with one of the tutorials or is something not covered in the FAQ?

Contact and Support