diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2003-05-20 07:53:30 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2003-05-20 07:53:30 +0400 |
commit | 1a87f3a4aa7045d2f7e4c85ed2e5d0ae117c71b0 (patch) | |
tree | e436d11808d25c59ff76147b06355d81743bcfe6 /source/blender/python/api2_2x/Curve.c | |
parent | 59cedf343e6ad2524be6b1fb3dc019a6e3173abd (diff) |
Guignot implemented 3 functions needed by the Object Module
Diffstat (limited to 'source/blender/python/api2_2x/Curve.c')
-rw-r--r-- | source/blender/python/api2_2x/Curve.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Curve.c b/source/blender/python/api2_2x/Curve.c index a981dea4dd5..05fbd5a2d1c 100644 --- a/source/blender/python/api2_2x/Curve.c +++ b/source/blender/python/api2_2x/Curve.c @@ -605,3 +605,39 @@ static PyObject *CurveRepr (C_Curve *self) /* used by 'repr' */ return PyString_FromString(self->curve->id.name+2); } + +/*****************************************************************************/ +/* Functions: CurveCreatePyObject, CurveCheckPyObject, CurveFromPyObject */ +/* Description: These helper functions are needed by the Object module to */ +/* work with its specific object.data, Curve Data in this case. */ +/*****************************************************************************/ +PyObject* CurveCreatePyObject (struct Curve *curve) +{ + C_Curve * blen_object; + + printf ("In CurveCreatePyObject\n"); + + blen_object = (C_Curve*)PyObject_NEW (C_Curve, &Curve_Type); + + if (blen_object == NULL) + { + return (NULL); + } + blen_object->curve = curve; + return ((PyObject*)blen_object); + +} + +int CurveCheckPyObject (PyObject *py_obj) +{ + return (py_obj->ob_type == &Curve_Type); +} + +struct Curve* CurveFromPyObject (PyObject *py_obj) +{ + C_Curve * blen_obj; + + blen_obj = (C_Curve*)py_obj; + return (blen_obj->curve); + +} |