diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-06-16 17:17:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-06-16 17:17:41 +0400 |
commit | 84749aa3ff39af08cdccfea462fb4a6a266ca7b8 (patch) | |
tree | 63954fcd3eb073fe8e057974f750c641b6d17bfd /source/blender/python/api2_2x/NLA.c | |
parent | 3e490c020324dcd4d7a3a3acd62f48d3fd781afc (diff) |
Python API, more METH_VARARGS to METH_O
Diffstat (limited to 'source/blender/python/api2_2x/NLA.c')
-rw-r--r-- | source/blender/python/api2_2x/NLA.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/source/blender/python/api2_2x/NLA.c b/source/blender/python/api2_2x/NLA.c index 12d948120dd..31a420a15a2 100644 --- a/source/blender/python/api2_2x/NLA.c +++ b/source/blender/python/api2_2x/NLA.c @@ -87,11 +87,11 @@ struct PyMethodDef M_NLA_methods[] = { /*****************************************************************************/ static PyObject *Action_setActive( BPy_Action * self, PyObject * args ); static PyObject *Action_getFrameNumbers(BPy_Action *self); -static PyObject *Action_getChannelIpo( BPy_Action * self, PyObject * args ); +static PyObject *Action_getChannelIpo( BPy_Action * self, PyObject * value ); static PyObject *Action_getChannelNames( BPy_Action * self ); static PyObject *Action_renameChannel( BPy_Action * self, PyObject * args ); -static PyObject *Action_verifyChannel( BPy_Action * self, PyObject * args ); -static PyObject *Action_removeChannel( BPy_Action * self, PyObject * args ); +static PyObject *Action_verifyChannel( BPy_Action * self, PyObject * value ); +static PyObject *Action_removeChannel( BPy_Action * self, PyObject * value ); static PyObject *Action_getAllChannelIpos( BPy_Action * self ); /*****************************************************************************/ @@ -107,15 +107,15 @@ static PyMethodDef BPy_Action_methods[] = { "(str) -set this action as the active action for an object"}, {"getFrameNumbers", (PyCFunction) Action_getFrameNumbers, METH_NOARGS, "() - get the frame numbers at which keys have been inserted"}, - {"getChannelIpo", ( PyCFunction ) Action_getChannelIpo, METH_VARARGS, + {"getChannelIpo", ( PyCFunction ) Action_getChannelIpo, METH_O, "(str) -get the Ipo from a named action channel in this action"}, {"getChannelNames", ( PyCFunction ) Action_getChannelNames, METH_NOARGS, "() -get the channel names for this action"}, {"renameChannel", ( PyCFunction ) Action_renameChannel, METH_VARARGS, "(from, to) -rename the channel from string to string"}, - {"verifyChannel", ( PyCFunction ) Action_verifyChannel, METH_VARARGS, + {"verifyChannel", ( PyCFunction ) Action_verifyChannel, METH_O, "(str) -verify the channel in this action"}, - {"removeChannel", ( PyCFunction ) Action_removeChannel, METH_VARARGS, + {"removeChannel", ( PyCFunction ) Action_removeChannel, METH_O, "(str) -remove the channel from the action"}, {"getAllChannelIpos", ( PyCFunction ) Action_getAllChannelIpos, METH_NOARGS, @@ -268,12 +268,12 @@ static PyObject *Action_setActive( BPy_Action * self, PyObject * args ) Py_RETURN_NONE; } -static PyObject *Action_getChannelIpo( BPy_Action * self, PyObject * args ) +static PyObject *Action_getChannelIpo( BPy_Action * self, PyObject * value ) { - char *chanName; + char *chanName = PyString_AsString(value); bActionChannel *chan; - if( !PyArg_ParseTuple( args, "s", &chanName ) ) + if( !chanName ) return EXPP_ReturnPyObjError( PyExc_AttributeError, "string expected" ); @@ -328,16 +328,16 @@ static PyObject *Action_renameChannel( BPy_Action * self, PyObject * args ) } /*----------------------------------------------------------------------*/ -static PyObject *Action_verifyChannel( BPy_Action * self, PyObject * args ) +static PyObject *Action_verifyChannel( BPy_Action * self, PyObject * value ) { - char *chanName; + char *chanName = PyString_AsString(value); bActionChannel *chan; if( !self->action ) ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "couldn't create channel for a NULL action" ) ); - if( !PyArg_ParseTuple( args, "s", &chanName ) ) + if( !chanName ) return ( EXPP_ReturnPyObjError( PyExc_AttributeError, "expected string argument" ) ); @@ -347,16 +347,15 @@ static PyObject *Action_verifyChannel( BPy_Action * self, PyObject * args ) } -static PyObject *Action_removeChannel( BPy_Action * self, PyObject * args ) +static PyObject *Action_removeChannel( BPy_Action * self, PyObject * value ) { - char *chanName; + char *chanName = PyString_AsString(value); bActionChannel *chan; - if( !PyArg_ParseTuple( args, "s", &chanName ) ) { - EXPP_ReturnPyObjError( PyExc_AttributeError, - "string expected" ); - return NULL; - } + if( !chanName ) + return (EXPP_ReturnPyObjError( PyExc_AttributeError, + "string expected" )); + chan = get_action_channel( self->action, chanName ); if( chan == NULL ) { |