diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-06-16 16:24:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-06-16 16:24:41 +0400 |
commit | 39a526a963e9e0a0f206556a8b740fab56ba2654 (patch) | |
tree | 69290c8f2186c5dbc4673da0a6de60a874e18ab2 /source/blender/python/api2_2x/Metaball.c | |
parent | 5135ed7b0e5c09c77a54e4359d7ff0b92003f4f0 (diff) |
Python PyMethodDef supports single argument methods (METH_O) but was using METH_VARARGS everywhere and getting the single args from the tuple.
Use METH_O where applicable.
Diffstat (limited to 'source/blender/python/api2_2x/Metaball.c')
-rw-r--r-- | source/blender/python/api2_2x/Metaball.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Metaball.c b/source/blender/python/api2_2x/Metaball.c index aeb935c72e1..b8d3bd3dba0 100644 --- a/source/blender/python/api2_2x/Metaball.c +++ b/source/blender/python/api2_2x/Metaball.c @@ -1066,12 +1066,11 @@ static PyObject *MetaElemSeq_add( BPy_MetaElemSeq * self ) * no args are taken so the returned metaball must be modified after adding. * Accessed as mball.elements.add() where mball is a python metaball data type. */ -static PyObject *MetaElemSeq_remove( BPy_MetaElemSeq * self, PyObject *args ) +static PyObject *MetaElemSeq_remove( BPy_MetaElemSeq * self, BPy_Metaelem *elem ) { - BPy_Metaelem *elem; MetaElem *ml_iter, *ml_py; - if( !PyArg_ParseTuple( args, "O!", &Metaelem_Type, &elem) ) + if( !BPy_Metaelem_Check(elem) ) return EXPP_ReturnPyObjError( PyExc_TypeError, "elements.remove(metaelem) - expected a Metaball element" ); @@ -1095,7 +1094,7 @@ static PyObject *MetaElemSeq_remove( BPy_MetaElemSeq * self, PyObject *args ) static struct PyMethodDef BPy_MetaElemSeq_methods[] = { {"add", (PyCFunction)MetaElemSeq_add, METH_NOARGS, "add metaelem to metaball data"}, - {"remove", (PyCFunction)MetaElemSeq_remove, METH_VARARGS, + {"remove", (PyCFunction)MetaElemSeq_remove, METH_O, "remove element from metaball data"}, {NULL, NULL, 0, NULL} }; |