diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-08 03:17:23 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-08 03:17:23 +0400 |
commit | 4a92d82626980d6d1690113b9d27aae282fd48eb (patch) | |
tree | d690f59c72441272ed462fe59d416a9a255d087e /source/blender/freestyle/intern/python/Interface1D | |
parent | b4b22699850a859d601bb4851d0af18f568b3061 (diff) |
A big code clean-up patch from Bastien Montagne, many thanks!
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface1D')
7 files changed, 99 insertions, 67 deletions
diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp index d2b965ad0e6..0260199ccee 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp @@ -320,10 +320,14 @@ static int FEdge_nature_set(BPy_FEdge *self, PyObject *value, void *UNUSED(closu } static PyGetSetDef BPy_FEdge_getseters[] = { - {(char *)"first_svertex", (getter)FEdge_first_svertex_get, (setter)FEdge_first_svertex_set, (char *)FEdge_first_svertex_doc, NULL}, - {(char *)"second_svertex", (getter)FEdge_second_svertex_get, (setter)FEdge_second_svertex_set, (char *)FEdge_second_svertex_doc, NULL}, - {(char *)"next_fedge", (getter)FEdge_next_fedge_get, (setter)FEdge_next_fedge_set, (char *)FEdge_next_fedge_doc, NULL}, - {(char *)"previous_fedge", (getter)FEdge_previous_fedge_get, (setter)FEdge_previous_fedge_set, (char *)FEdge_previous_fedge_doc, NULL}, + {(char *)"first_svertex", (getter)FEdge_first_svertex_get, (setter)FEdge_first_svertex_set, + (char *)FEdge_first_svertex_doc, NULL}, + {(char *)"second_svertex", (getter)FEdge_second_svertex_get, (setter)FEdge_second_svertex_set, + (char *)FEdge_second_svertex_doc, NULL}, + {(char *)"next_fedge", (getter)FEdge_next_fedge_get, (setter)FEdge_next_fedge_set, + (char *)FEdge_next_fedge_doc, NULL}, + {(char *)"previous_fedge", (getter)FEdge_previous_fedge_get, (setter)FEdge_previous_fedge_set, + (char *)FEdge_previous_fedge_doc, NULL}, {(char *)"viewedge", (getter)FEdge_viewedge_get, (setter)FEdge_viewedge_set, (char *)FEdge_viewedge_doc, NULL}, {(char *)"is_smooth", (getter)FEdge_is_smooth_get, (setter)FEdge_is_smooth_set, (char *)FEdge_is_smooth_doc, NULL}, {(char *)"id", (getter)FEdge_id_get, (setter)FEdge_id_set, (char *)FEdge_id_doc, NULL}, diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp index 368b6f80de3..7026d93774a 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp @@ -103,7 +103,7 @@ PyDoc_STRVAR(FrsCurve_push_vertex_back_doc, " :arg vertex: A vertex object.\n" " :type vertex: :class:`SVertex` or :class:`CurvePoint`"); -static PyObject * FrsCurve_push_vertex_back(BPy_FrsCurve *self, PyObject *args, PyObject *kwds) +static PyObject *FrsCurve_push_vertex_back(BPy_FrsCurve *self, PyObject *args, PyObject *kwds) { static const char *kwlist[] = {"vertex", NULL}; PyObject *obj = 0; @@ -132,7 +132,7 @@ PyDoc_STRVAR(FrsCurve_push_vertex_front_doc, " :arg vertex: A vertex object.\n" " :type vertex: :class:`SVertex` or :class:`CurvePoint`"); -static PyObject * FrsCurve_push_vertex_front(BPy_FrsCurve *self, PyObject *args, PyObject *kwds) +static PyObject *FrsCurve_push_vertex_front(BPy_FrsCurve *self, PyObject *args, PyObject *kwds) { static const char *kwlist[] = {"vertex", NULL}; PyObject *obj = 0; @@ -153,9 +153,11 @@ static PyObject * FrsCurve_push_vertex_front(BPy_FrsCurve *self, PyObject *args, Py_RETURN_NONE; } -static PyMethodDef BPy_FrsCurve_methods[] = { - {"push_vertex_back", (PyCFunction)FrsCurve_push_vertex_back, METH_VARARGS | METH_KEYWORDS, FrsCurve_push_vertex_back_doc}, - {"push_vertex_front", (PyCFunction)FrsCurve_push_vertex_front, METH_VARARGS | METH_KEYWORDS, FrsCurve_push_vertex_front_doc}, +static PyMethodDef BPy_FrsCurve_methods[] = { + {"push_vertex_back", (PyCFunction)FrsCurve_push_vertex_back, METH_VARARGS | METH_KEYWORDS, + FrsCurve_push_vertex_back_doc}, + {"push_vertex_front", (PyCFunction)FrsCurve_push_vertex_front, METH_VARARGS | METH_KEYWORDS, + FrsCurve_push_vertex_front_doc}, {NULL, NULL, 0, NULL} }; @@ -183,7 +185,8 @@ static PyObject *FrsCurve_segments_size_get(BPy_FrsCurve *self, void *UNUSED(clo static PyGetSetDef BPy_FrsCurve_getseters[] = { {(char *)"is_empty", (getter)FrsCurve_is_empty_get, (setter)NULL, (char *)FrsCurve_is_empty_doc, NULL}, - {(char *)"segments_size", (getter)FrsCurve_segments_size_get, (setter)NULL, (char *)FrsCurve_segments_size_doc, NULL}, + {(char *)"segments_size", (getter)FrsCurve_segments_size_get, (setter)NULL, + (char *)FrsCurve_segments_size_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp index 0cc12373eac..53ec86f3c01 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp @@ -84,7 +84,7 @@ static int Stroke_init(BPy_Stroke *self, PyObject *args, PyObject *kwds) return 0; } -static PyObject * Stroke_iter(PyObject *self) +static PyObject *Stroke_iter(PyObject *self) { StrokeInternal::StrokeVertexIterator sv_it( ((BPy_Stroke *)self)->s->strokeVerticesBegin() ); return BPy_StrokeVertexIterator_from_StrokeVertexIterator( sv_it, 0 ); @@ -121,7 +121,7 @@ PyDoc_STRVAR(Stroke_compute_sampling_doc, " method.\n" " :rtype: float"); -static PyObject * Stroke_compute_sampling(BPy_Stroke *self, PyObject *args, PyObject *kwds) +static PyObject *Stroke_compute_sampling(BPy_Stroke *self, PyObject *args, PyObject *kwds) { static const char *kwlist[] = {"n", NULL}; int i; @@ -150,20 +150,17 @@ PyDoc_STRVAR(Stroke_resample_doc, " :arg sampling: The new sampling value.\n" " :type sampling: float"); -static PyObject * Stroke_resample(BPy_Stroke *self, PyObject *args, PyObject *kwds) +static PyObject *Stroke_resample(BPy_Stroke *self, PyObject *args, PyObject *kwds) { static const char *kwlist_1[] = {"n", NULL}; static const char *kwlist_2[] = {"sampling", NULL}; int i; float f; - if (PyArg_ParseTupleAndKeywords(args, kwds, "i", (char **)kwlist_1, &i)) - { + if (PyArg_ParseTupleAndKeywords(args, kwds, "i", (char **)kwlist_1, &i)) { self->s->Resample(i); } - else if (PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist_2, &f)) - { + else if (PyErr_Clear(), PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist_2, &f)) { self->s->Resample(f); } else { @@ -186,7 +183,7 @@ PyDoc_STRVAR(Stroke_insert_vertex_doc, " before which vertex must be inserted.\n" " :type next: :class:`StrokeVertexIterator`"); -static PyObject * Stroke_insert_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds) +static PyObject *Stroke_insert_vertex(BPy_Stroke *self, PyObject *args, PyObject *kwds) { static const char *kwlist[] = {"vertex", "next", NULL}; PyObject *py_sv = 0, *py_sv_it = 0; @@ -211,7 +208,7 @@ PyDoc_STRVAR(Stroke_remove_vertex_doc, " :arg vertex: the StrokeVertex to remove from the Stroke.\n" " :type vertex: :class:`StrokeVertex`"); -static PyObject * Stroke_remove_vertex( BPy_Stroke *self, PyObject *args, PyObject *kwds) +static PyObject *Stroke_remove_vertex( BPy_Stroke *self, PyObject *args, PyObject *kwds) { static const char *kwlist[] = {"vertex", NULL}; PyObject *py_sv = 0; @@ -220,7 +217,8 @@ static PyObject * Stroke_remove_vertex( BPy_Stroke *self, PyObject *args, PyObje return NULL; if (((BPy_StrokeVertex *)py_sv)->sv) { self->s->RemoveVertex(((BPy_StrokeVertex *)py_sv)->sv); - } else { + } + else { PyErr_SetString(PyExc_TypeError, "invalid argument"); return NULL; } @@ -232,7 +230,7 @@ PyDoc_STRVAR(Stroke_update_length_doc, "\n" " Updates the 2D length of the Stroke."); -static PyObject * Stroke_update_length(BPy_Stroke *self) +static PyObject *Stroke_update_length(BPy_Stroke *self) { self->s->UpdateLength(); Py_RETURN_NONE; @@ -251,7 +249,7 @@ PyDoc_STRVAR(Stroke_stroke_vertices_begin_doc, " :return: A StrokeVertexIterator pointing on the first StrokeVertex.\n" " :rtype: :class:`StrokeVertexIterator`"); -static PyObject * Stroke_stroke_vertices_begin( BPy_Stroke *self , PyObject *args, PyObject *kwds) +static PyObject *Stroke_stroke_vertices_begin(BPy_Stroke *self, PyObject *args, PyObject *kwds) { static const char *kwlist[] = {"t", NULL}; float f = 0.0f; @@ -271,7 +269,7 @@ PyDoc_STRVAR(Stroke_stroke_vertices_end_doc, " :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n" " :rtype: :class:`StrokeVertexIterator`"); -static PyObject * Stroke_stroke_vertices_end(BPy_Stroke *self) +static PyObject *Stroke_stroke_vertices_end(BPy_Stroke *self) { StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesEnd()); return BPy_StrokeVertexIterator_from_StrokeVertexIterator(sv_it, 1); @@ -285,18 +283,20 @@ PyDoc_STRVAR(Stroke_stroke_vertices_size_doc, " :return: The number of stroke vertices.\n" " :rtype: int"); -static PyObject * Stroke_stroke_vertices_size(BPy_Stroke *self) +static PyObject *Stroke_stroke_vertices_size(BPy_Stroke *self) { return PyLong_FromLong(self->s->strokeVerticesSize()); } static PyMethodDef BPy_Stroke_methods[] = { - {"compute_sampling", (PyCFunction)Stroke_compute_sampling, METH_VARARGS | METH_KEYWORDS, Stroke_compute_sampling_doc}, + {"compute_sampling", (PyCFunction)Stroke_compute_sampling, METH_VARARGS | METH_KEYWORDS, + Stroke_compute_sampling_doc}, {"resample", (PyCFunction)Stroke_resample, METH_VARARGS | METH_KEYWORDS, Stroke_resample_doc}, {"remove_vertex", (PyCFunction)Stroke_remove_vertex, METH_VARARGS | METH_KEYWORDS, Stroke_remove_vertex_doc}, {"insert_vertex", (PyCFunction)Stroke_insert_vertex, METH_VARARGS | METH_KEYWORDS, Stroke_insert_vertex_doc}, {"update_length", (PyCFunction)Stroke_update_length, METH_NOARGS, Stroke_update_length_doc}, - {"stroke_vertices_begin", (PyCFunction)Stroke_stroke_vertices_begin, METH_VARARGS | METH_KEYWORDS, Stroke_stroke_vertices_begin_doc}, + {"stroke_vertices_begin", (PyCFunction)Stroke_stroke_vertices_begin, METH_VARARGS | METH_KEYWORDS, + Stroke_stroke_vertices_begin_doc}, {"stroke_vertices_end", (PyCFunction)Stroke_stroke_vertices_end, METH_NOARGS, Stroke_stroke_vertices_end_doc}, {"stroke_vertices_size", (PyCFunction)Stroke_stroke_vertices_size, METH_NOARGS, Stroke_stroke_vertices_size_doc}, {NULL, NULL, 0, NULL} @@ -337,7 +337,7 @@ static PyObject *Stroke_texture_id_get(BPy_Stroke *self, void *UNUSED(closure)) static int Stroke_texture_id_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure)) { unsigned int i = PyLong_AsUnsignedLong(value); - if(PyErr_Occurred()) + if (PyErr_Occurred()) return -1; self->s->setTextureId(i); return 0; @@ -404,10 +404,13 @@ static int Stroke_id_set(BPy_Stroke *self, PyObject *value, void *UNUSED(closure } static PyGetSetDef BPy_Stroke_getseters[] = { - {(char *)"medium_type", (getter)Stroke_medium_type_get, (setter)Stroke_medium_type_set, (char *)Stroke_medium_type_doc, NULL}, - {(char *)"texture_id", (getter)Stroke_texture_id_get, (setter)Stroke_texture_id_set, (char *)Stroke_texture_id_doc, NULL}, + {(char *)"medium_type", (getter)Stroke_medium_type_get, (setter)Stroke_medium_type_set, + (char *)Stroke_medium_type_doc, NULL}, + {(char *)"texture_id", (getter)Stroke_texture_id_get, (setter)Stroke_texture_id_set, + (char *)Stroke_texture_id_doc, NULL}, {(char *)"tips", (getter)Stroke_tips_get, (setter)Stroke_tips_set, (char *)Stroke_tips_doc, NULL}, - {(char *)"length_2d", (getter)Stroke_length_2d_get, (setter)Stroke_length_2d_set, (char *)Stroke_length_2d_doc, NULL}, + {(char *)"length_2d", (getter)Stroke_length_2d_get, (setter)Stroke_length_2d_set, + (char *)Stroke_length_2d_doc, NULL}, {(char *)"id", (getter)Stroke_id_get, (setter)Stroke_id_set, (char *)Stroke_id_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp index a30cfc0a824..e264b3b6217 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp @@ -86,7 +86,7 @@ PyDoc_STRVAR(ViewEdge_update_fedges_doc, "\n" " Sets Viewedge to this for all embedded fedges.\n"); -static PyObject * ViewEdge_update_fedges(BPy_ViewEdge *self) +static PyObject *ViewEdge_update_fedges(BPy_ViewEdge *self) { self->ve->UpdateFEdges(); Py_RETURN_NONE; @@ -114,7 +114,7 @@ static PyObject *ViewEdge_first_viewvertex_get(BPy_ViewEdge *self, void *UNUSED( static int ViewEdge_first_viewvertex_set(BPy_ViewEdge *self, PyObject *value, void *UNUSED(closure)) { - if(!BPy_ViewVertex_Check(value)) + if (!BPy_ViewVertex_Check(value)) return -1; self->ve->setA(((BPy_ViewVertex *)value)->vv); return 0; @@ -135,7 +135,7 @@ static PyObject *ViewEdge_last_viewvertex_get(BPy_ViewEdge *self, void *UNUSED(c static int ViewEdge_last_viewvertex_set(BPy_ViewEdge *self, PyObject *value, void *UNUSED(closure)) { - if(!BPy_ViewVertex_Check(value)) + if (!BPy_ViewVertex_Check(value)) return -1; self->ve->setB(((BPy_ViewVertex *)value)->vv); return 0; @@ -156,7 +156,7 @@ static PyObject *ViewEdge_first_fedge_get(BPy_ViewEdge *self, void *UNUSED(closu static int ViewEdge_first_fedge_set(BPy_ViewEdge *self, PyObject *value, void *UNUSED(closure)) { - if(!BPy_FEdge_Check(value)) + if (!BPy_FEdge_Check(value)) return -1; self->ve->setFEdgeA(((BPy_FEdge *)value)->fe); return 0; @@ -177,7 +177,7 @@ static PyObject *ViewEdge_last_fedge_get(BPy_ViewEdge *self, void *UNUSED(closur static int ViewEdge_last_fedge_set(BPy_ViewEdge *self, PyObject *value, void *UNUSED(closure)) { - if(!BPy_FEdge_Check(value)) + if (!BPy_FEdge_Check(value)) return -1; self->ve->setFEdgeB(((BPy_FEdge *)value)->fe); return 0; @@ -220,7 +220,7 @@ static PyObject *ViewEdge_occludee_get(BPy_ViewEdge *self, void *UNUSED(closure) static int ViewEdge_occludee_set(BPy_ViewEdge *self, PyObject *value, void *UNUSED(closure)) { - if(!BPy_ViewShape_Check(value)) + if (!BPy_ViewShape_Check(value)) return -1; self->ve->setaShape(((BPy_ViewShape *)value)->vs); return 0; @@ -291,7 +291,7 @@ static int ViewEdge_qi_set(BPy_ViewEdge *self, PyObject *value, void *UNUSED(clo { int qi; - if((qi = PyLong_AsLong(value)) == -1 && PyErr_Occurred()) + if ((qi = PyLong_AsLong(value)) == -1 && PyErr_Occurred()) return -1; self->ve->setQI(qi); return 0; @@ -318,17 +318,24 @@ static int ViewEdge_chaining_time_stamp_set(BPy_ViewEdge *self, PyObject *value, } static PyGetSetDef BPy_ViewEdge_getseters[] = { - {(char *)"first_viewvertex", (getter)ViewEdge_first_viewvertex_get, (setter)ViewEdge_first_viewvertex_set, (char *)ViewEdge_first_viewvertex_doc, NULL}, - {(char *)"last_viewvertex", (getter)ViewEdge_last_viewvertex_get, (setter)ViewEdge_last_viewvertex_set, (char *)ViewEdge_last_viewvertex_doc, NULL}, - {(char *)"first_fedge", (getter)ViewEdge_first_fedge_get, (setter)ViewEdge_first_fedge_set, (char *)ViewEdge_first_fedge_doc, NULL}, - {(char *)"last_fedge", (getter)ViewEdge_last_fedge_get, (setter)ViewEdge_last_fedge_set, (char *)ViewEdge_last_fedge_doc, NULL}, - {(char *)"viewshape", (getter)ViewEdge_viewshape_get, (setter)ViewEdge_viewshape_set, (char *)ViewEdge_viewshape_doc, NULL}, - {(char *)"occludee", (getter)ViewEdge_occludee_get, (setter)ViewEdge_occludee_set, (char *)ViewEdge_occludee_doc, NULL}, + {(char *)"first_viewvertex", (getter)ViewEdge_first_viewvertex_get, (setter)ViewEdge_first_viewvertex_set, + (char *)ViewEdge_first_viewvertex_doc, NULL}, + {(char *)"last_viewvertex", (getter)ViewEdge_last_viewvertex_get, (setter)ViewEdge_last_viewvertex_set, + (char *)ViewEdge_last_viewvertex_doc, NULL}, + {(char *)"first_fedge", (getter)ViewEdge_first_fedge_get, (setter)ViewEdge_first_fedge_set, + (char *)ViewEdge_first_fedge_doc, NULL}, + {(char *)"last_fedge", (getter)ViewEdge_last_fedge_get, (setter)ViewEdge_last_fedge_set, + (char *)ViewEdge_last_fedge_doc, NULL}, + {(char *)"viewshape", (getter)ViewEdge_viewshape_get, (setter)ViewEdge_viewshape_set, + (char *)ViewEdge_viewshape_doc, NULL}, + {(char *)"occludee", (getter)ViewEdge_occludee_get, (setter)ViewEdge_occludee_set, + (char *)ViewEdge_occludee_doc, NULL}, {(char *)"is_closed", (getter)ViewEdge_is_closed_get, (setter)NULL, (char *)ViewEdge_is_closed_doc, NULL}, {(char *)"id", (getter)ViewEdge_id_get, (setter)ViewEdge_id_set, (char *)ViewEdge_id_doc, NULL}, {(char *)"nature", (getter)ViewEdge_nature_get, (setter)ViewEdge_nature_set, (char *)ViewEdge_nature_doc, NULL}, {(char *)"qi", (getter)ViewEdge_qi_get, (setter)ViewEdge_qi_set, (char *)ViewEdge_qi_doc, NULL}, - {(char *)"chaining_time_stamp", (getter)ViewEdge_chaining_time_stamp_get, (setter)ViewEdge_chaining_time_stamp_set, (char *)ViewEdge_chaining_time_stamp_doc, NULL}, + {(char *)"chaining_time_stamp", (getter)ViewEdge_chaining_time_stamp_get, (setter)ViewEdge_chaining_time_stamp_set, + (char *)ViewEdge_chaining_time_stamp_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; diff --git a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp index 64e65417579..4a4e0c06fa8 100644 --- a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp @@ -106,7 +106,7 @@ PyDoc_STRVAR(Chain_push_viewedge_back_doc, " processed.\n" " :type orientation: bool"); -static PyObject * Chain_push_viewedge_back(BPy_Chain *self, PyObject *args, PyObject *kwds) +static PyObject *Chain_push_viewedge_back(BPy_Chain *self, PyObject *args, PyObject *kwds) { static const char *kwlist[] = {"viewedge", "orientation", NULL}; PyObject *obj1 = 0, *obj2 = 0; @@ -133,7 +133,7 @@ PyDoc_STRVAR(Chain_push_viewedge_front_doc, " processed.\n" " :type orientation: bool"); -static PyObject * Chain_push_viewedge_front(BPy_Chain *self, PyObject *args, PyObject *kwds) +static PyObject *Chain_push_viewedge_front(BPy_Chain *self, PyObject *args, PyObject *kwds) { static const char *kwlist[] = {"viewedge", "orientation", NULL}; PyObject *obj1 = 0, *obj2 = 0; @@ -149,9 +149,11 @@ static PyObject * Chain_push_viewedge_front(BPy_Chain *self, PyObject *args, PyO Py_RETURN_NONE; } -static PyMethodDef BPy_Chain_methods[] = { - {"push_viewedge_back", (PyCFunction)Chain_push_viewedge_back, METH_VARARGS | METH_KEYWORDS, Chain_push_viewedge_back_doc}, - {"push_viewedge_front", (PyCFunction)Chain_push_viewedge_front, METH_VARARGS | METH_KEYWORDS, Chain_push_viewedge_front_doc}, +static PyMethodDef BPy_Chain_methods[] = { + {"push_viewedge_back", (PyCFunction)Chain_push_viewedge_back, METH_VARARGS | METH_KEYWORDS, + Chain_push_viewedge_back_doc}, + {"push_viewedge_front", (PyCFunction)Chain_push_viewedge_front, METH_VARARGS | METH_KEYWORDS, + Chain_push_viewedge_front_doc}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp index f50abdbe44d..183e86a237e 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp @@ -284,7 +284,7 @@ static PyObject *FEdgeSharp_material_index_right_get(BPy_FEdgeSharp *self, void static int FEdgeSharp_material_index_right_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure)) { unsigned int i = PyLong_AsUnsignedLong(value); - if(PyErr_Occurred()) + if (PyErr_Occurred()) return -1; self->fes->setaFrsMaterialIndex(i); return 0; @@ -303,7 +303,7 @@ static PyObject *FEdgeSharp_material_index_left_get(BPy_FEdgeSharp *self, void * static int FEdgeSharp_material_index_left_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure)) { unsigned int i = PyLong_AsUnsignedLong(value); - if(PyErr_Occurred()) + if (PyErr_Occurred()) return -1; self->fes->setbFrsMaterialIndex(i); return 0; @@ -344,7 +344,7 @@ static PyObject *FEdgeSharp_face_mark_right_get(BPy_FEdgeSharp *self, void *UNUS static int FEdgeSharp_face_mark_right_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure)) { - if(!PyBool_Check(value)) + if (!PyBool_Check(value)) return -1; self->fes->setaFaceMark(bool_from_PyBool(value)); return 0; @@ -362,21 +362,31 @@ static PyObject *FEdgeSharp_face_mark_left_get(BPy_FEdgeSharp *self, void *UNUSE static int FEdgeSharp_face_mark_left_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure)) { - if(!PyBool_Check(value)) + if (!PyBool_Check(value)) return -1; self->fes->setbFaceMark(bool_from_PyBool(value)); return 0; } static PyGetSetDef BPy_FEdgeSharp_getseters[] = { - {(char *)"normal_right", (getter)FEdgeSharp_normal_right_get, (setter)FEdgeSharp_normal_right_set, (char *)FEdgeSharp_normal_right_doc, NULL}, - {(char *)"normal_left", (getter)FEdgeSharp_normal_left_get, (setter)FEdgeSharp_normal_left_set, (char *)FEdgeSharp_normal_left_doc, NULL}, - {(char *)"material_index_right", (getter)FEdgeSharp_material_index_right_get, (setter)FEdgeSharp_material_index_right_set, (char *)FEdgeSharp_material_index_right_doc, NULL}, - {(char *)"material_index_left", (getter)FEdgeSharp_material_index_left_get, (setter)FEdgeSharp_material_index_left_set, (char *)FEdgeSharp_material_index_left_doc, NULL}, - {(char *)"material_right", (getter)FEdgeSharp_material_right_get, (setter)NULL, (char *)FEdgeSharp_material_right_doc, NULL}, - {(char *)"material_left", (getter)FEdgeSharp_material_left_get, (setter)NULL, (char *)FEdgeSharp_material_left_doc, NULL}, - {(char *)"face_mark_right", (getter)FEdgeSharp_face_mark_right_get, (setter)FEdgeSharp_face_mark_right_set, (char *)FEdgeSharp_face_mark_right_doc, NULL}, - {(char *)"face_mark_left", (getter)FEdgeSharp_face_mark_left_get, (setter)FEdgeSharp_face_mark_left_set, (char *)FEdgeSharp_face_mark_left_doc, NULL}, + {(char *)"normal_right", (getter)FEdgeSharp_normal_right_get, (setter)FEdgeSharp_normal_right_set, + (char *)FEdgeSharp_normal_right_doc, NULL}, + {(char *)"normal_left", (getter)FEdgeSharp_normal_left_get, (setter)FEdgeSharp_normal_left_set, + (char *)FEdgeSharp_normal_left_doc, NULL}, + {(char *)"material_index_right", (getter)FEdgeSharp_material_index_right_get, + (setter)FEdgeSharp_material_index_right_set, + (char *)FEdgeSharp_material_index_right_doc, NULL}, + {(char *)"material_index_left", (getter)FEdgeSharp_material_index_left_get, + (setter)FEdgeSharp_material_index_left_set, + (char *)FEdgeSharp_material_index_left_doc, NULL}, + {(char *)"material_right", (getter)FEdgeSharp_material_right_get, (setter)NULL, + (char *)FEdgeSharp_material_right_doc, NULL}, + {(char *)"material_left", (getter)FEdgeSharp_material_left_get, (setter)NULL, + (char *)FEdgeSharp_material_left_doc, NULL}, + {(char *)"face_mark_right", (getter)FEdgeSharp_face_mark_right_get, (setter)FEdgeSharp_face_mark_right_set, + (char *)FEdgeSharp_face_mark_right_doc, NULL}, + {(char *)"face_mark_left", (getter)FEdgeSharp_face_mark_left_get, (setter)FEdgeSharp_face_mark_left_set, + (char *)FEdgeSharp_face_mark_left_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp index a03c4a2d0bd..14b9b66b35c 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp @@ -193,7 +193,7 @@ static PyObject *FEdgeSmooth_material_index_get(BPy_FEdgeSmooth *self, void *UNU static int FEdgeSmooth_material_index_set(BPy_FEdgeSmooth *self, PyObject *value, void *UNUSED(closure)) { unsigned int i = PyLong_AsUnsignedLong(value); - if(PyErr_Occurred()) + if (PyErr_Occurred()) return -1; self->fes->setFrsMaterialIndex(i); return 0; @@ -221,17 +221,20 @@ static PyObject *FEdgeSmooth_face_mark_get(BPy_FEdgeSmooth *self, void *UNUSED(c static int FEdgeSmooth_face_mark_set(BPy_FEdgeSmooth *self, PyObject *value, void *UNUSED(closure)) { - if(!PyBool_Check(value)) + if (!PyBool_Check(value)) return -1; self->fes->setFaceMark(bool_from_PyBool(value)); return 0; } static PyGetSetDef BPy_FEdgeSmooth_getseters[] = { - {(char *)"normal", (getter)FEdgeSmooth_normal_get, (setter)FEdgeSmooth_normal_set, (char *)FEdgeSmooth_normal_doc, NULL}, - {(char *)"material_index", (getter)FEdgeSmooth_material_index_get, (setter)FEdgeSmooth_material_index_set, (char *)FEdgeSmooth_material_index_doc, NULL}, + {(char *)"normal", (getter)FEdgeSmooth_normal_get, (setter)FEdgeSmooth_normal_set, + (char *)FEdgeSmooth_normal_doc, NULL}, + {(char *)"material_index", (getter)FEdgeSmooth_material_index_get, (setter)FEdgeSmooth_material_index_set, + (char *)FEdgeSmooth_material_index_doc, NULL}, {(char *)"material", (getter)FEdgeSmooth_material_get, (setter)NULL, (char *)FEdgeSmooth_material_doc, NULL}, - {(char *)"face_mark", (getter)FEdgeSmooth_face_mark_get, (setter)FEdgeSmooth_face_mark_set, (char *)FEdgeSmooth_face_mark_doc, NULL}, + {(char *)"face_mark", (getter)FEdgeSmooth_face_mark_get, (setter)FEdgeSmooth_face_mark_set, + (char *)FEdgeSmooth_face_mark_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; |