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:
- Each non-MAXScript plug-in is loaded into memory and initialized through a called
to LibInitialize().
- The MAXScript engine is initialized
- All MAXScript plug-ins are loaded into memory and initialized through a called to
LibInitialize().
- NOTIFY_SYSTEM_STARTUP is broadcast to all plug-ins.
Finalization Steps
- NOTIFY_SYSTEM_SHUTDOWN is broadcast to all plug-ins.
- NOTIFY_SYSTEM_SHUTDOWN2 is broadcast to all plug-ins.
- The global utility plug-in manager shuts down all global utility plug-in. This involves
calling the global utility plug-in DeleteThis() methods.
- MAXScript is uninitialized, according to the following steps:
- The macro-recorder is turned off.
- A notification is broadcast NOTIFY_MXS_SHUTDOWN.
- The COM bridge is uninitialized.
- The MAXScript interrupt checker thread is stopped. This is the thread that checks
if the escape key is pressed during MAXScript execution.
- The MAXScript plug-ins (*.dlx files) are freed
- The macro-recorder is turned off.
- A notification is broadcast NOTIFY_MXS_SHUTDOWN.
- The COM bridge is uninitialized.
- The MAXScript interrupt checker thread is stopped. This is the thread that checks
if the escape key is pressed during MAXScript execution.
- The MAXScript plug-ins (*.dlx files) are freed
- 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.