diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-25 11:31:29 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-25 11:31:29 +0400 |
commit | 7f721d06aaf48dd543441f4022c5c59fda0d13b8 (patch) | |
tree | 972a16bb7e0ad9487b19cfba0da4fcd11e12018f /source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp | |
parent | 1db5b6d283c4fde266738363dc6bffc59fb71df2 (diff) |
Fix for no copy constructor in the Python wrapper of StrokeAttribute.
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp index e68cc3fd28b..9e723d4236b 100644 --- a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp +++ b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp @@ -73,29 +73,33 @@ static int StrokeAttribute___init__(BPy_StrokeAttribute *self, PyObject *args, P PyObject *obj1 = 0, *obj2 = 0 , *obj3 = 0, *obj4 = 0, *obj5 = 0 , *obj6 = 0; - if (! PyArg_ParseTuple(args, "|OOOOOO", &obj1, &obj2, &obj3, &obj4, &obj5, &obj6) ) - return -1; + if (! PyArg_ParseTuple(args, "|OOOOOO", &obj1, &obj2, &obj3, &obj4, &obj5, &obj6) ) + return -1; + + if ( !obj1 ) { - if( !obj1 || !obj2 || !obj3 ){ - self->sa = new StrokeAttribute(); - - } else if( BPy_StrokeAttribute_Check(obj1) && + + } else if ( BPy_StrokeAttribute_Check(obj1) && !obj2 ) { + + self->sa = new StrokeAttribute( *( ((BPy_StrokeAttribute *) obj1)->sa ) ); + + } else if ( BPy_StrokeAttribute_Check(obj1) && BPy_StrokeAttribute_Check(obj2) && - PyFloat_Check(obj3) ) { - - self->sa = new StrokeAttribute( *( ((BPy_StrokeAttribute *) obj1)->sa ), - *( ((BPy_StrokeAttribute *) obj2)->sa ), - PyFloat_AsDouble( obj3 ) ); - - } else if( obj4 && obj5 && obj6 ) { - - self->sa = new StrokeAttribute( PyFloat_AsDouble( obj1 ), - PyFloat_AsDouble( obj2 ), - PyFloat_AsDouble( obj3 ), - PyFloat_AsDouble( obj4 ), - PyFloat_AsDouble( obj5 ), - PyFloat_AsDouble( obj6 ) ); + PyFloat_Check(obj3) && !obj4 ) { + + self->sa = new StrokeAttribute( *( ((BPy_StrokeAttribute *) obj1)->sa ), + *( ((BPy_StrokeAttribute *) obj2)->sa ), + PyFloat_AsDouble( obj3 ) ); + + } else if ( obj6 ) { + + self->sa = new StrokeAttribute( PyFloat_AsDouble( obj1 ), + PyFloat_AsDouble( obj2 ), + PyFloat_AsDouble( obj3 ), + PyFloat_AsDouble( obj4 ), + PyFloat_AsDouble( obj5 ), + PyFloat_AsDouble( obj6 ) ); } else { PyErr_SetString(PyExc_TypeError, "invalid arguments"); |