home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hackers Magazine 57
/
CdHackersMagazineNr57.iso
/
Software
/
Multimedia
/
k3d-setup-0.7.11.0.exe
/
share
/
k3d
/
scripts
/
undo_redo_errors.py
< prev
next >
Wrap
Text File
|
2008-01-23
|
525b
|
18 lines
#python
import k3d
# While recording state changes for undo/redo purposes, you must ensure that errors are handled properly!
Document.start_change_set()
try:
if k3d.ui().query_message("Choose one ...", ["Succeed", "Fail"]) == 2:
raise RuntimeError("Simulated error condition")
Document.finish_change_set("Test Change Set")
k3d.ui().message("State recording completed successfully ... check your Undo Tree Panel")
except:
Document.cancel_change_set()
k3d.ui().message("State recording cancelled due to an error!")