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

Class Curve


The Curve Data object

This object gives access to Curve-specific data in Blender.
Method Summary
CurNurb appendNurb(new_point)
add a new curve to this Curve.
PyNone appendPoint(numcurve, new_control_point)
Add a new control point to the indicated curve (deprecated).
Blender Object or PyNone getBevOb()
Returns the Bevel Object (BevOb) assigned to the Curve.
float getBevresol()
Get the Curve's bevel resolution value.
list of floats getControlPoint(numcurve, numpoint)
Get the curve's control point value (deprecated).
float getExt1()
Get the Curve's ext1 value.
float getExt2()
Get the Curve's ext2 value.
integer bitfield getFlag()
Get the Curve flag value.
Key object or None getKey()
Return the Key object containing the keyframes for this curve, if any.
a list of 3 floats. getLoc()
Get the curve's location value.
list of Material Objects getMaterials()
Returns a list of materials assigned to the Curve.
string getName()
Get the name of this Curve Data object.
integer getNumCurves()
Get the number of curves in this Curve Data object.
integer getNumPoints(curve_num)
Get the number of control points in the curve (deprecated).
int getPathLen()
Get this Curve's path length.
float getResolu()
Get the Curve's U-resolution value.
float getResolv()
Get the Curve's V-resolution value.
a list of 3 floats. getRot()
Get the curve's rotation value.
a list of 3 floats. getSize()
Get the curve's size value.
Blender Object or PyNone getTaperOb()
Returns the Taper Object (TaperOb) assigned to the Curve.
int getTotcol()
Get the number of materials linked to the Curve.
float getWidth()
Get the Curve's width value.
boolean isCyclic(curve_num)
Tells whether or not a CurNurb is cyclic (closed) (deprecated).
integer isNurb(curve_num)
Tells type of a CurNurb (deprecated).
PyNone setBevOb(object)
Assign a Bevel Object (BevOb) to the Curve.
PyNone setBevresol(bevelresol)
Set the Curve's bevel resolution value.
PyNone setControlPoint(numcurve, numpoint, controlpoint)
Set the Curve's controlpoint value.
PyNone setExt1(ext1)
Set the Curve's ext1 value.
PyNone setExt2(ext2)
Set the Curve's ext2 value.
PyNone setFlag(val)
Set the Curve flag value.
PyNone setLoc(location)
Set the curve's location value.
PyNone setName(name)
Set the name of this Curve Data object.
PyNone setPathLen(len)
Set this Curve's path length.
PyNone setResolu(resolu)
Set the Curve's U-resolution value.
PyNone setResolv(resolv)
Set the Curve's V-resolution value.
PyNone setRot(rotation)
Set the Curve's rotation value.
PyNone setSize(size)
Set the curve size value.
PyNone setTaperOb(object)
Assign a Taper Object (TaperOb) to the Curve.
PyNone setTotcol(totcol)
Set the number of materials linked to the Curve.
PyNone setWidth(width)
Set the Curve's width value.
PyNone update()
Updates display list for a Curve.

Instance Variable Summary
Blender Object or PyNone bevob: The Curve Bevel Object
float bevresol: The Curve Data bevel resolution.
float ext1: The Curve Data extent 1(for bevels).
float ext2: The Curve Data extent2 (for bevels).
  flag: The Curve Data flag value; see getFlag() for the semantics.
Blender Key key: The Key object associated with this Curve, if any.
list of 3 floats loc: The Curve Data location(from the center).
string name: The Curve Data name.
int pathlen: The Curve Data path length.
float resolu: The Curve Data U-resolution.
float resolv: The Curve Data V-resolution.
list of 3 floats rot: The Curve Data rotation(from the center).
list of 3 floats size: The Curve Data size(from the center).
int totcol: The Curve Data maximal number of linked materials.
float width: The Curve Data width.

Method Details

appendNurb(new_point)

add a new curve to this Curve. The new point is added to the new curve. Blender does not support a curve with zero points. The new curve is added to the end of the list of curves in the Curve.
Parameters:
new_point - see CurNurb.append for description of parameter.
           (type=BezTriple or list of xyzw coordinates for a Nurb curve.)
Returns:
the newly added spline
           (type=CurNurb)

appendPoint(numcurve, new_control_point)

