From 25f1c2b04e0d98587c88c5ea26b59650e5c2e3f7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 21 May 2019 11:07:17 +0200 Subject: 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 --- add_mesh_extra_objects/add_mesh_solid.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'add_mesh_extra_objects') diff --git a/add_mesh_extra_objects/add_mesh_solid.py b/add_mesh_extra_objects/add_mesh_solid.py index 98172d37..59e070df 100644 --- a/add_mesh_extra_objects/add_mesh_solid.py +++ b/add_mesh_extra_objects/add_mesh_solid.py @@ -449,10 +449,6 @@ class Solids(bpy.types.Operator): previousSetting = "" def execute(self, context): - # turn off undo for better performance (3-5x faster), also makes sure - # that mesh ops are undoable and entire script acts as one operator - bpy.context.preferences.edit.use_global_undo = False - # piece of code to make presets remain until parameters are changed if self.preset != "0": # if preset, set preset @@ -512,7 +508,4 @@ class Solids(bpy.types.Operator): object_data_add(context, mesh, operator=None) # object generation done - # turn undo back on - bpy.context.preferences.edit.use_global_undo = True - return {'FINISHED'} -- cgit v1.2.3