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:
authorCampbell Barton <ideasman42@gmail.com>2008-12-28 16:03:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-12-28 16:03:37 +0300
commitf9fd3d7139542481af543bcb764db37967e924f9 (patch)
tree04655664f1dee579ac0262c7f7a52a6005ad464e /source/blender/python/intern/bpy_operator.c
parent1e463b22eb9172720ab5fe5a28da13d0d8dfb364 (diff)
minor changes and error checking.
tested first PyOperator, basics work now, invoke/exec can be used to make an operator that edits RNA or calls other operators.
Diffstat (limited to 'source/blender/python/intern/bpy_operator.c')
-rw-r--r--source/blender/python/intern/bpy_operator.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 7d3a253980d..2765a59ce42 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -188,10 +188,9 @@ static PyObject * pyop_func_call(BPy_OperatorFunc * self, PyObject *args, PyObje
RNA_pointer_create(NULL, NULL, ot->srna, &properties, &ptr);
- PYOP_props_from_dict(&ptr, kw);
+ error_val= PYOP_props_from_dict(&ptr, kw);
if (error_val==0) {
- //WM_operator_name_call(self->C, self->name, WM_OP_INVOKE_DEFAULT, properties);
WM_operator_name_call(self->C, self->name, WM_OP_EXEC_DEFAULT, properties);
}
@@ -200,7 +199,21 @@ static PyObject * pyop_func_call(BPy_OperatorFunc * self, PyObject *args, PyObje
MEM_freeN(properties);
}
- if (error_val) {
+
+#if 0
+ /* if there is some way to know an operator takes args we should use this */
+ {
+ /* no props */
+ if (kw != NULL) {
+ PyErr_Format(PyExc_AttributeError, "Operator \"%s\" does not take any args", self->name);
+ return NULL;
+ }
+
+ WM_operator_name_call(self->C, self->name, WM_OP_EXEC_DEFAULT, NULL);
+ }
+#endif
+
+ if (error_val==-1) {
return NULL;
}