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_ViewVertex.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_ViewVertex.cpp')
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
index 696ab102270..1e5f70144c1 100644
--- a/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
@@ -76,8 +76,6 @@ PyDoc_STRVAR(ViewVertex_edges_begin_doc,
static PyObject * ViewVertex_edges_begin(BPy_ViewVertex *self)
{
- if (!self->vv)
- Py_RETURN_NONE;
ViewVertexInternal::orientedViewEdgeIterator ove_it(self->vv->edgesBegin());
return BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator(ove_it, 0);
}
@@ -94,8 +92,6 @@ PyDoc_STRVAR(ViewVertex_edges_end_doc,
static PyObject * ViewVertex_edges_end(BPy_ViewVertex *self)
{
#if 0
- if (!self->vv)
- Py_RETURN_NONE;
ViewVertexInternal::orientedViewEdgeIterator ove_it(self->vv->edgesEnd());
return BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator(ove_it, 1);
#else
@@ -105,23 +101,22 @@ static PyObject * ViewVertex_edges_end(BPy_ViewVertex *self)
}
PyDoc_STRVAR(ViewVertex_edges_iterator_doc,
-".. method:: edges_iterator(iEdge)\n"
+".. method:: edges_iterator(edge)\n"
"\n"
" Returns an orientedViewEdgeIterator pointing to the ViewEdge given\n"
" as argument.\n"
"\n"
-" :arg iEdge: A ViewEdge object.\n"
-" :type iEdge: :class:`ViewEdge`\n"
+" :arg edge: A ViewEdge object.\n"
+" :type edge: :class:`ViewEdge`\n"
" :return: An orientedViewEdgeIterator pointing to the given ViewEdge.\n"
" :rtype: :class:`orientedViewEdgeIterator`");
-static PyObject * ViewVertex_edges_iterator(BPy_ViewVertex *self, PyObject *args)
+static PyObject * ViewVertex_edges_iterator(BPy_ViewVertex *self, PyObject *args, PyObject *kwds)
{
+ static const char *kwlist[] = {"edge", NULL};
PyObject *py_ve;
- if (!self->vv)
- Py_RETURN_NONE;
- 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 = ((BPy_ViewEdge *)py_ve)->ve;
ViewVertexInternal::orientedViewEdgeIterator ove_it(self->vv->edgesIterator(ve));
@@ -131,7 +126,7 @@ static PyObject * ViewVertex_edges_iterator(BPy_ViewVertex *self, PyObject *args
static PyMethodDef BPy_ViewVertex_methods[] = {
{"edges_begin", (PyCFunction)ViewVertex_edges_begin, METH_NOARGS, ViewVertex_edges_begin_doc},
{"edges_end", (PyCFunction)ViewVertex_edges_end, METH_NOARGS, ViewVertex_edges_end_doc},
- {"edges_iterator", (PyCFunction)ViewVertex_edges_iterator, METH_VARARGS, ViewVertex_edges_iterator_doc},
+ {"edges_iterator", (PyCFunction)ViewVertex_edges_iterator, METH_VARARGS | METH_KEYWORDS, ViewVertex_edges_iterator_doc},
{NULL, NULL, 0, NULL}
};
@@ -212,4 +207,3 @@ PyTypeObject ViewVertex_Type = {
#ifdef __cplusplus
}
#endif
-