0

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?

John Tan
  • 1,331
  • 1
  • 19
  • 35

1 Answers1

0

It means you've disabled the undo queue, so can't currently undo. To turn it back on again, you can do:

undoInfo -st 1; 
robthebloke
  • 9,331
  • 9
  • 12
  • It still gives the same error. I suspect the thing is not due purely to the undo queue being turned off, as doing operations normally in the scene and then undoing it works. – John Tan Nov 14 '19 at 02:20
  • Have you checked if isUndoable vritual function returns True? – Klaudikus Nov 29 '19 at 10:54