Home Technical Talk

pack maxscript undos together?

polycounter
Offline / Send Message
rollin polycounter
hi I'm working with maxscript again a little bit

I'm now wondering if I can undo a whole function at once - undoing all changes the function did in one undo-step

instead of disabling undo or undoing every single change the function did

Replies

  • Piflik
    Offline / Send Message
    Piflik polycounter lvl 12
    undo "optional text here" on
    (
       command 1
       command 2
       ...
       command n
    )
    
  • rollin
    Offline / Send Message
    rollin polycounter
    ah! I was already looking at the "on undo" part but somehow missed the effect

    thx!!
  • rollin
    Offline / Send Message
    rollin polycounter
    and I found out, that it seems to not work in max 8 :shifty:
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi Rollin,
    I don't know if it works in 3ds Max 8, but you can try something a little more hardcore:
    function setHold =
    (
        if (theHold.holding() == false) do
            theHold.begin()
    )
    
    function getHold sTag =
    (
        if (theHold.holding() == true) do
            theHold.accept sTag
    )
    

    Define these two functions, they can be neatly packed into a struct, then call setHold before the block to group, and getHold after it. They MUST work in pair. As the MaxScript reference states, they are taken straight from the SDK, use at your own risk, which in other words means if the undo stops working, don't blame us, anyway I use these in IC.Shape in many instruments, and they seems to behave well, the worst thing happened is that they skip an undo record.
  • rollin
    Offline / Send Message
    rollin polycounter
    hi!

    no it does not work, or lets say: the effect is similar to the undo on () in max8

    but thx for the info.. I've got it to work in max 2008!


    ok, seems I should slooowly start to prepare to let max 8 behind :poly122:
Sign In or Register to comment.