Undo / Redo

by Demoli

2

Undo / Redo node based on Memento pattern

https://medium.com/design-patterns-in-python/memento-pattern-eba610b3b59c

Usage

Add an Undoer node to your scene and set the target to the node you want to track (by default this is the current parent node).

To save state call call $Undoer.save_state with a dictionary of properties you want to save

To undo call $Undoer.undo this will apply the previous state to your target node

To redo call $Undoer.redo this will apply the next saved sate to your target node

To clear all state call $Undoer.clear

Events

The Undoer also emits undone and redone events with the state that has been applied.

Examples

There are 2 example scenes in res://addons/undoredo/Examples, these demonstrate some different approaches you can use.

Restrictions

This is currently intended to handle properties on the parent object, method calls or properties on child nodes won't work at this time, but may be added later.

Version

0.2.1

Engine

4.0

Category

Tools

Download

Version0.2.1
Download

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author