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:
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp')
-rw-r--r--source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp
index 262fdbc68c6..e122454c00d 100644
--- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp
+++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp
@@ -36,17 +36,20 @@ extern "C" {
int UnaryFunction1DEdgeNature_Init(PyObject *module)
{
- if (module == NULL)
+ if (module == NULL) {
return -1;
+ }
- if (PyType_Ready(&UnaryFunction1DEdgeNature_Type) < 0)
+ if (PyType_Ready(&UnaryFunction1DEdgeNature_Type) < 0) {
return -1;
+ }
Py_INCREF(&UnaryFunction1DEdgeNature_Type);
PyModule_AddObject(
module, "UnaryFunction1DEdgeNature", (PyObject *)&UnaryFunction1DEdgeNature_Type);
- if (PyType_Ready(&CurveNatureF1D_Type) < 0)
+ if (PyType_Ready(&CurveNatureF1D_Type) < 0) {
return -1;
+ }
Py_INCREF(&CurveNatureF1D_Type);
PyModule_AddObject(module, "CurveNatureF1D", (PyObject *)&CurveNatureF1D_Type);
@@ -81,11 +84,13 @@ static int UnaryFunction1DEdgeNature___init__(BPy_UnaryFunction1DEdgeNature *sel
PyObject *obj = 0;
if (!PyArg_ParseTupleAndKeywords(
- args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj))
+ args, kwds, "|O!", (char **)kwlist, &IntegrationType_Type, &obj)) {
return -1;
+ }
- if (!obj)
+ if (!obj) {
self->uf1D_edgenature = new UnaryFunction1D<Nature::EdgeNature>();
+ }
else {
self->uf1D_edgenature = new UnaryFunction1D<Nature::EdgeNature>(
IntegrationType_from_BPy_IntegrationType(obj));
@@ -98,8 +103,9 @@ static int UnaryFunction1DEdgeNature___init__(BPy_UnaryFunction1DEdgeNature *sel
static void UnaryFunction1DEdgeNature___dealloc__(BPy_UnaryFunction1DEdgeNature *self)
{
- if (self->uf1D_edgenature)
+ if (self->uf1D_edgenature) {
delete self->uf1D_edgenature;
+ }
UnaryFunction1D_Type.tp_dealloc((PyObject *)self);
}
@@ -116,8 +122,9 @@ static PyObject *UnaryFunction1DEdgeNature___call__(BPy_UnaryFunction1DEdgeNatur
static const char *kwlist[] = {"inter", NULL};
PyObject *obj = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Interface1D_Type, &obj))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Interface1D_Type, &obj)) {
return NULL;
+ }
if (typeid(*(self->uf1D_edgenature)) == typeid(UnaryFunction1D<Nature::EdgeNature>)) {
PyErr_SetString(PyExc_TypeError, "__call__ method not properly overridden");