Hi guys!
My plugin relies on some custom data that needs to be in synch with document contents.
I used to call RhinoDoc.AddCustomUndoEvent to save my custom data before some command modifies it.
In this way I can correctly set all the data to its previous / next state: the undo / redo mechanism is working fine and all the data is kept in synch.
So far so good…
Now I’m trying to do something more: I have to make some changes in the document (geometries updates) when custom undo / redo callback is called.
As I read in the docs, this is not a good practice beacuse it breaks Rhino undo mechanism… And that’s exactly what it does!
It looks like I can successfully undo the first time but, if I try to redo, the custom undo callback method isn’t called anymore and a “simple” undo event is fired.
Subsequent undos and redos just fire the standard undo and redo events.
Please note that I call RhinoDoc.AddCustomUndoEvent in the callback method to allow redo to work properly (and it works, if I dont make any changes to document).
I’ve tried to create another undo record using RhinoDoc.BeginUndoRecord but it adds another undo record (of course) and I would like to avoid it: that’s not intuitive from an end user perspective.
Is there some way to change document contents, when the custom undo callback method is called, without breaking Rhino undo / redo mechanism?
Thanks a lot!
6 posts - 2 participants