Module Lattice :: Class Lattice
[frames | no frames]

Class Lattice


The Lattice object

This object gives access to Lattices in Blender.
Method Summary
  applyDeform(force)
list of strings getKeyTypes()
Returns the deformation key types for the x, y, and z dimensions of the Lattice.
string getMode()
Returns the current Lattice mode
string getName()
Get the name of this Lattice datablock.
list of ints getPartitions()
Gets the number of 'walls' or partitions that the Lattice has in the x, y, and z dimensions.
list of floats getPoint(index)
Returns the coordinates of a point in the Lattice by index.
  insertKey(frame)
Inserts the current state of the Lattice as a new absolute keyframe
  setKeyTypes(xType, yType, zType)
Sets the deformation key types for the x, y, and z dimensions of the Lattice.
  setMode(modeType)
Sets the current Lattice mode There are two Lattice modes possible:
  setName(name)
Set the name of this Lattice datablock.
  setPartitions(x, y, z)
Set the number of 'walls' or partitions that the Lattice will be created with in the x, y, and z dimensions.
  setPoint(index, position)
Sets the coordinates of a point in the Lattice by index.

Class Variable Summary
  depth: The number of z dimension partitions.
  depthType: The z dimension key type.
  height: The number of y dimension partitions.
  heightType: The y dimension key type.
  latSize: The number of points in this Lattice.
  mode: The current mode of the Lattice.
  name: The Lattice name.
  width: The number of x dimension partitions.
  widthType: The x dimension key type.

Method Details

applyDeform(force=False)

Parameters:
force - if True, meshes are not ignored. Applies the current Lattice deformation to any child objects that have this Lattice as the parent.
           (type=bool)

Notes:

  • simply parenting to a Lattice and redrawing the screen is enough to get the deformation done, this applyDeform method is useful when the script won't call a redraw, like in command line background (GUI-less) mode.
  • by default, this method doesn't apply deformations to meshes. This is because unlike other kinds of objects, meshes store lattice deformation directly in their vertices and calling this applyDeform method will apply the deformation a second time, giving double deformation, which can be a feature (set force = True if you want it) or much probably an undesired effect.

getKeyTypes()

Returns the deformation key types for the x, y, and z dimensions of the Lattice.
Returns:
A list corresponding to the key types will be returned: [x,y,z]
           (type=list of strings)

getMode()

Returns the current Lattice mode
Returns:
A string representing the current Lattice mode
           (type=string)

getName()

Get the name of this Lattice datablock.
Returns:
The name of the Lattice datablock.
           (type=string)

getPartitions()

Gets the number of 'walls' or partitions that the Lattice has in the x, y, and z dimensions.
Returns:
A list corresponding to the number of partitions: [x,y,z]
           (type=list of ints)

getPoint(index)

Returns the coordinates of a point in the Lattice by index.
Parameters:
index - The index of the point on the Lattice you want returned
           (type=int)
Returns:
The x,y,z coordiates of the Lattice point : [x,y,z]
           (type=list of floats)

insertKey(frame)

Inserts the current state of the Lattice as a new absolute keyframe

Example:
 for z in range(5):
   for y in range(125):
     vec = myLat.getPoint(y)
     co1 = vec[0] + vec[2]
     co2 = vec[1] - vec[2]
     co3 = vec[2] + vec[1]
     myLat.setPoint(y,[co1,co2,co3])
   w = (z + 1) * 10
   myLat.insertKey(w)
 myLat.applyDeform()
Parameters:
frame - the frame at which the Lattice will be set as a keyframe
           (type=int)

setKeyTypes(xType, yType, zType)

Sets the deformation key types for the x, y, and z dimensions of the Lattice. There are three key types possible:
  • Lattice.CARDINAL
  • Lattice.LINEAR
  • Lattice.BSPLINE
Parameters:
xType - the deformation key type for the x dimension of the Lattice
           (type=enum constant)
yType - the deformation key type for the y dimension of the Lattice
           (type=enum constant)
zType - the deformation key type for the z dimension of the Lattice
           (type=enum constant)

setMode(modeType)

Sets the current Lattice mode There are two Lattice modes possible:
  • Lattice.GRID
  • Lattice.OUTSIDE
Parameters:
modeType - the Lattice mode
           (type=enum constant)

setName(name)

Set the name of this Lattice datablock.
Parameters:
name - The new name.
           (type=string)

setPartitions(x, y, z)

Set the number of 'walls' or partitions that the Lattice will be created with in the x, y, and z dimensions.
Parameters:
x - The number of partitions in the x dimension of the Lattice.
           (type=int)
y - The number of partitions in the y dimension of the Lattice.
           (type=int)
z - The number of partitions in the z dimension of the Lattice.
           (type=int)

setPoint(index, position)

Sets the coordinates of a point in the Lattice by index.
Parameters:
index - The index of the point on the Lattice you want set
           (type=int)
position - The x,y,z coordinates that you want the point to be: [x,y,z]
           (type=list of floats)

Class Variable Details

depth

The number of z dimension partitions.

depthType

The z dimension key type.

height

The number of y dimension partitions.

heightType

The y dimension key type.

latSize

The number of points in this Lattice.

mode

The current mode of the Lattice.

name

The Lattice name.

width

The number of x dimension partitions.

widthType

The x dimension key type.

Generated by Epydoc 2.1 on Mon Jun 13 15:31:22 2005 http://epydoc.sf.net