Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-24 06:39:38 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-24 06:39:38 +0400
commit3df023ae82eef0ea105dc61c9730af87b59a07d1 (patch)
tree2d2a4e753c1129fc91f360f0457d30859cd38737 /source/blender/freestyle/intern/python/BPy_SShape.cpp
parentd38a335d47f1632000db5172877499ff0184d114 (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/BPy_SShape.cpp')
-rw-r--r--source/blender/freestyle/intern/python/BPy_SShape.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_SShape.cpp b/source/blender/freestyle/intern/python/BPy_SShape.cpp
index 47b83d2582f..7d03ea06bc0 100644
--- a/source/blender/freestyle/intern/python/BPy_SShape.cpp
+++ b/source/blender/freestyle/intern/python/BPy_SShape.cpp
@@ -102,37 +102,39 @@ static PyObject * SShape_repr(BPy_SShape *self)
}
static char SShape_add_edge_doc[] =
-".. method:: add_edge(iEdge)\n"
+".. method:: add_edge(edge)\n"
"\n"
" Adds an FEdge to the list of FEdges.\n"
"\n"
-" :arg iEdge: An FEdge object.\n"
-" :type iEdge: :class:`FEdge`\n";
+" :arg edge: An FEdge object.\n"
+" :type edge: :class:`FEdge`\n";
-static PyObject * SShape_add_edge(BPy_SShape *self , PyObject *args)
+static PyObject * SShape_add_edge(BPy_SShape *self , PyObject *args, PyObject *kwds)
{
+ static const char *kwlist[] = {"edge", NULL};
PyObject *py_fe = 0;
- if (!PyArg_ParseTuple(args, "O!", &FEdge_Type, &py_fe))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &FEdge_Type, &py_fe))
return NULL;
self->ss->AddEdge(((BPy_FEdge *)py_fe)->fe);
Py_RETURN_NONE;
}
PyDoc_STRVAR(SShape_add_vertex_doc,
-".. method:: add_vertex(iv)\n"
+".. method:: add_vertex(vertex)\n"
"\n"
" Adds an SVertex to the list of SVertex of this Shape. The SShape\n"
" attribute of the SVertex is also set to this SShape.\n"
"\n"
-" :arg iv: An SVertex object.\n"
-" :type iv: :class:`SVertex`");
+" :arg vertex: An SVertex object.\n"
+" :type vertex: :class:`SVertex`");
-static PyObject * SShape_add_vertex(BPy_SShape *self , PyObject *args)
+static PyObject * SShape_add_vertex(BPy_SShape *self , PyObject *args, PyObject *kwds)
{
+ static const char *kwlist[] = {"edge", NULL};
PyObject *py_sv = 0;
- if (!PyArg_ParseTuple(args, "O!", &SVertex_Type, &py_sv))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &SVertex_Type, &py_sv))
return NULL;
self->ss->AddNewVertex(((BPy_SVertex *)py_sv)->sv);
Py_RETURN_NONE;
@@ -154,8 +156,8 @@ static PyObject * SShape_compute_bbox(BPy_SShape *self)
// void SetMaterials (const vector< Material > &iMaterials)
static PyMethodDef BPy_SShape_methods[] = {
- {"add_edge", (PyCFunction)SShape_add_edge, METH_VARARGS, SShape_add_edge_doc},
- {"add_vertex", (PyCFunction)SShape_add_vertex, METH_VARARGS, SShape_add_vertex_doc},
+ {"add_edge", (PyCFunction)SShape_add_edge, METH_VARARGS | METH_KEYWORDS, SShape_add_edge_doc},
+ {"add_vertex", (PyCFunction)SShape_add_vertex, METH_VARARGS | METH_KEYWORDS, SShape_add_vertex_doc},
{"compute_bbox", (PyCFunction)SShape_compute_bbox, METH_NOARGS, SShape_compute_bbox_doc},
{NULL, NULL, 0, NULL}
};