How To Add Undo/Redo To Your UI
I’ve been getting a lot of mileage out of this, but I’m having a hard time figuring out the best way to delete a component and then recover it. If I delete a component with children, the undo function restores the operator itself, but none of its kids. I’m thinking a callback that deletes everything in a list whose members are selectedOp and the list of selectedOp.findChildren(), am I thinking about this the right way or does that get messy?
This should absolutely work. Please post an example that doesn’t restore its kids.
Just an update here working with Ivan a bit: It seems like it is necessary if you have a clone within a clone to make sure the top level container is set to containerCloneImmune, not just cloneImmune, otherwise TD undo system doesn’t correctly undo your edits to the cloned children