Interface Class Overview

3DS Max Plug-In SDK

Interface Class Overview

See Also: Links to Interface Classes, Class Interface, Class ViewExp, Class INode.

3ds max provides a large number of functions for plug-ins to use. There are two approaches plug-ins may use to call these functions in MAX:

1 Plug-Ins can directly call functions in CORE.DLL

2 They may call methods on an interface pointer.

The primary purpose of CORE.DLL is that it contains implementations for some of the methods of the base classes that plug-ins derive their classes from. Plug-Ins generally don't call these methods directly, but instead inherit them as part of their derived class. CORE.DLL also has other miscellaneous functions that it exports. Plug-ins link to CORE.LIB so they can simply call these methods like any other function.

Unlike CORE.DLL, 3DSMAX.EXE does not export any methods. Instead, a plug-in calls functions in 3ds max through a pointer to an interface class. An interface class is simply a class with no data members and all pure virtual methods. These classes are essentially just a table of function pointers.

Some of these interfaces are general. For example, the class Interface provides methods to do things like redraw the viewports, work with standard 3ds max dialog boxes, and work with MAX's coordinate systems. Other interfaces have specific contexts. For instance, the ViewExp interface class provides an interface to a viewport. Methods of this interface refer to a specific viewport.

Most interfaces have a specific life time outside of which they must not be used. For instance, when a modifier becomes active in the modify branch of the command panel, its BeginEditParams() method is called and an IObjParams interface is passed in. This interface pointer is defined to be valid until (and including) the modifier's EndEditParams() method is called. If a plug-in were to hang on to the pointer outside of this interval and then call one of its methods, the result would be undefined. Another example is the INode interface pointer, which when passed in to Object::Display(), is valid for only the duration of the function call.

For a list of all the interfaces into 3ds max see the section Interface Classes.

Note: Developer will often see the storage class attributes CoreExport and DllExport in the source code. These attributes are simply Microsoft-specific extensions to the C++ language used to enable 3ds max to export functions, data, and objects from a DLL so that plug-ins may call them.