From 966ff6840ef400dd86efb69efbbcd69db1ecc21f Mon Sep 17 00:00:00 2001 From: Jacques Guignot Date: Tue, 28 Oct 2003 23:23:30 +0000 Subject: [PATCH] added getIpo() function. --- source/blender/python/api2_2x/Object.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 170cfa61f4b..577894e720f 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -85,6 +85,7 @@ struct PyMethodDef M_Object_methods[] = { /*****************************************************************************/ /* Python BPy_Object methods declarations: */ /*****************************************************************************/ +static PyObject *Object_getIpo (BPy_Object *self); static PyObject *Object_buildParts (BPy_Object *self); static PyObject *Object_clrParent (BPy_Object *self, PyObject *args); static PyObject *Object_getData (BPy_Object *self); @@ -120,7 +121,9 @@ static PyObject *Object_shareFrom (BPy_Object *self, PyObject *args); static PyMethodDef BPy_Object_methods[] = { /* name, method, flags, doc */ {"buildParts", (PyCFunction)Object_buildParts, METH_NOARGS, - "Recalcs particle system (if any) "}, + "Recalcs particle system (if any) "}, + {"getIpo", (PyCFunction)Object_getIpo, METH_NOARGS, + "Recalcs particle system (if any) "}, {"clrParent", (PyCFunction)Object_clrParent, METH_VARARGS, "Clears parent object. Optionally specify:\n\ mode\n\t2: Keep object transform\nfast\n\t>0: Don't update scene \ @@ -492,6 +495,17 @@ PyObject *Object_Init (void) /* Python BPy_Object methods: */ /*****************************************************************************/ +#include + + +static PyObject *Object_getIpo(BPy_Object *self) +{ +PyObject *Ipo_CreatePyObject (Ipo *ipo); + struct Ipo*ipo = self->object->ipo; + if (!ipo) return EXPP_ReturnPyObjError(PyExc_RuntimeError,"Object has no Ipo"); + return Ipo_CreatePyObject (ipo); +} + static PyObject *Object_buildParts (BPy_Object *self) {