3ds Max Initialization and Finalization
 
 
 

The following are the initialization and finalization steps of 3ds Max that concern a plug-in's DLL.

Initialization Steps:

  1. Each non-MAXScript plug-in is loaded into memory and initialized through a called to LibInitialize().
  2. The MAXScript engine is initialized
  3. All MAXScript plug-ins are loaded into memory and initialized through a called to LibInitialize().
  4. NOTIFY_SYSTEM_STARTUP is broadcast to all plug-ins.

Finalization Steps

  1. NOTIFY_SYSTEM_SHUTDOWN is broadcast to all plug-ins.
  2. NOTIFY_SYSTEM_SHUTDOWN2 is broadcast to all plug-ins.
  3. The global utility plug-in manager shuts down all global utility plug-in. This involves calling the global utility plug-in DeleteThis() methods.
  4. MAXScript is uninitialized, according to the following steps:
    1. The macro-recorder is turned off.
    2. A notification is broadcast NOTIFY_MXS_SHUTDOWN.
    3. The COM bridge is uninitialized.
    4. The MAXScript interrupt checker thread is stopped. This is the thread that checks if the escape key is pressed during MAXScript execution.
    5. The MAXScript plug-ins (*.dlx files) are freed
  5. The macro-recorder is turned off.
  6. A notification is broadcast NOTIFY_MXS_SHUTDOWN.
  7. The COM bridge is uninitialized.
  8. The MAXScript interrupt checker thread is stopped. This is the thread that checks if the escape key is pressed during MAXScript execution.
  9. The MAXScript plug-ins (*.dlx files) are freed
  10. Each plug-in is shutdown through a call to LibShutDown(). This is where a plug-in should free any remaining allocated memory, and perform the final uninitialization steps.