Module Curve
[frames | no frames]

Module Curve

The Blender.Curve submodule.

Curve Data

This module provides access to Curve Data objects in Blender.

A Blender Curve can consist of multiple curves. Try converting a Text object to a Curve to see an example of this. Each curve is of type Bezier or Nurb. The underlying curves can be accessed with the [] operator. Operator [] returns an object of type CurNurb.

The Curve module also supports the Python iterator interface. This means you can access the curves in a Curve or the control points in a CurNurb using a python for statement.

Add a Curve to a Scene Example:
 from Blender import Curve, Object, Scene
 c = Curve.New()             # create new  curve data
 cur = Scene.getCurrent()    # get current scene
 ob = Object.New('Curve')    # make curve object
 ob.link(c)                  # link curve data with this object
 cur.link(ob)                # link object into scene
Iterator Example:
 ob = Object.GetSelected()[0]
 curve = ob.getData()
 for cur in curve:
   print type( cur ), cur
   for point in cur:
     print type( point ), point

Classes
CurNurb This object provides access to the control points of the curves that make up a Blender Curve.
Curve This object gives access to Curve-specific data in Blender.

Function Summary
Blender Curve or a list of Blender Curves Get(name)
Get the Curve Data object(s) from Blender.
Blender Curve New(name)
Create a new Curve Data object.

Function Details

Get(name=None)

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

           (type=Blender Curve or a list of Blender Curves)

New(name='CurData')

Create a new Curve Data object.
Parameters:
name - The Curve Data name.
           (type=string)
Returns:
The created Curve Data object.
           (type=Blender Curve)

Generated by Epydoc 2.1 on Tue Jan 4 13:43:05 2005 http://epydoc.sf.net