Hi,

What you can try is an open and close chunk of your undo queue.

## Opens a new undo chunk
cmds.undoInfo(openChunk = True)

## Closes the chunk again
cmds.undoInfo(closeChunk = True)


Keep in mind though that if you have an error in your script halfway you
might lose your entire undo stack.
Maybe make a button that closes the undo chunk. so you can always preserve
your undo stack.

if you really want to make your life easy make a decorator function out of
it.
That way you can use it for every function you want to wrap in one undo
call.

Hope that helps.

2013/1/23 blindtresddd <[email protected]>

> Blue pencil plug? Anyone?
> El 23/01/2013 15:08, "DayDreamer" <[email protected]> escribió:
>
>  Hi, I am changing the values of attributes on multiple objects in the
>> maya scene. Now, if I have to go to the previous state(before the setting
>> of the attributes), it takes lots of Undo.
>>
>> Is thee is a way to undone all the changes at once.
>>
>> Also, if I run the setting of the attributes from a function or
>> procedure, all the changes get undone at once.
>>
>> But, I am not able to attain the same functionality from my script.
>>
>> Thanks.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].


Reply via email to