webots
webots copied to clipboard
Allow undoing field changes that are template regenerators
Describe the Bug
As emerged here, currently the undo stack doesn't keep track of changes in template regenerators, the reason is that if it did so, after regeneration the actions stored in the stack would point to objects that no longer exist. In short, providing this feature would require traversing the undo stack and replace the pointers to fields/instances that no longer exist with their newly regenerated counterpart. This might be tricky because the stack may contain also actions performed on children fields of the regenerator, so it might require keeping track of ALL that has been deleted by the regeneration process, and ALL that has been recreated after, and somehow connect the dots while "rebuilding" the undo stack