Doc:Manual/Animation/Basic/Deformation/Lattice
From BlenderWiki
If you want to document Blender 2.5 features please edit pages under Doc:2.5/Manual.
If a "2.5" page doesn't exist please copy the text from 2.4x Manual and edit the new page (i.e. you should paste the wikitext from this 2.4x page to this new 2.5x page and then update the latter with 2.5 features)
A lattice is a framework of controlling vertices. Associated a mesh to a lattice is a nice way to apply deformations to the mesh while modeling, but it is also a way to make animated deformations in time! To deform the mesh, you can deform the parent Lattice; the mesh deforms to fit inside the Lattice.
[edit] Lattice Animation
You can deform a Lattice in animations in a few ways:
- Animate the lattice vertices with shape keys
- Move the child object of the lattice through the lattice over time.
The first technique is basically nothing new than what contained in the previous Shape Key sections but applied to a lattice which has an object parented to it. With the second kind you can create animations that squish things between rollers, or achieve the effect of a well-known space ship accelerating to warp-speed. As the object enters the Lattice, it starts to deform; as it emerges, it expands like a foam rubber ducky back to its original shape.
For example, make a space ship mesh object. Add a lattice around the ship. Make the lattice with the parameters shown to the right in Lattice setup. This panel is shown in the Buttons window, Editing (F9) context.
There are two ways to make the lattice deform the spaceship:
- Select the object to be deformed by the lattice, and create a Lattice Modifier, entering the name of the Lattice in the Modifier panel.
- Make the object to be deformed a child of the Lattice through a special Parent relationship.
For the old school parenting approach, select the ship, then shift-select (holding ⇧ Shift while selecting) the Lattice, and press CtrlP to make the lattice the parent of the ship. The popup window will ask if you want to make a regular parent relationship, or a Lattice Deform; choose Lattice Deformation.
You should not see any deformation of the ship because the lattice is still regular. If you did, click the Regular button in the Lattice panel.
For the next few steps it is important to do them in EditMode. Select the lattice, enter EditMode, and select all vertices (A). Scale the lattice along its x-axis (press MMB
while initiating the scale) to get the stretch you want. The ship's mesh shows immediately the deformation caused by the lattice (Stretching).
Now edit the lattice in EditMode so that the right vertices have an increasing distance from each other. This will increase the stretch as the ship goes into the lattice. The right ends vertices I have scaled down so that they are nearly at one point; this will cause the vanishing of the ship at the end (Final lattice deformation).
Select the ship again and move it through the lattice to get a preview of the animation. Now you can do a normal keyframe animation to let the ship fly through the lattice.
[edit] Implications for Camera Tracking
With this lattice animation, you can't use the pivot point of the object for tracking or parenting, since the vertices that make up the mesh are sucked into the Lattice or spit out, way off center from the object itself. When that happens, although the camera is looking at the mesh object's center, the mesh isn't there so the camera is looking in the wrong place. Instead, track an Empty which has an mesh object vertex as a parent.
To do this, create an Empty. Next, make sure the Empty is selected, then select the mesh object. Press ⇆ Tab to enter EditMode. Select one vertex from the mesh object. Press CtrlP to make the vertex the parent of the Empty. Press ⇆ Tab to get out of EditMode.
Now tell the camera to track to the empty (via the Track To Constraint). Animate the location of the empty to lead the object as it enters the lattice, and lag as it emerges (or vice versa if your Lattice squashes the mesh). As the mesh enters the lattice and deforms, the empty will lead/lag its center, keeping the camera looking at the deformation action.
Add some halos and a flash of light (an animated lamp) at the end, and you have something like that shown above.