Add a new control point to the indicated curve (deprecated). New scripts should use CurNurb.append().
Parameters:
numcurve - index for spline in Curve, starting from 0
           (type=int)
new_control_point - depends on curve's type.
  • type Bezier: a BezTriple
  • type Nurb: a list of four or five floats for the xyzwt values

           (type=list of floats or BezTriple)
Returns:
PyNone
Raises:
AttributeError - throws exception if numcurve is out of range.

getBevOb()

Returns the Bevel Object (BevOb) assigned to the Curve.
Returns:
Bevel Object (BevOb) assigned to the Curve.
           (type=Blender Object or PyNone)

getBevresol()

Get the Curve's bevel resolution value.
Returns:
float

getControlPoint(numcurve, numpoint)

Get the curve's control point value (deprecated). The numpoint arg is an index into the list of points and starts with 0. Note: new scripts should use the [] operator on Curves and CurNurbs. Example:
 curve = Blender.Curve.Get('Curve')
 p0 = curve[0][0]    # get first point from first nurb
        # -- OR --
 nurb = curve[0]     # get first nurb
 p0 = nurb[0]        # get nurb's first point
Parameters:
numcurve
           (type=int)
numpoint
           (type=int)
Returns:
depends upon the curve's type.
  • type Bezier : a list of nine floats. Values are x, y, z for handle-1, vertex and handle-2
  • type Nurb : a list of 4 floats. Values are x, y, z, w.

           (type=list of floats)

getExt1()

Get the Curve's ext1 value.
Returns:
float

getExt2()

Get the Curve's ext2 value.
Returns:
float

getFlag()

Get the Curve flag value. This item is a bitfield whose value is a combination of the following parameters.
  • Bit 0 : "3D" is set
  • Bit 1 : "Front" is set
  • Bit 2 : "Back" is set
  • Bit 3 : "CurvePath" is set.
  • Bit 4 : "CurveFollow" is set.
Returns:
integer bitfield

getKey()

Return the Key object containing the keyframes for this curve, if any.
Returns:
Key object or None

getLoc()

Get the curve's location value.
Returns:
a list of 3 floats.

getMaterials()

Returns a list of materials assigned to the Curve.
Returns:
list of Material Objects assigned to the Curve.
           (type=list of Material Objects)

getName()

Get the name of this Curve Data object.
Returns:
string

getNumCurves()

Get the number of curves in this Curve Data object.
Returns:
integer

getNumPoints(curve_num)

Get the number of control points in the curve (deprecated). New scripts should use the len operator (len(curve)).
Parameters:
curve_num - zero-based index into list of curves in this Curve
           (type=integer)
Returns:
integer

getPathLen()

Get this Curve's path length.
Returns:
the path length.
           (type=int)

getResolu()

Get the Curve's U-resolution value.
Returns:
float

getResolv()

Get the Curve's V-resolution value.
Returns:
float

getRot()

Get the curve's rotation value.
Returns:
a list of 3 floats.

getSize()

Get the curve's size value.
Returns:
a list of 3 floats.

getTaperOb()

Returns the Taper Object (TaperOb) assigned to the Curve.
Returns:
Taper Object (TaperOb) assigned to the Curve.
           (type=Blender Object or PyNone)

getTotcol()

Get the number of materials linked to the Curve.
Returns:
number of materials linked.
           (type=int)

getWidth()

Get the Curve's width value.
Returns:
float

isCyclic(curve_num)

Tells whether or not a CurNurb is cyclic (closed) (deprecated). New scripts should use CurNurb.isCyclic().
Parameters:
curve_num - zero-based index into list of curves in this Curve
           (type=integer)
Returns:
True if is cyclic, False if not
           (type=boolean)
Raises:
AttributeError - throws exception if curve_num is out of range.

isNurb(curve_num)

Tells type of a CurNurb (deprecated). New scripts should use CurNurb.isNurb().
Parameters:
curve_num - zero-based index into list of curves in this Curve.
           (type=integer)
Returns:
Zero if curve is type Bezier, one if curve is of type Nurb.
           (type=integer)
Raises:
AttributeError - throws exception if curve_num is out of range.

setBevOb(object)

Assign a Bevel Object (BevOb) to the Curve. Passing None as the object parameter removes the bevel.
Parameters:
object - Blender Object to assign as Bevel Object (BevOb)
           (type=Curve type Blender Object)
