Writing Plug-In Applications
See Also: Main Plug-In Classes.
This section presents information common to developing all 3ds max plug-in applications. It discusses the sample files, the plug-in directory search mechanism, the plug-in help system, the configuration file system, the standard DLL functions, and creating thread-safe plug-ins.
Included with the SDK are sample programs that provide many examples of how to write plug-in applications. These sample programs are found in the sub-directories of \MAXSDK\SAMPLE. You'll find it very instructive to examine the source code of these examples. The section on Building the Sample Files has more detailed information on the sample programs available.
3ds max plug-ins are implemented as dynamic link libraries (DLLs). DLLs are object code libraries that let multiple programs share code, data, and resources. Dynamic linking allows an executable module to include only the information needed at run time to locate the executable code for a DLL function. This type of linking differs from the more familiar static linking, which requires a copy of a library function's executable code in the executable module of each application using it.
The development tool for creating these DLLs is Microsoft Visual C++. For a description of how to create a new project file see the Advanced Topics section Creating a New Plug-In Project.
Developers may store their plug-in DLLs in any location they wish. Developers need to let 3ds max know where to search for the DLLs. How this is done is discussed in the section Plug-In Directory Search Mechanism.
Plug-In developers may add on-line help for their applications and make this available to users via the 3ds max Help menu. See the section Plug-In Help System for more details.
There is a standard location for developers to save any configuration files required by their plug-in application. These may be .INI files, binary configuration files or whatever is needed. See the section Plug-In Configuration System for details.
Standard DLL Functions
There are a standard set of functions that ALL plug-in DLLs must implement. These functions are:
DLLMain()
LibDescription()
LibNumberClasses()
LibClassDesc()
LibVersion()
These functions allow 3ds max to access, work with, and maintain the plug-ins inside the DLL. To review the full details of these functions, see the Advanced Topics section DLL Functions and Class Descriptors
Reentrant and Thread Safe Plug-Ins
3ds max plug-ins must be 'Reentrant' and 'Thread Safe'. See the Advanced Topics section Thread Safe Plug-Ins for more information.