Creates lattice and orients it in the direction you want automatically and scales it appropriately.
It does NOT take rotation data from the mesh meaning this works even if you select "apply rotation"
Rather it analyzes the mesh based on the vertices. There may be other lattice addons that do this but I am not aware of them (I hope there isn’t, I want to be the first one). They all seem to create a lattice at orients itself into default global coordinates or copies the rotation of the mesh.
- Object in Object mode
- Object in Edit mode (selected vertices)
- Multiple objects in Object mode
- Multiple objects in Edit mode (selected vertices)
Potential problems and work I need to do:
- Doesn’t apply the lattice modifier to the mesh but this should be an easy task
- I don’t know how to code a user interface
- May give weird results if the mesh has uneven vertex density
- Meshes may also stick out of lattice if it’s too far away from the others
- Due to the fact that this analyzes vertices, performance may suffer greatly for meshes with high vertex count
- Take into account modifier vertices as Michael_Knubben suggested
Multi Object Edit Mode: