Improving Latte Express options
Some objects might not have enough polygons for the lattice deformation to work properly. We encountered a similar condition at the beginning of this chapter, in the Understanding object modifiers section, where we applied a Subdivision Surface modifier to our Cube shape before we could reshape it into a cylinder using a Cast modifier.
The resolution of lattice objects can also be increased to get more control over the deformation.
For those reasons, we will add object subdivision and lattice resolution options to our operator.
Adding object subdivisions
We add a subdivide option to Latte Express using BoolProperty
. Since we will also set a SUBSURF
modifier, we add IntProperty
for the subdivision levels.
We add bl_options = {'REGISTER', 'UNDO'}
to display the operator panel. The declaration of LatteExpress becomes as follows:
class LatteExpress(bpy.types.Operator): """Set up...