From d4ff63fe20d912a72a7695852a204ab3f1d3dce7 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Mon, 3 Aug 2009 14:38:15 +0000 Subject: * Fixed uninitialized pointers in "__init__" methods of UnaryFunction1D types. There was a known issue for a long time that we occasionally encountered strange "TypeError: an integer is required" and "RuntimeWarning: tp_compare didn't return -1 or -2 for exception", as shown in the following unit test log. The source of the former error was PyInt_AsLong(obj) being used by IntegrationType_from_BPy_IntegrationType(obj), where "obj" was not properly initialized in "__init__" before the converter was called. The TypeError was left unattended for a while and showed up when a comparison occurred and the TypeError was detected, which resulted in the latter warning. > runTest (__main__.UnaryFunction1DDoubleInitTestCase) ... > .\blender:211: RuntimeWarning: tp_compare didn't return -1 or -2 for exception > ERROR > > ====================================================================== > ERROR: runTest (__main__.UnaryFunction1DDoubleInitTestCase) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "init_tests.py", line 211, in runTest > TypeError: an integer is required > > ---------------------------------------------------------------------- * Also removed unnecessary error messages in "__init__" methods of UnaryFunction1D types. --- .../intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp | 6 ++---- .../intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp | 6 ++---- .../intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp | 6 ++---- .../intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp | 6 ++---- .../intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp | 6 ++---- .../intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp | 6 ++---- .../python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp | 6 ++---- .../intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp | 6 ++---- .../UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp | 4 +--- .../UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp | 4 +--- .../UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp | 4 +--- .../UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp | 4 +--- .../UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp | 4 +--- .../UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp | 4 +--- .../UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp | 4 +--- .../UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp | 4 +--- .../UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp | 4 +--- .../UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp | 4 +--- .../UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp | 4 +--- .../UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp | 4 +--- .../UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp | 4 +--- .../python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp | 4 +--- .../python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp | 4 +--- .../python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp | 4 +--- .../UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp | 4 +--- .../UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp | 4 +--- .../BPy_QuantitativeInvisibilityF1D.cpp | 4 +--- 27 files changed, 35 insertions(+), 89 deletions(-) (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D') diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp index 23a30d3b541..b278cdfb592 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp @@ -217,12 +217,10 @@ PyMODINIT_FUNC UnaryFunction1DDouble_Init( PyObject *module ) { int UnaryFunction1DDouble___init__(BPy_UnaryFunction1DDouble* self, PyObject *args) { - PyObject *obj; + PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DDouble___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } if( !obj ) self->uf1D_double = new UnaryFunction1D(); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp index 4ff195ff2f0..49d51c89955 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp @@ -138,12 +138,10 @@ PyMODINIT_FUNC UnaryFunction1DEdgeNature_Init( PyObject *module ) { int UnaryFunction1DEdgeNature___init__(BPy_UnaryFunction1DEdgeNature* self, PyObject *args) { - PyObject *obj; + PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DEdgeNature___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } if( !obj ) self->uf1D_edgenature = new UnaryFunction1D(); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp index 1521258543d..dd793ce128c 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp @@ -131,12 +131,10 @@ PyMODINIT_FUNC UnaryFunction1DFloat_Init( PyObject *module ) { int UnaryFunction1DFloat___init__(BPy_UnaryFunction1DFloat* self, PyObject *args) { - PyObject *obj; + PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DFloat___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } if( !obj ) self->uf1D_float = new UnaryFunction1D(); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp index e00b259a7f9..76eff9c15ab 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp @@ -138,12 +138,10 @@ PyMODINIT_FUNC UnaryFunction1DUnsigned_Init( PyObject *module ) { int UnaryFunction1DUnsigned___init__(BPy_UnaryFunction1DUnsigned* self, PyObject *args) { - PyObject *obj; + PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DUnsigned___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } if( !obj ) self->uf1D_unsigned = new UnaryFunction1D(); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp index 4d234113da8..23c6af31ac7 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp @@ -144,12 +144,10 @@ PyMODINIT_FUNC UnaryFunction1DVec2f_Init( PyObject *module ) { int UnaryFunction1DVec2f___init__(BPy_UnaryFunction1DVec2f* self, PyObject *args) { - PyObject *obj; + PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DVec2f___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } if( !obj ) self->uf1D_vec2f = new UnaryFunction1D(); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp index 4765d631e86..37be2165652 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp @@ -138,12 +138,10 @@ PyMODINIT_FUNC UnaryFunction1DVec3f_Init( PyObject *module ) { int UnaryFunction1DVec3f___init__(BPy_UnaryFunction1DVec3f* self, PyObject *args) { - PyObject *obj; + PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DVec3f___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } if( !obj ) self->uf1D_vec3f = new UnaryFunction1D(); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp index 003082ba26e..ecdc44da135 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp @@ -151,12 +151,10 @@ PyMODINIT_FUNC UnaryFunction1DVectorViewShape_Init( PyObject *module ) { int UnaryFunction1DVectorViewShape___init__(BPy_UnaryFunction1DVectorViewShape* self, PyObject *args) { - PyObject *obj; + PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DVectorViewShape___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } if( !obj ) self->uf1D_vectorviewshape = new UnaryFunction1D< std::vector >(); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp index 989fdf53d5a..df594e8608e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp @@ -152,12 +152,10 @@ PyMODINIT_FUNC UnaryFunction1DVoid_Init( PyObject *module ) { int UnaryFunction1DVoid___init__(BPy_UnaryFunction1DVoid* self, PyObject *args) { - PyObject *obj; + PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: UnaryFunction1DVoid___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } if( !obj ) self->uf1D_void = new UnaryFunction1D_void(); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp index 0044f4b0864..b5eed1aaebc 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp @@ -104,10 +104,8 @@ int CurveNatureF1D___init__( BPy_CurveNatureF1D* self, PyObject *args) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: CurveNatureF1D___init__" << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_edgenature.uf1D_edgenature = new Functions1D::CurveNatureF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp index 2976ca213a5..4b8e5162408 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp @@ -104,10 +104,8 @@ int Normal2DF1D___init__( BPy_Normal2DF1D* self, PyObject *args) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: Normal2DF1D___init__" << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_vec2f.uf1D_vec2f = new Functions1D::Normal2DF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp index f2494af27e3..87dbef90c47 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp @@ -104,10 +104,8 @@ int Orientation2DF1D___init__( BPy_Orientation2DF1D* self, PyObject *args) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: Orientation2DF1D___init__" << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_vec2f.uf1D_vec2f = new Functions1D::Orientation2DF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp index fb26642643f..1d3c1b34539 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp @@ -104,10 +104,8 @@ int Orientation3DF1D___init__( BPy_Orientation3DF1D* self, PyObject *args) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: Orientation3DF1D___init__" << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_vec3f.uf1D_vec3f = new Functions1D::Orientation3DF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp index 02ff6bdcd80..6589bb49b4a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp @@ -104,10 +104,8 @@ int Curvature2DAngleF1D___init__( BPy_Curvature2DAngleF1D* self, PyObject *args) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: Curvature2DAngleF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::Curvature2DAngleF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp index ae3f09710bc..d0d72e334ec 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp @@ -106,10 +106,8 @@ int DensityF1D___init__( BPy_DensityF1D* self, PyObject *args) double d = 2.0; float f = 2.0; - if( !PyArg_ParseTuple(args, "|dO!f", &d, &IntegrationType_Type, &obj, &f) ) { - cout << "ERROR: DensityF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|dO!f", &d, &IntegrationType_Type, &obj, &f) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::DensityF1D(d,t,f); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp index 2df6e8cc2fd..ffa37d2bb51 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp @@ -106,10 +106,8 @@ int GetCompleteViewMapDensityF1D___init__( BPy_GetCompleteViewMapDensityF1D* sel unsigned i; float f = 2.0; - if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) { - cout << "ERROR: GetCompleteViewMapDensityF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetCompleteViewMapDensityF1D(i,t,f); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp index 6b0cd9d73a2..f519c4c2285 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp @@ -106,10 +106,8 @@ int GetDirectionalViewMapDensityF1D___init__( BPy_GetDirectionalViewMapDensityF1 unsigned int u1, u2; float f = 2.0; - if( !PyArg_ParseTuple(args, "II|O!f", &u1, &u2, &IntegrationType_Type, &obj, &f) ) { - cout << "ERROR: GetDirectionalViewMapDensityF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "II|O!f", &u1, &u2, &IntegrationType_Type, &obj, &f) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetDirectionalViewMapDensityF1D(u1, u2, t, f); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp index c6ae8099cec..4d84d89dc96 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp @@ -104,10 +104,8 @@ int GetProjectedXF1D___init__( BPy_GetProjectedXF1D* self, PyObject *args ) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: GetProjectedXF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedXF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp index bf466a7b674..916143ba07e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp @@ -104,10 +104,8 @@ int GetProjectedYF1D___init__( BPy_GetProjectedYF1D* self, PyObject *args ) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: GetProjectedYF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedYF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp index 423f6e2e892..96e789d3a9a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp @@ -104,10 +104,8 @@ int GetProjectedZF1D___init__( BPy_GetProjectedZF1D* self, PyObject *args ) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: GetProjectedZF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetProjectedZF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp index da36fb3c4f1..241dfbd2654 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp @@ -106,10 +106,8 @@ int GetSteerableViewMapDensityF1D___init__( BPy_GetSteerableViewMapDensityF1D* s int i; float f = 2.0; - if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) { - cout << "ERROR: GetSteerableViewMapDensityF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetSteerableViewMapDensityF1D(i,t,f); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp index c14aa0cf1a3..84bc7d928aa 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp @@ -106,10 +106,8 @@ int GetViewMapGradientNormF1D___init__( BPy_GetViewMapGradientNormF1D* self, PyO int i; float f = 2.0; - if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) { - cout << "ERROR: GetViewMapGradientNormF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "i|O!f", &i, &IntegrationType_Type, &obj, &f) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetViewMapGradientNormF1D(i,t,f); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp index a426319d816..a9c0e0f18b9 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp @@ -104,10 +104,8 @@ int GetXF1D___init__( BPy_GetXF1D* self, PyObject *args ) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: GetXF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetXF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp index bd781cc4d36..04f982f98d4 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp @@ -104,10 +104,8 @@ int GetYF1D___init__( BPy_GetYF1D* self, PyObject *args ) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: GetYF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetYF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp index fa840043c77..de0914b344d 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp @@ -104,10 +104,8 @@ int GetZF1D___init__( BPy_GetZF1D* self, PyObject *args ) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: GetZF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::GetZF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp index fa15546ba3a..9c1a0b0f055 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp @@ -105,10 +105,8 @@ int LocalAverageDepthF1D___init__( BPy_LocalAverageDepthF1D* self, PyObject *arg PyObject *obj = 0; double d; - if( !PyArg_ParseTuple(args, "d|O!", &d, &IntegrationType_Type, &obj) ) { - cout << "ERROR: LocalAverageDepthF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "d|O!", &d, &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::LocalAverageDepthF1D(d,t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp index 7667b88c304..3b02fc09098 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp @@ -104,10 +104,8 @@ int ZDiscontinuityF1D___init__( BPy_ZDiscontinuityF1D* self, PyObject *args ) { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: ZDiscontinuityF1D___init__ " << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_double.uf1D_double = new Functions1D::ZDiscontinuityF1D(t); diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp index f1e88a5c35d..1bea64f5d49 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp @@ -104,10 +104,8 @@ int QuantitativeInvisibilityF1D___init__( BPy_QuantitativeInvisibilityF1D* self, { PyObject *obj = 0; - if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) { - cout << "ERROR: QuantitativeInvisibilityF1D___init__" << endl; + if( !PyArg_ParseTuple(args, "|O!", &IntegrationType_Type, &obj) ) return -1; - } IntegrationType t = ( obj ) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; self->py_uf1D_unsigned.uf1D_unsigned = new Functions1D::QuantitativeInvisibilityF1D(t); -- cgit v1.2.3