Module Lattice
[frames | no frames]

Module Lattice

The Blender.Lattice submodule.

Lattice Object

This module provides access to Lattice object in Blender.

Example:
 import Blender
 from Blender import Lattice
 from Blender.Lattice import *
 from Blender import Object
 from Blender import Scene

 myOb = Object.New('Lattice')
 myLat = Lattice.New()
 myLat.setPartitions(5,5,5)
 myLat.setKeyTypes(LINEAR, CARDINAL, BSPLINE)
 myLat.setMode(OUTSIDE)

 for y in range(125):
   vec = myLat.getPoint(y)
   co1 = vec[0] + vec[0] / 5
   co2 = vec[1] - vec[2] * 0.3
   co3 = vec[2] * 3
   myLat.setPoint(y,[co1,co2,co3])

 myOb.link(myLat)
 mySphere = Object.Get('Sphere')
 myOb.makeParent([mySphere])

 myLat.applyDeform()

 sc = Scene.getCurrent()
 sc.link(myOb)
 Blender.Redraw()

Classes
Lattice This object gives access to Lattices in Blender.

Function Summary
Blender Lattice or a list of Blender Lattices Get(name)
Get the Lattice object(s) from Blender.
Blender Lattice New(name)
Create a new Lattice object.

Function Details

Get(name=None)

Get the Lattice object(s) from Blender.
Parameters:
name - The name of the Lattice object.
           (type=string)
Returns:
It depends on the 'name' parameter:
  • (name): The Lattice object with the given name;
  • (): A list with all Lattice objects in the current scene.

           (type=Blender Lattice or a list of Blender Lattices)

New(name=None)

Create a new Lattice object. Passing a name to this function will name the Lattice datablock, otherwise the Lattice data will be given a default name.
Parameters:
name - The Lattice name.
           (type=string)
Returns:
The created Lattice Data object.
           (type=Blender Lattice)

Generated by Epydoc 2.1 on Thu Jul 13 16:50:05 2006 http://epydoc.sf.net