diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-12-26 15:39:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-12-26 15:39:53 +0300 |
commit | 7715e45a7adf2cc07856956aef27fc6359af94e1 (patch) | |
tree | 2f15a7bdd58d5270af4b845292a77a9b6a90d846 /source/blender/python/intern/bpy_operator.c | |
parent | d6704568f87c71940feb2b7b28950b48a7d5fcf1 (diff) |
removed ED_ prefix from script operator.
python operator api was crashing when unknown operators were called.
Diffstat (limited to 'source/blender/python/intern/bpy_operator.c')
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 966253f82a8..4ed48dd81dd 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -77,10 +77,11 @@ static PyObject *pyop_base_getattro( BPy_OperatorBase * self, PyObject *pyname ) ot = WM_operatortype_find(name); if (ot) { - return pyop_func_CreatePyObject(self->C, name); + ret= pyop_func_CreatePyObject(self->C, name); } else { PyErr_Format( PyExc_AttributeError, "Operator \"%s\" not found", name); + ret= NULL; } } @@ -101,18 +102,17 @@ static PyObject * pyop_func_call(BPy_OperatorFunc * self, PyObject *args, PyObje PropertyRNA *prop, *iterprop; CollectionPropertyIterator iter; - - if (ot == NULL) { - PyErr_SetString( PyExc_SystemError, "Operator could not be found"); - return NULL; - } - if (PyTuple_Size(args)) { PyErr_SetString( PyExc_AttributeError, "All operator args must be keywords"); return NULL; } ot= WM_operatortype_find(self->name); + if (ot == NULL) { + PyErr_SetString( PyExc_SystemError, "Operator could not be found"); + return NULL; + } + RNA_pointer_create(NULL, NULL, ot->srna, &properties, &ptr); |