diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-08-03 02:39:21 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-08-03 02:39:21 +0400 |
commit | e2eb4d567c27b0ea58dd6c1687dcd9538b64202e (patch) | |
tree | bfacd3a92bf1754cca773d115d291d3aa29599c8 /source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp | |
parent | 74027eafcbdb4de4fea48d0fbc765553f9294078 (diff) |
Fixed the handling of constructor arguments in the following Python
types: Interface0D, SVertex, ViewVertex, StrokeVertex, NonTVertex,
and TVertex.
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp index b3005570843..b8fdfb5cc38 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp @@ -135,7 +135,13 @@ int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds) if (! PyArg_ParseTuple(args, "|OO!", &py_point, &Id_Type, &py_id) ) return -1; - if( py_point && py_id ) { + if( !py_point ) { + self->sv = new SVertex(); + + } else if( !py_id && BPy_SVertex_Check(py_point) ) { + self->sv = new SVertex( *(((BPy_SVertex *)py_point)->sv) ); + + } else if( py_point && py_id ) { Vec3r *v = Vec3r_ptr_from_PyObject(py_point); if( !v ) { PyErr_SetString(PyExc_TypeError, "argument 1 must be a 3D vector (either a list of 3 elements or Vector)"); @@ -143,8 +149,7 @@ int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds) } self->sv = new SVertex( *v, *(py_id->id) ); delete v; - } else if( !py_point && !py_id ) { - self->sv = new SVertex(); + } else { PyErr_SetString(PyExc_TypeError, "invalid argument(s)"); return -1; |