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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-11-13 13:42:01 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-11-18 22:03:40 +0300
commit04272613a78d805e900941b21df16dbbcafc6849 (patch)
tree45f008b0d2c472d5fea86e7cb7234a1b6c64bef3 /source/blender/makesrna/intern/rna_wm_gizmo.c
parent64c27b96909834381558375ee1f27bdec04360f3 (diff)
Python API: assume that a crashed Python operator returned FINISHED.
The CANCELLED return value from an operator is intended for signaling that the operator aborted execution without changing anything, and an Undo stack entry should not be created. When a Python operator crashes, it is not safe to assume that it did nothing, so it should interpret it as FINISHED instead. Otherwise, the undo system behavior after an operator failure feels broken. Differential Revision: https://developer.blender.org/D6241
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_gizmo.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_gizmo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c
index ba26929d808..0bd6769d3ad 100644
--- a/source/blender/makesrna/intern/rna_wm_gizmo.c
+++ b/source/blender/makesrna/intern/rna_wm_gizmo.c
@@ -1073,7 +1073,7 @@ static void rna_def_gizmo(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_enum_flag(func, "tweak", tweak_actions, 0, "Tweak", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
parm = RNA_def_enum_flag(
- func, "result", rna_enum_operator_return_items, OPERATOR_CANCELLED, "result", "");
+ func, "result", rna_enum_operator_return_items, OPERATOR_FINISHED, "result", "");
RNA_def_function_return(func, parm);
/* wmGizmo.property_update */
/* TODO */
@@ -1092,7 +1092,7 @@ static void rna_def_gizmo(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_pointer(func, "event", "Event", "", "");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_enum_flag(
- func, "result", rna_enum_operator_return_items, OPERATOR_CANCELLED, "result", "");
+ func, "result", rna_enum_operator_return_items, OPERATOR_FINISHED, "result", "");
RNA_def_function_return(func, parm);
/* wmGizmo.exit */