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>2010-11-20 19:39:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-20 19:39:15 +0300
commit7b16d7496d7347002f83bd52d779e52c06270115 (patch)
tree7deb173691a36d9576fb46674ba77dbf4eda2e4e /source/blender/makesrna/intern/rna_wm_api.c
parent6e5ccba6da0f89649bd74fbf5c14852509603d88 (diff)
- report python script errors to blender report system, or through operators reports (when using operator callbacks).
- when python operators fail to execute they were returning RUNNING_MODAL, now return CANCELLED now when an operator fails it gives an error popup as well as a message in the terminal.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index d767d752635..5f289514f7a 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -34,6 +34,7 @@
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
+#include "DNA_windowmanager_types.h"
#ifdef RNA_RUNTIME
@@ -92,7 +93,7 @@ static void rna_generic_op_invoke(FunctionRNA *func, int flag)
}
if(flag & WM_GEN_INVOKE_RETURN) {
- parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", "");
+ parm= RNA_def_enum(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
RNA_def_property_flag(parm, PROP_ENUM_FLAG);
RNA_def_function_return(func, parm);
}
@@ -161,7 +162,7 @@ void RNA_api_operator(StructRNA *srna)
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "context", "Context", "", "");
- parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); // better name?
+ parm= RNA_def_enum(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name?
RNA_def_property_flag(parm, PROP_ENUM_FLAG);
RNA_def_function_return(func, parm);
@@ -181,7 +182,7 @@ void RNA_api_operator(StructRNA *srna)
RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_pointer(func, "event", "Event", "", "");
- parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); // better name?
+ parm= RNA_def_enum(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name?
RNA_def_property_flag(parm, PROP_ENUM_FLAG);
RNA_def_function_return(func, parm);
@@ -191,7 +192,7 @@ void RNA_api_operator(StructRNA *srna)
RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_pointer(func, "event", "Event", "", "");
- parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); // better name?
+ parm= RNA_def_enum(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name?
RNA_def_property_flag(parm, PROP_ENUM_FLAG);
RNA_def_function_return(func, parm);