Undo/redo history

Discussions concerning programming of SOFTIMAGE©
Post Reply
Xsinode
Posts: 26
Joined: 06 Sep 2013, 19:08

Undo/redo history

Post by Xsinode » 02 Mar 2015, 02:05

How I can use any command without adding it to undo/redo history ?

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Undo/redo history

Post by Hirazi Blue » 02 Mar 2015, 11:25

I assume you want to disable the logging of the commands in a script?
If so look for "Disabling Command Logging Temporarily" on this page
Stay safe, sane & healthy!

Xsinode
Posts: 26
Joined: 06 Sep 2013, 19:08

Re: Undo/redo history

Post by Xsinode » 02 Mar 2015, 15:57

No. I want to perform operation (using script) not adding to undo/redo history.
For example: First i'm create cube and then im use custom operator. When i'm using ctrl+z (for undo). Softimage undoing cube creation instead of custom operator.
Sorry for english.

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: Undo/redo history

Post by Mathaeus » 02 Mar 2015, 16:23

afaik, command has to be "registered" in order to undo the entire thing at once. Perhaps easiest way is to put your script into plugin, generated by XSI plugin wizard - it creates complete 'car hull' for your engine.

luceric
Posts: 1251
Joined: 22 Jun 2009, 00:08

Re: Undo/redo history

Post by luceric » 02 Mar 2015, 16:53

in the script, you have to set the undo level to 0, which will clear the undo history and turn off the recording of undo.

you cannot just suspend undo recording temporarily without clearing the existing undo stack, because what's already in the undo queue cannot correctly work anymore.

Xsinode
Posts: 26
Joined: 06 Sep 2013, 19:08

Re: Undo/redo history

Post by Xsinode » 02 Mar 2015, 20:06

Thanks for answers

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 15:31
Skype: csaezmargotta
Location: Sydney, Australia
Contact:

Re: Undo/redo history

Post by csaez » 06 Mar 2015, 10:20

There's a way to encapsulate your script into one big undo step by using the BeginUndo/EndUndo commands.

Code: Select all

Application.BeginUndo()
# YOUR CODE HERE
Application.EndUndo()
If you're using python it is possible to wrap this up as a convenient decorator or context manager, here is an old blog post about this (shameless plug).

Hope this helps,
Cheers

Xsinode
Posts: 26
Joined: 06 Sep 2013, 19:08

Re: Undo/redo history

Post by Xsinode » 14 Mar 2015, 07:52

Thanks for answers

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests