Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Detect 3dsmax exit/close program
  RSS 2.0 ATOM  

Detect 3dsmax exit/close program
Rate this thread
 
60476
 
Permlink of this thread  
avatar
  • koberko
  • Posted: 29 September 2011 04:18 AM
  • Location: Varazdin
  • Total Posts: 3
  • Joined: 07 September 2008 01:33 AM

Is there a way to detect when max is closing (exiting) so that my script that runs in background can write some data to file before max closes?
I’m making script that will log work hours, so I will want to be able to write to file when max has closed…

I have made if so far in way that logs work time every 10 min, and it detects if you have opened new file, so it starts new count down for new file.
But it will be more elegant if I will be able to detect when someone closes max, so that I can just write down when file/max was opened and closed…
Currently, it’s not a problem if you open max, work on one file, then open next one; it writes info for first file, but for last file, it just writes when file was opened, but not when it was closed… Or if you worked on just one file…



Replies: 0
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

"General Event Callback Mechanism” (in the Maxscript help)

#postSystemStartup (use to log the fact that Max was started)

Either #preSystemShutdown or #postSystemShutdown (to log Max closing - whichever works best for you)

There’s a whole bunch of them to do with file open/close as well.



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 0