diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp index f4b8ca07d3f..08ad378ab75 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp @@ -65,10 +65,12 @@ static int SVertex_init(BPy_SVertex *self, PyObject *args, PyObject *kwds) float v[3]; if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist_1, &SVertex_Type, &obj)) { - if (!obj) + if (!obj) { self->sv = new SVertex(); - else + } + else { self->sv = new SVertex(*(((BPy_SVertex *)obj)->sv)); + } } else if (PyErr_Clear(), PyArg_ParseTupleAndKeywords( @@ -100,8 +102,9 @@ static PyObject *SVertex_add_normal(BPy_SVertex *self, PyObject *args, PyObject PyObject *py_normal; Vec3r n; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", (char **)kwlist, &py_normal)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", (char **)kwlist, &py_normal)) { return NULL; + } if (!Vec3r_ptr_from_PyObject(py_normal, n)) { PyErr_SetString(PyExc_TypeError, "argument 1 must be a 3D vector (either a list of 3 elements or Vector)"); @@ -124,8 +127,9 @@ static PyObject *SVertex_add_fedge(BPy_SVertex *self, PyObject *args, PyObject * static const char *kwlist[] = {"fedge", NULL}; PyObject *py_fe; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &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; } @@ -152,8 +156,9 @@ static PyMethodDef BPy_SVertex_methods[] = { static int SVertex_mathutils_check(BaseMathObject *bmo) { - if (!BPy_SVertex_Check(bmo->cb_user)) + if (!BPy_SVertex_Check(bmo->cb_user)) { return -1; + } return 0; } @@ -378,8 +383,9 @@ PyDoc_STRVAR(SVertex_viewvertex_doc, static PyObject *SVertex_viewvertex_get(BPy_SVertex *self, void *UNUSED(closure)) { ViewVertex *vv = self->sv->viewvertex(); - if (vv) + if (vv) { return Any_BPy_ViewVertex_from_ViewVertex(*vv); + } Py_RETURN_NONE; } @@ -399,8 +405,9 @@ PyDoc_STRVAR(SVertex_curvatures_doc, static PyObject *SVertex_curvatures_get(BPy_SVertex *self, void *UNUSED(closure)) { const CurvatureInfo *info = self->sv->getCurvatureInfo(); - if (!info) + if (!info) { Py_RETURN_NONE; + } Vec3r e1(info->e1.x(), info->e1.y(), info->e1.z()); Vec3r e2(info->e2.x(), info->e2.y(), info->e2.z()); Vec3r er(info->er.x(), info->er.y(), info->er.z()); |