[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11379] branches/2-44-stable/blender/ source/blender/python/api2_2x/Curve.c: reverse last commit.

Campbell Barton cbarton at metavr.com
Thu Jul 26 17:02:07 CEST 2007


Revision: 11379
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11379
Author:   campbellbarton
Date:     2007-07-26 17:02:07 +0200 (Thu, 26 Jul 2007)

Log Message:
-----------
reverse last commit. will reapply after rc1 is released.

Modified Paths:
--------------
    branches/2-44-stable/blender/source/blender/python/api2_2x/Curve.c

Modified: branches/2-44-stable/blender/source/blender/python/api2_2x/Curve.c
===================================================================
--- branches/2-44-stable/blender/source/blender/python/api2_2x/Curve.c	2007-07-26 14:32:32 UTC (rev 11378)
+++ branches/2-44-stable/blender/source/blender/python/api2_2x/Curve.c	2007-07-26 15:02:07 UTC (rev 11379)
@@ -1,4 +1,4 @@
-/*  
+/* 
  * $Id$
  *
  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
@@ -32,7 +32,6 @@
 
 #include "Curve.h" /*This must come first*/
 
-#include "BLI_blenlib.h"
 #include "BKE_main.h"
 #include "BKE_displist.h"
 #include "BKE_global.h"
@@ -881,14 +880,27 @@
 
 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;
@@ -915,7 +927,6 @@
 			new_nurb->knotsu = 0;
 			/*makenots( new_nurb, 1, new_nurb->flagu >> 1); */
 		}
-		BLI_addtail( &self->curve->nurb, new_nurb);
 
 	} else {
 		freeNurb( new_nurb );





More information about the Bf-blender-cvs mailing list