Fit Lattice

by Mark Kingsnorth in Scripts and Addons

Quickly fit a lattice deformation cage around a mesh or set of meshes:

If I want to quickly change the proportions of an object with a Blender lattice, in the past I have found it time-consuming to create a lattice, define it's size and subdivisions, make it the right size for the mesh (or meshes) I am deforming, and then add one or more Lattice modifiers to the original object(s) and assign the lattice object.  This add-on allows you to do it in one click and has the option of presets:

Source: Dynamic Jet

Used with: Shape Generator & Plating Generator

Features:

  • Quick workflow: Select the object(s) you want to deform, and select the 'Fit Lattice' menu option.
  • Configurable: In one operation, also configure the number of subdivisions in the lattice object.
  • Select multiple: One lattice can be applied to many meshes when those meshes are selected.
  • Presets: Choose from a pre-defined list (2x2x2, 3x3x3, 4x4x4...) and/or define your own.
  • Quick deforms: The tool can be used to quickly deform a mesh, for instance, a 'taper' operation.

If you have any questions, issues or feature requests, contact me through Blender Market or reach me on Twitter.

Installation

For fit_lattice.zip:

  1. Go to File -> User Preferences.
  2. Select the Add-ons tab at the top.
  3. Select the Install Add-on from File... button along the bottom.
  4. A file dialogue will pop up. Navigate to the file location where you downloaded the .zip file and double click it.
  5. Search for the add-on by typing "Fit Lattice" in the search box if it does not already appear. Make sure the checkbox next to the Add-on (Mesh: Fit Lattice) is ticked.
  6. Click the Save User Settings button to make sure the add-on is installed next time you open Blender.
  7. Close the User Preferences dialog box and enjoy!


For fit_lattice_presets.zip:

This is an optional step if you wish to load some pre-configured presets.

Depending on your operating system, navigate to one of the following directories.

  • If you are on Linux, navigate to ~/.config/blender
  • On a Mac: /Users/<username>/Library/Application Support/Blender/
  • If you are on Windows, navigate to: %APPDATA%\Roaming\Blender Foundation\Blender

Once there you should see folder(s) corresponding to the version(s) you currently have, for instance the 2.79 folder.  Within that folder, go to scripts/presets/operator/ and create the folder mesh.fit_lattice. Unzip the contents of the .zip file to that location.

You should then be able to access a set of pre-configured presets when using the operator.  

IMPORTANT: When moving Blender versions, make sure you have backed up this directory as it contains any presets you have saved.

How it works

The add-on works out the size and position of the bounding box(es) of the object(s) you select and then creates a Blender lattice object that fits to that size.  It then adds a 'Lattice Modifier' to the original object (or objects), and then automatically links that modifier to the lattice object.

Use

  1. Select the object or objects (by pressing shift + right-click) you want to fit the lattice around.
  2. Press Alt+L or go to Object -> Fit Lattice. You can also access the tool by pressing space and then starting to type Fit Lattice.
  3. The lattice object should appear around the object(s), ready for editing by pressing the tab key.

When the lattice object is created, you can also configure the lattice object segments at the time through the toolbar, described below.

Options

On the toolbar menu (accessed by pressing the 'T' key), you can also configure the lattice object being created:

Operator Presets

You can load, edit or save a selection of pre-prepared configurations.  Press the '+' and '-' keys to add or delete entries.

The presets contained in the fit_lattice_presets.zip file contain the following presets, although you can add more:

  • 2x2x2: a lattice split into 2x2x2 segments.
  • 3x3x3: a lattice split into 3x3x3 segments.
  • 4x4x4: a lattice split into 3x3x3 segments.

U, V, W:

These settings control the the subdivisions of the lattice in the x, y and z direction.

You can also change the parameters of the Lattice or the Lattice modifier after it has been created.  See the Blender documentation for Lattices and the Blender Lattice Modifier.

Any Questions?

Do not hesitate to get in touch with me if you have a question, a new feature suggestion, or an image you'd like to share.  You can contact me through this website, my blog, or by my Twitter page.

My lattice does not appear to fit. What happened?

Try using the 'Apply Object Transform' option, which sometimes artificially skews the transformation. This will reset the original object transforms, which may not be what you wish.  If you are still having problems, don't hesitate to contact me through the Blender Market website.

What does the add-on work on?

The add-on should work on selected objects or curves, but not specialist objects like metaballs which do not have a lattice option. If you are having any problems, contact me through the Blender Market website.

What types of object does this add-on work on?

This add-on works on selected meshes or curves.  If the menu item does not appear, it may be that you have selected something that cannot be deformed, such as a camera.

    No ratings have been submitted yet.

Purchase this item to leave a review!