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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-08-03 19:19:51 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-08-03 19:19:51 +0400
commitff110c17f705976435ee14f2cde9c85f7334a56c (patch)
treeb1748338ca9489ddef1a61ff923b46438ed937ce /source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
parentd4ff63fe20d912a72a7695852a204ab3f1d3dce7 (diff)
Fixed argument checking in __init__ methods of Interface1D, Predicates,
Functions, and StrokeShader types.
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp')
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
index 38cba3f1275..d388cb10c06 100644
--- a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
@@ -183,18 +183,19 @@ int Stroke___init__(BPy_Stroke *self, PyObject *args, PyObject *kwds)
if (! PyArg_ParseTuple(args, "|OO", &obj1, &obj2) )
return -1;
- if( !obj1 && !obj2 ){
+ if( !obj1 ){
self->s = new Stroke();
- } else if ( obj1 && !obj2 ) {
- if (! BPy_Stroke_Check(obj1) ) {
- PyErr_SetString(PyExc_TypeError, "not a Stroke object");
- return -1;
- }
+
+ } else if ( !obj2 && BPy_Stroke_Check(obj1) ) {
self->s = new Stroke(*( ((BPy_Stroke *)obj1)->s ));
- } else {
- PyErr_SetString(PyExc_NotImplementedError,
+
+ } else if ( obj2 ) {
+ PyErr_SetString(PyExc_TypeError,
"Stroke(InputVertexIterator iBegin, InputVertexIterator iEnd) not implemented");
return -1;
+ } else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
+ return -1;
}
self->py_if1D.if1D = self->s;