diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-21 12:07:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-22 12:29:56 +0300 |
commit | 25f1c2b04e0d98587c88c5ea26b59650e5c2e3f7 (patch) | |
tree | c4e038cae798ff9c15fcee4fb54ffbb18295ed63 /rigify/ui.py | |
parent | f24ca278e8f67e8cf3f3635b138089d8e53681af (diff) |
Add-ons: remove temporary disabling of use_global_undo
This can cause bugs where if the operator throws an exception, undo is not
properly enabled again. There have been maybe a dozen Blender bug reports
related to this. This could get worse now that we are autosaving preferences.
Some add-ons guard against this, but turning off undo should not be needed in
the first place. If the operator is set to do an undo push, any operators it
calls will automatically not do any undo pushes.
If this fail in some cases, it should be reported as a bug in Blender. I could
not find issues or a performance impact testing a few add-ons though.
Differential Revision: https://developer.blender.org/D4908
Diffstat (limited to 'rigify/ui.py')
-rw-r--r-- | rigify/ui.py | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/rigify/ui.py b/rigify/ui.py index c3c9f07d..0ec38791 100644 --- a/rigify/ui.py +++ b/rigify/ui.py @@ -755,14 +755,10 @@ class Generate(bpy.types.Operator): import importlib importlib.reload(generate) - use_global_undo = context.preferences.edit.use_global_undo - context.preferences.edit.use_global_undo = False try: generate.generate_rig(context, context.object) except MetarigError as rig_exception: rigify_report_exception(self, rig_exception) - finally: - context.preferences.edit.use_global_undo = use_global_undo return {'FINISHED'} @@ -813,8 +809,6 @@ class Sample(bpy.types.Operator): def execute(self, context): if context.mode == 'EDIT_ARMATURE' and self.metarig_type != "": - use_global_undo = context.preferences.edit.use_global_undo - context.preferences.edit.use_global_undo = False try: rig = rig_lists.rigs[self.metarig_type]["module"] create_sample = rig.create_sample @@ -823,7 +817,6 @@ class Sample(bpy.types.Operator): else: create_sample(context.active_object) finally: - context.preferences.edit.use_global_undo = use_global_undo bpy.ops.object.mode_set(mode='EDIT') return {'FINISHED'} @@ -1280,8 +1273,6 @@ class OBJECT_OT_ClearAnimation(bpy.types.Operator): def execute(self, context): - use_global_undo = context.preferences.edit.use_global_undo - context.preferences.edit.use_global_undo = False try: rig = context.object scn = context.scene @@ -1292,8 +1283,6 @@ class OBJECT_OT_ClearAnimation(bpy.types.Operator): return {'FINISHED'} clearAnimation(act, self.anim_type, names=get_limb_generated_names(rig)) - finally: - context.preferences.edit.use_global_undo = use_global_undo return {'FINISHED'} |