Undo an operation via Maya C++ API

Anonymous

Undo an operation via Maya C++ API

Anonymous
Not applicable

In my Maya .mll file I have the following:

void doIt()
{
MGlobal::executeCommand("polyMapCut -ch 1 pCube1.e[2];");
}

void undoIt()
{
MStreamUtils::stdOutStream() << "Undo is called";
MGlobal::executeCommand("undo;");
}

 

This are all registered to the command `runCut` inside an MEL script.

Inside the Maya script editor, after executing `runCut` and then trying to undo it:

`"Undo is called"` is displayed, meaning `UndoIt()` works, but I then get an error saying that `"The undo queue is turned off."`

Is it the way that I call `undo` that is incorrect?

0 Likes
Reply
565 Views
1 Reply
Reply (1)

Anonymous
Not applicable

the undo queue is a maya setting which can be found here https://www.youtube.com/watch?v=pL2-piMU1vM
windows -> Settings -> Undo - > On

0 Likes