PDA

View Full Version : disable undo ... help!!!


marktsang
11-06-2005, 05:10 PM
hi all,
ok here we go, i have tried for hours to do this but i cannot do it, here is the scene, i have a rollout - on this rollout is a button that when pressed it creates a point helper , on this point helper a rollout is created in which there is a on change handler set to delete the point helper when the rollout is closed (or in other words when you deselect the point helper it deletes itself) this works fine.. but here is the problem, if the user invokes and undo now, max tries to select a node which has been deleted and hence crashes.

what i would like to do is turn off undo when the user selects another objet so it is not stored in the undo buffer. but there seems to be no command to turn off undo for this sort of user interaction, and just to be clear the user is deselecting the point helper by clicking off it in the viewport, not by using a maxscript command so undo "daldkfja" off (select blahnode) , will not help.

anyone have any ideas

cheers,
mark tsang

stuh505
11-06-2005, 05:32 PM
You can use

undo off()

and then later call

undo on()

marktsang
11-06-2005, 06:04 PM
hi stuh,
yeah i tried this already... doesnt seem to work still captures the items to the undo buffer

mark

marktsang
11-07-2005, 12:06 AM
yeah got this sorted after some persistent fiddling, seems it didnt like the undo context statments being called inside the change handlers

mark

CGTalk Moderation
11-07-2005, 12:07 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.