Caffeine Abuse - The Blog

Box Unfolding

The most straightforward (and powerful) way to set-up the animation is by using bones. For the modelling I would recommend starting out with a simple cube, extruding the sides to match the reference box in its unwrapped state. As there’s a clear distinction between each side of the box as well as the flaps, the placement of the bones should be rather evident. Use a one-bone chain, starting and ending aligned to the corresponding flap, to control each of them. While you’ll envelope each side to a single bone as well, you can use two separate two-bone chains to control all sides. Once all of your bones are in place (should count thirteen), make the flaps a child of the corresponding side bone. Depending on the type of material your virtual box is made of and your desired style on the animation you might want to use a two-bone chain per side of the box as well as for the flaps. While a single bone is sufficient to control the folding, the extra bone will enable you to create a softer deformation, avoiding the otherwise slightly stiff look.
While the folding and unfolding of the box is neatly attained with the bones, they won’t be very practical on there own if we for example want to translate or rotate the entire box. To ensure any potential transform to function properly and being easily managed, we’ll need to extend the parent and child relations a bit further. If we were to create a single parent for the entire bone structure, and use this for all of the transforms we could quite easily run into a problem known as Gimble lock (animation the rotation on two or more axis of an object can create unpredictable results). By extending the depth of the hierarchy with four additional objects, one for the overall translation and one for each rotational axis, we’ll not only avoid this potential setback but also adding a great deal of flexibility.

The project files used in this tutorial can be found at:

Using hierarchies where different objects control the X, Y and Z rotation as well as the translation adds greatly to the control of the animation. For a more interesting visual appearance, make sure you overlap as well as offset the animation of the different flaps and sides

Quick tip
By adding a Lattice deformer to the box geometry, you can add animation to the cardboard as well