Implement fully undo/redo with checks

While these actions are short in the backend--taking about 0.01 seconds to run--the Blender UI lags a lot leading to 2-3 second pauses because of the "refresh_brick_viewer" function being slow. This should be investigated.
This commit is contained in:
Trashman247
2023-06-27 13:21:44 -07:00
parent 36d0e33958
commit 2b52ab930c
5 changed files with 40 additions and 5 deletions
@@ -190,6 +190,20 @@ class RemoveBrick(bpy.types.Operator, Operator):
brick_uri=props.bricks[props.active_brick_index].uri,
)
class UndoBrick(bpy.types.Operator, Operator):
bl_idname = "bim.undo_brick"
bl_label = "Undo Brick"
def _execute(self, context):
core.undo_brick(tool.Brick)
class RedoBrick(bpy.types.Operator, Operator):
bl_idname = "bim.redo_brick"
bl_label = "Redo Brick"
def _execute(self, context):
core.redo_brick(tool.Brick)
class SerializeBrick(bpy.types.Operator, Operator):
bl_idname = "bim.serialize_brick"
bl_label = "Serialize Brick"