diff options
author | Stephen Swaney <sswaney@centurytel.net> | 2004-07-22 01:01:15 +0400 |
---|---|---|
committer | Stephen Swaney <sswaney@centurytel.net> | 2004-07-22 01:01:15 +0400 |
commit | bce2c02fdd6ebaf88ffc0950e87de96b0b65377f (patch) | |
tree | 708d01a564f56cb729d8e536c8de15c70f7349dd /source/blender/python/api2_2x/bpy_types.h | |
parent | 1c5302e68b47c03fd60ab5edefb4a16d6294b7a7 (diff) |
New Curve method Curve.appendPoint( numcurve, newpoint ) to add
points to a Curve.
New supporting module CurNurb to provide access to the curves in a Curve
and their associated points.
Curve module now supports Python iterator and sequence protocols.
This allows typical python programming idioms using 'for' statement
and the [] operator.
# example 1
for curve in a_curve:
for point in curve:
print point
#example 2
curnurb = a_curve[0]
curnurb.append( [1,1,1,1] )
Still under construction. Epydoc will follow.
Diffstat (limited to 'source/blender/python/api2_2x/bpy_types.h')
-rw-r--r-- | source/blender/python/api2_2x/bpy_types.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/bpy_types.h b/source/blender/python/api2_2x/bpy_types.h index 7defd9fbc47..b7a084f2c3a 100644 --- a/source/blender/python/api2_2x/bpy_types.h +++ b/source/blender/python/api2_2x/bpy_types.h @@ -1,5 +1,5 @@ /* - * + * $Id$ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -193,11 +193,36 @@ extern PyTypeObject Curve_Type; /* Python BPy_Curve structure definition */ typedef struct { - PyObject_HEAD /* required py macro */ - Curve * curve; + PyObject_HEAD /* required py macro */ + Curve * curve; + /* pointer for iterator: does not point to owned memory */ + Nurb *iter_pointer; } BPy_Curve; +/********** + CurNurb data +***********/ + +extern PyTypeObject CurNurb_Type; + +#define BPy_CurNurb_Check(v) ((v)->ob_type == &CurNurb_Type) /* for type checking */ + +/* Python BPy_CurNurb structure definition */ +typedef struct { + PyObject_HEAD /* required py macro */ + Nurb * nurb; /* pointer to Blender data */ + + /* iterator stuff */ + /* internal ptrs to point data. do not free */ + BPoint *bp; + BezTriple *bezt; + int atEnd; /* iter exhausted flag */ + int nextPoint; + +} BPy_CurNurb; + + /*****************************************************************************/ /* World Data */ /*****************************************************************************/ |