View Full Version : Selection Event Handler

09 September 2009, 10:28 AM
Is there a event handler function in maxscript for handling the events on changing object selection? someting like "on selection changed do ()"
For rollups or other types of menus.

09 September 2009, 02:42 PM
Yes, there is, its called change handler and it is documented. Search for "change handler" in the maxscript reference

09 September 2009, 04:41 PM
Callbacks.AddScript #SelectionSetChanged "Code Here"
Also, if you do this with rollouts, maybe you want to prevent abusing refresh.
I've seen a lot of script with this problem. Here is my solution:

Use a timer control inactive by default.
When the timer tick, the rollout refresh itself and the timer return inactive.
The only thing the callback do is turn the timer on.
This way, the interval of the timer control will be a sort of "minimum refresh time".

NodeEventCallback can also do this but I never tested it.

09 September 2009, 06:00 AM
Oh goody! Thanks for replys, aaaaCHoooo & Sigmao.

CGTalk Moderation
09 September 2009, 06:00 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.