View Full Version : Query about "with undo"?

07 July 2011, 12:49 PM
I am currently working on a script that manipulates a selected cameras position via a spinner in a rollout floater. However transformations to the camera via the spinner didn't generate any undo blocks. I resolved this by nesting a "with undo" into the button down event.

This works fine for transforms via "spinning" the spinner, but how can I catch manually entered values?

I tried nesting the "with undo" into the "On spn_CamX changed val" event but this generates hundreds of undo blocks.

I also tried it in "On spn_CamX entered" event but this didn't give the desired result either.

On spn_CamX buttondown do with undo "cam move" on
Currentcam.pos.x = spn_CamX.value

On spn_CamX changed val do
Currentcam.pos.x = val

Any thoughts would be most appreciated.



07 July 2011, 02:04 PM
use spinner's entered event instead of changed or buttondown to register UNDO

CGTalk Moderation
07 July 2011, 02:04 PM
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.