Index: api2_2x/CurNurb.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/CurNurb.c,v
retrieving revision 1.4
diff -u -r1.4 CurNurb.c
--- api2_2x/CurNurb.c	7 Oct 2004 19:25:39 -0000	1.4
+++ api2_2x/CurNurb.c	7 Jan 2005 12:00:42 -0000
@@ -63,6 +63,7 @@
 PyObject *CurNurb_append( BPy_CurNurb * self, PyObject * args );
 PyObject *CurNurb_pointAtIndex( Nurb * nurb, int index );
 static PyObject *CurNurb_isNurb( BPy_CurNurb * self );
+static PyObject *CurNurb_isCyclic( BPy_CurNurb * self );
 
 char M_CurNurb_doc[] = "CurNurb";
 
@@ -426,6 +427,23 @@
 	}
 }
 
+/*
+ * CurNurb_isCyclic()
+ * test whether spline cyclic (closed) or not (open)
+ */
+
+static PyObject *CurNurb_isCyclic( BPy_CurNurb * self )
+{
+        /* supposing that the flagu is always set */ 
+
+	if( self->nurb->flagu & CU_CYCLIC ) {
+		Py_INCREF( Py_True );
+		return Py_True;
+	} else {
+		Py_INCREF( Py_False );
+		return ( Py_False );
+	}
+}
 
 /*
    table of module methods
@@ -463,6 +481,8 @@
 	 "( point ) - add a new point.  arg is BezTriple or list of x,y,z,w floats"},
 	{"isNurb", ( PyCFunction ) CurNurb_isNurb, METH_NOARGS,
 	 "( ) - boolean function tests if this spline is type nurb or bezier"},
+	{"isCyclic", ( PyCFunction ) CurNurb_isCyclic, METH_NOARGS,
+	 "( ) - boolean function tests if this spline is cyclic (closed) or not (open)"},
 	{NULL, NULL, 0, NULL}
 };
 
Index: api2_2x/Curve.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Curve.c,v
retrieving revision 1.21
diff -u -r1.21 Curve.c
--- api2_2x/Curve.c	7 Oct 2004 19:25:39 -0000	1.21
+++ api2_2x/Curve.c	7 Jan 2005 12:00:42 -0000
@@ -106,6 +106,7 @@
 static PyObject *Curve_setSize( BPy_Curve * self, PyObject * args );
 static PyObject *Curve_getNumCurves( BPy_Curve * self );
 static PyObject *Curve_isNurb( BPy_Curve * self, PyObject * args );
+static PyObject *Curve_isCyclic( BPy_Curve * self, PyObject * args);
 static PyObject *Curve_getNumPoints( BPy_Curve * self, PyObject * args );
 static PyObject *Curve_getNumPoints( BPy_Curve * self, PyObject * args );
 
@@ -204,6 +205,8 @@
 	{"isNurb", ( PyCFunction ) Curve_isNurb,
 	 METH_VARARGS,
 	 "(nothing or integer) - returns 1 if curve is type Nurb, O otherwise."},
+	{"isCyclic", ( PyCFunction ) Curve_isCyclic,
+	 METH_VARARGS, "() - returns 1 if curve is cyclic (closed), 0 otherwise."},
 	{"getNumPoints", ( PyCFunction ) Curve_getNumPoints,
 	 METH_VARARGS,
 	 "(nothing or integer) - returns the number of points of the specified curve"},
@@ -1056,6 +1059,46 @@
 	/* oops */
 	return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
 					"couldn't get curve type" ) );
+}
+
+/* trying to make a check for closedness (cyclic), following on isNurb (above) 
+   copy-pasting done by antont@kyperjokki.fi */
+
+static PyObject *Curve_isCyclic( BPy_Curve * self, PyObject * args )
+{
+	int curve_num = 0;	/* default value */
+	int is_cyclic;
+	Nurb *ptrnurb;
+	PyObject *ret_val;
+	int i;
+
+	/* parse and check input args */
+	if( !PyArg_ParseTuple( args, "|i", &curve_num ) ) {
+		return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+						"expected int argument" ) );
+	}
+	if( curve_num < 0 ) {
+		return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+						"curve number must be non-negative" ) );
+	}
+
+	ptrnurb = self->curve->nurb.first;
+
+	if( !ptrnurb )		/* no splines in this curve */
+		return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+						"no splines in this Curve" ) );
+
+	for( i = 0; i < curve_num; i++ ) {
+		ptrnurb = ptrnurb->next;
+		if( !ptrnurb )	/* if zero, we ran just ran out of curves */
+			return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+							"curve index out of range" ) );
+	}
+
+	is_cyclic = ptrnurb->flagu & CU_CYCLIC;
+	ret_val = PyInt_FromLong( ( long ) is_cyclic );
+
+	return (ret_val);
 }
 
 
Index: api2_2x/doc/Curve.py
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/doc/Curve.py,v
retrieving revision 1.8
diff -u -r1.8 Curve.py
--- api2_2x/doc/Curve.py	4 Oct 2004 04:35:52 -0000	1.8
+++ api2_2x/doc/Curve.py	7 Jan 2005 12:00:42 -0000
@@ -333,12 +333,22 @@
       """
       method used to determine whether a CurNurb is of type Bezier or of type Nurb.
       @rtype: integer
-      @return:  Zero of curve is type Bezier, One if curve is of type Nurb.
+      @return:  Zero if curve is type Bezier, One if curve is of type Nurb.
       @type curve_num: integer
       @param curve_num: zero-based index into list of curves in this Curve.
       @raise AttributeError:  throws exception if curve_num is out of range.
       """
 
+  def isCyclic():
+      """
+      whether the curve is cyclic (closed) or not
+
+      @rtype: integer
+      @return: Zero if is cyclic, One if not
+      @type curve_num: integer
+      @param curve_num: zero-based index into list of curves in this Curve
+      @raise AttributeError:  throws exception if curve_num is out of range.
+      """
 
 class CurNurb:
     """
@@ -383,6 +393,12 @@
       @rtype: boolean
       @return:  True or False
       """
+
+    def isCyclic():
+      """
+      Boolean method used to determine wheter a CurNurb is cyclic (a closed curve) or not.
+      @rtype: boolean
+      @return: True or False
 
   
     
