View Full Version : Excluding nextFrame (prev) & nextKey (prev) from undo

03-01-2010, 01:15 AM
It really enjoys me that maya includes the nextFrame and nextKey command to their undo list. So you always have to undo 20x just to reverse a little transformation.
I had a look at google and found this thread (http://www.cgchar-animation.com/forum/index.php?topic=6339.10) which has a script that should solve the problem, but it seems to be still buggy with referenced rigs.

Since this thread is a little bit old I wanted to check if anybody of you found a descent workaround to this problem.
I am working with maya2009 and I'd be happy to find some help.

Thanks a lot!

03-01-2010, 07:55 AM
Here's a sample script which I use on meshes exported from UE3. (UVs/vertices are all split so you must recombine everything) This easily crashes Maya because the undo queue fills up the memory, the undo part should be easy to understand. :)

// Query current Undo settings
int $inf = `undoInfo -q -infinity`; // Store Undo Infinity setting
int $length = `undoInfo -q -length`; // Store Undo Queue length

undoInfo -swf 0; // Turn off Undo queue

//////// Your script here ///////////
string $selection[] = `ls -selection -tr`;
string $object;
for($object in $selection){
polyMergeVertex -d 0.01 -am 1 -ch 0 $object;
polyMergeUV -d 0.01 -ch 0 $object;

// Turn on the queue again
undoInfo -swf 1;

// If our queue was infinite before, turn it back to infinity
if($inf == 1)
undoInfo -infinity 1;

// Otherwise have it off and set our queue length
else undoInfo -infinity 0 -length $length;

Just read the thread on the other forum, maybe this isn't your solution after all. :hmm:

CGTalk Moderation
03-01-2010, 07:55 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.