diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-24 06:39:38 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-24 06:39:38 +0400 |
commit | 3df023ae82eef0ea105dc61c9730af87b59a07d1 (patch) | |
tree | 2d2a4e753c1129fc91f360f0457d30859cd38737 /source/blender/freestyle/intern/python/Interface0D/ViewVertex | |
parent | d38a335d47f1632000db5172877499ff0184d114 (diff) |
Freestyle Python API improvements - part 8.
* Proper handling of keyword arguments was implemented in Operators and ContextFunctions,
as well as in methods of Interface0D, Interface1D, Iterator, their subclasses, Noise and
IntegrationType.
* Operators' methods and functions in the ContextFunctions module were renamed from
CamelCase to lower cases + underscores. Style modules were updated accordingly.
* Additional code clean-up was also made.
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface0D/ViewVertex')
-rw-r--r-- | source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp index 7cf6e0571d5..e6285371c77 100644 --- a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp @@ -74,20 +74,21 @@ static int TVertex_init(BPy_TVertex *self, PyObject *args, PyObject *kwds) } PyDoc_STRVAR(TVertex_get_svertex_doc, -".. method:: get_svertex(iFEdge)\n" +".. method:: get_svertex(fedge)\n" "\n" " Returns the SVertex (among the 2) belonging to the given FEdge.\n" "\n" -" :arg iFEdge: An FEdge object.\n" -" :type iFEdge: :class:`FEdge`\n" +" :arg fedge: An FEdge object.\n" +" :type fedge: :class:`FEdge`\n" " :return: The SVertex belonging to the given FEdge.\n" " :rtype: :class:`SVertex`"); -static PyObject * TVertex_get_svertex( BPy_TVertex *self, PyObject *args) +static PyObject * TVertex_get_svertex( BPy_TVertex *self, PyObject *args, PyObject *kwds) { + static const char *kwlist[] = {"fedge", NULL}; PyObject *py_fe; - if (!PyArg_ParseTuple(args, "O!", &FEdge_Type, &py_fe)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &FEdge_Type, &py_fe)) return NULL; SVertex *sv = self->tv->getSVertex(((BPy_FEdge *)py_fe)->fe); if (sv) @@ -96,22 +97,23 @@ static PyObject * TVertex_get_svertex( BPy_TVertex *self, PyObject *args) } PyDoc_STRVAR(TVertex_get_mate_doc, -".. method:: get_mate(iEdgeA)\n" +".. method:: get_mate(viewedge)\n" "\n" " Returns the mate edge of the ViewEdge given as argument. If the\n" " ViewEdge is frontEdgeA, frontEdgeB is returned. If the ViewEdge is\n" " frontEdgeB, frontEdgeA is returned. Same for back edges.\n" "\n" -" :arg iEdgeA: A ViewEdge object.\n" -" :type iEdgeA: :class:`ViewEdge`\n" +" :arg viewedge: A ViewEdge object.\n" +" :type viewedge: :class:`ViewEdge`\n" " :return: The mate edge of the given ViewEdge.\n" " :rtype: :class:`ViewEdge`"); -static PyObject * TVertex_get_mate( BPy_TVertex *self, PyObject *args) +static PyObject * TVertex_get_mate( BPy_TVertex *self, PyObject *args, PyObject *kwds) { + static const char *kwlist[] = {"viewedge", NULL}; PyObject *py_ve; - if (!PyArg_ParseTuple(args, "O!", &ViewEdge_Type, &py_ve)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &ViewEdge_Type, &py_ve)) return NULL; ViewEdge *ve = self->tv->mate(((BPy_ViewEdge *)py_ve)->ve); if (ve) @@ -120,8 +122,8 @@ static PyObject * TVertex_get_mate( BPy_TVertex *self, PyObject *args) } static PyMethodDef BPy_TVertex_methods[] = { - {"get_svertex", (PyCFunction)TVertex_get_svertex, METH_VARARGS, TVertex_get_svertex_doc}, - {"get_mate", (PyCFunction)TVertex_get_mate, METH_VARARGS, TVertex_get_mate_doc}, + {"get_svertex", (PyCFunction)TVertex_get_svertex, METH_VARARGS | METH_KEYWORDS, TVertex_get_svertex_doc}, + {"get_mate", (PyCFunction)TVertex_get_mate, METH_VARARGS | METH_KEYWORDS, TVertex_get_mate_doc}, {NULL, NULL, 0, NULL} }; |