diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-07-26 18:32:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-07-26 18:32:32 +0400 |
commit | 670cf8c5a9ae7f17478e63185fc105e19fb9e4b2 (patch) | |
tree | 7ac40f3ad827fb7ec84aacac4eb23587d377c30b /source/blender/python/api2_2x/Curve.c | |
parent | d63da45ca8483d8a977a68533eafe51ea0b7dbf3 (diff) |
fix from 2.44 for adding new curves.
Diffstat (limited to 'source/blender/python/api2_2x/Curve.c')
-rw-r--r-- | source/blender/python/api2_2x/Curve.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/source/blender/python/api2_2x/Curve.c b/source/blender/python/api2_2x/Curve.c index e84902f3fbe..75838f442c0 100644 --- a/source/blender/python/api2_2x/Curve.c +++ b/source/blender/python/api2_2x/Curve.c @@ -809,27 +809,14 @@ static PyObject *Curve_appendPoint( BPy_Curve * self, PyObject * args ) static PyObject *Curve_appendNurb( BPy_Curve * self, PyObject * value ) { - Nurb *nurb_ptr = self->curve->nurb.first; - Nurb **pptr = ( Nurb ** ) & ( self->curve->nurb.first ); Nurb *new_nurb; - - - /* walk to end of nurblist */ - if( nurb_ptr ) { - while( nurb_ptr->next ) { - nurb_ptr = nurb_ptr->next; - } - pptr = &nurb_ptr->next; - } - /* malloc new nurb */ new_nurb = ( Nurb * ) MEM_callocN( sizeof( Nurb ), "appendNurb" ); if( !new_nurb ) return EXPP_ReturnPyObjError ( PyExc_MemoryError, "unable to malloc Nurb" ); - + if( CurNurb_appendPointToNurb( new_nurb, value ) ) { - *pptr = new_nurb; new_nurb->resolu = self->curve->resolu; new_nurb->resolv = self->curve->resolv; new_nurb->hide = 0; @@ -856,6 +843,7 @@ static PyObject *Curve_appendNurb( BPy_Curve * self, PyObject * value ) new_nurb->knotsu = 0; /*makenots( new_nurb, 1, new_nurb->flagu >> 1); */ } + BLI_addtail( &self->curve->nurb, new_nurb); } else { freeNurb( new_nurb ); |