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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-03-05 13:12:13 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-03-05 14:50:55 +0300
commitf3fb1df1922a938272a84209c55206255c687e31 (patch)
tree7a63625504c90890aef4e16e43ba0566937a8dbf
parent5668901ced38a17477af580c882805975150f16d (diff)
Fix T86293: crash undoing after executing the python console in certain
scenarios In general, I could not find a reason executing from the python console should not do an Undo push. Running a script from the Text Editor does this as well and this seems generally useful. Without an Undo push, one can easily run into situations were IDs have been added or removed and undo on would then cause trouble (e.g. first selection then bpy.ops.object.duplicate() -- this crashed as reported in T86293 -- duplicate does not get its own undo push because it is not the last op in the list, wm->op_undo_depth is not zero). This has changed with the Undo refactor, so in essence the root cause is the same as T77557, Legacy Undo does not suffer from the crash (but misses the generally useful undo push from the console still) Now add Undo to CONSOLE_OT_execute bl_options ('UNDO_GROUPED' seems more appropriate than plain 'UNDO' since pasting multiple lines of code will call CONSOLE_OT_execute multiple times in a row). Maniphest Tasks: T86293 Differential Revision: https://developer.blender.org/D10625
-rw-r--r--release/scripts/startup/bl_operators/console.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py
index 231dade820d..cd6728d56b2 100644
--- a/release/scripts/startup/bl_operators/console.py
+++ b/release/scripts/startup/bl_operators/console.py
@@ -37,6 +37,7 @@ class ConsoleExec(Operator):
"""Execute the current console line as a python expression"""
bl_idname = "console.execute"
bl_label = "Console Execute"
+ bl_options = {'UNDO_GROUPED'}
interactive: BoolProperty(
options={'SKIP_SAVE'},