Returns:
PyNone
           (type=PyNone)
Raises:
TypeError - throws exception if the parameter is not a Curve type Blender Object or PyNone

setBevresol(bevelresol)

Set the Curve's bevel resolution value.
Parameters:
bevelresol - The new Curve's bevel resolution value.
           (type=float)
Returns:
PyNone

setControlPoint(numcurve, numpoint, controlpoint)

Set the Curve's controlpoint value. The numpoint arg is an index into the list of points and starts with 0.
Parameters:
numcurve - index for spline in Curve, starting from 0
           (type=int)
numpoint - index for point in spline, starting from 0
           (type=int)
controlpoint - The new controlpoint value. See getControlPoint for the length of the list.
           (type=list)
Returns:
PyNone

setExt1(ext1)

Set the Curve's ext1 value.
Parameters:
ext1 - The new Curve's ext1 value.
           (type=float)
Returns:
PyNone

setExt2(ext2)

Set the Curve's ext2 value.
Parameters:
ext2 - The new Curve's ext2 value.
           (type=float)
Returns:
PyNone

setFlag(val)

Set the Curve flag value. The flag corresponds to the Blender settings for 3D, Front, Back, CurvePath and CurveFollow. This parameter is a bitfield.
Parameters:
val - The Curve's flag bits. See getFlag for the meaning of the individual bits.
           (type=integer bitfield)
Returns:
PyNone

setLoc(location)

Set the curve's location value.
Parameters:
location - The new Curve's location values.
           (type=list[3])
Returns:
PyNone

setName(name)

Set the name of this Curve Data object.
Parameters:
name - The new name.
           (type=string)
Returns:
PyNone

setPathLen(len)

Set this Curve's path length.
Parameters:
len - the new curve's length.
           (type=int)
Returns:
PyNone

setResolu(resolu)

Set the Curve's U-resolution value.
Parameters:
resolu - The new Curve's U-resolution value.
           (type=float)
Returns:
PyNone

setResolv(resolv)

Set the Curve's V-resolution value.
Parameters:
resolv - The new Curve's V-resolution value.
           (type=float)
Returns:
PyNone

setRot(rotation)

Set the Curve's rotation value.
Parameters:
rotation - The new Curve's rotation values.
           (type=list[3])
Returns:
PyNone

setSize(size)

Set the curve size value.
Parameters:
size - The new Curve's size values.
           (type=list[3])
Returns:
PyNone

setTaperOb(object)

Assign a Taper Object (TaperOb) to the Curve. Passing None as the object parameter removes the taper.
Parameters:
object - Blender Object to assign as Taper Object (TaperOb)
           (type=Curve type Blender Object)
Returns:
PyNone
           (type=PyNone)
Raises:
TypeError - throws exception if the parameter is not a Curve type Blender Object or PyNone

setTotcol(totcol)

Set the number of materials linked to the Curve.
Parameters:
totcol - number of materials linked.
           (type=int)
Returns:
PyNone

setWidth(width)

Set the Curve's width value.
Parameters:
width - The new Curve's width value.
           (type=float)
Returns:
PyNone

update()

Updates display list for a Curve. Used after making changes to control points. You must use this if you want to see your changes!
Returns:
PyNone
           (type=PyNone)

Instance Variable Details

bevob

The Curve Bevel Object
Type:
Blender Object or PyNone

bevresol

The Curve Data bevel resolution.
Type:
float

ext1

The Curve Data extent 1(for bevels).
Type:
float

ext2

The Curve Data extent2 (for bevels).
Type:
float

flag

The Curve Data flag value; see getFlag() for the semantics.

key

The Key object associated with this Curve, if any.
Type:
Blender Key

loc

The Curve Data location(from the center).
Type:
list of 3 floats

name

The Curve Data name.
Type:
string

pathlen

The Curve Data path length.
Type:
int

resolu

The Curve Data U-resolution.
Type:
float

resolv

The Curve Data V-resolution.
Type:
float

rot

The Curve Data rotation(from the center).
Type:
list of 3 floats

size

The Curve Data size(from the center).
Type:
list of 3 floats

totcol

The Curve Data maximal number of linked materials.
Type:
int

width

The Curve Data width.
Type:
float

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