View Full Version : max mode/selection callback...

10 October 2005, 05:11 AM
Is it possible to have a callback for when, firstly a specific object is selected and mode type has been pressed eg move, rotate.

So when eg, you select $bone03, then the move mode a function is called to hide and unhide something. Then when you select rotate move or another object it does something else?

Ive been looking into the callback.addscript selectionset stuff - just wanted to know if you could do it with buttons. Or should i build a rollout/buttons for the callback to look at rather than the main max controls?

any help would be great!


10 October 2005, 08:31 PM
I already sent you an IM about this but just in case anyone else wants to know:

Create the function you wish the callback to use.

fn foo =
($.position = [0,0,0])

Then at some point in your script you need to setup the callback:

callbacks.addscript #selectionsetchanged "foo()" id:#RTfooID

When you are done using the callback make sure to remove it:

callbacks.removescripts id:#RTfooID

As for checking what mode the user is in you can ask what the state of the UI buttons are with:

getToolbtnState #move
getToolbtnState #rotate


10 October 2005, 08:59 PM
yep - im slowing getting there. With it. callbacks are pretty interesting!


CGTalk Moderation
10 October 2005, 08:59 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.