Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8532

Delete from Undo Multiple

$
0
0

Hi everyone,

undomultiple

I have been working with undo/redo operations connected with my plugin. I am recording some operations in plugin to manage list operations for some calculations. Some calculations are geometry related some of them not. For example, you know, there are operations like Scale, Scale1D, Scale2D, Move, and some gumball interactions to manipulate geometry. After catching manipulated geometry by RhinoDoc.ReplaceRhinoObject event, I update them. But when I want to undo/redo this reactions still there (of course there is). But I want to delete this operations on stack. I just want to plugin specific recordings. Is it possible?

I tried as below to workaround it but didn’t success.

public RhinoDoc Doc { get;} => RhinoDoc.ActiveDoc;

public void UpdatePluginObjectAfterReplacing(List<MyPluginObject> objects)
{
    Doc.Undo(); // tried workaround here to get rid of this Scale1D, for example
    Doc.ClearRedoRecords(); // clear redo stack to get rid of Scale1D also there

    uint sn = Doc.BeginUndoRecord("Update Reaction");
    // some operations to update geometry and objects for my plugin
    Doc.EndUndoRecord(sn);
}

Do you have any idea or best practices for these kind of undo/redo operations which are dependent to RhinoDoc.ReplaceRhinoObject event? Hope it’s clear.

Thanks in advance,
-Oğuzhan

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 8532

Trending Articles