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/Interface0D/BPy_SVertex.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/Interface0D/BPy_SVertex.cpp')
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
index 6cc16494b87..072a602cf29 100644
--- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
@@ -102,18 +102,20 @@ static int SVertex_init(BPy_SVertex *self, PyObject *args, PyObject *kwds)
}
PyDoc_STRVAR(SVertex_add_normal_doc,
-".. method:: add_normal(n)\n"
+".. method:: add_normal(normal)\n"
"\n"
" Adds a normal to the SVertex's set of normals. If the same normal\n"
" is already in the set, nothing changes.\n"
"\n"
-" :arg n: A three-dimensional vector.\n"
-" :type n: :class:`mathutils.Vector`, list or tuple of 3 real numbers");
+" :arg normal: A three-dimensional vector.\n"
+" :type normal: :class:`mathutils.Vector`, list or tuple of 3 real numbers");
-static PyObject *SVertex_add_normal( BPy_SVertex *self , PyObject *args) {
+static PyObject *SVertex_add_normal(BPy_SVertex *self , PyObject *args, PyObject *kwds)
+{
+ static const char *kwlist[] = {"normal", NULL};
PyObject *py_normal;
- if (!PyArg_ParseTuple(args, "O", &py_normal))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", (char **)kwlist, &py_normal))
return NULL;
Vec3r *n = Vec3r_ptr_from_PyObject(py_normal);
if (!n) {
@@ -127,29 +129,29 @@ static PyObject *SVertex_add_normal( BPy_SVertex *self , PyObject *args) {
}
PyDoc_STRVAR(SVertex_add_fedge_doc,
-".. method:: add_fedge(fe)\n"
+".. method:: add_fedge(fedge)\n"
"\n"
" Add an FEdge to the list of edges emanating from this SVertex.\n"
"\n"
-" :arg fe: An FEdge.\n"
-" :type fe: :class:`FEdge`");
+" :arg fedge: An FEdge.\n"
+" :type fedge: :class:`FEdge`");
-static PyObject *SVertex_add_fedge( BPy_SVertex *self , PyObject *args) {
+static PyObject *SVertex_add_fedge(BPy_SVertex *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;
-
self->sv->AddFEdge(((BPy_FEdge *)py_fe)->fe);
-
Py_RETURN_NONE;
}
// virtual bool operator== (const SVertex &brother)
static PyMethodDef BPy_SVertex_methods[] = {
- {"add_normal", (PyCFunction)SVertex_add_normal, METH_VARARGS, SVertex_add_normal_doc},
- {"add_fedge", (PyCFunction)SVertex_add_fedge, METH_VARARGS, SVertex_add_fedge_doc},
+ {"add_normal", (PyCFunction)SVertex_add_normal, METH_VARARGS | METH_KEYWORDS, SVertex_add_normal_doc},
+ {"add_fedge", (PyCFunction)SVertex_add_fedge, METH_VARARGS | METH_KEYWORDS, SVertex_add_fedge_doc},
{NULL, NULL, 0, NULL}
};