[Closed] How to detect a file->reset to stop a timer
I’m new to maxscript and the max SDK, but I have to debug a plugin that uses both. The problem is I have a timer in maxscript, and for each clock tick it calls the main processing function.
The maxscript generates an exception when I click on file->reset while the timer is running.
How can I avoid that?
I think there’s a way to detect a reset via callbacks.
Do a search in the MaxScript referance manual for #systemPreNew and it should give you the page about callbacks. They let you queue up script for when something happens you wern’t expecting (like a reset).
Here’s a snippet to help you along!
[color=white]System Notifications:[/color]
[left]#postSystemStartup: undefined[/left]
[left]Sent when the software goes live.[/left]
[left]#systemPreNew: integer[/left]
[left]Sent just before 3ds Max is reset.[/left]
[left]Calling callbacks.notificationParam() within the callback function will return an integer value corresponding to the option selected in the New Scene dialog:[/left]
[left]1 – New All[/left]
[left]2 – Keep Objects[/left]
[left]3 – Keep Objects and Hierarchy[/left]
[left]#systemPostNew: undefined[/left]
[left]Sent just after 3ds Max is reset.[/left]