Required Changes to MAX 2.x Plug-Ins to Run in MAX 3.0
See Also: What's New in the MAX 3.0 SDK.
Overview
This section provides general information on the changes required to all plug-ins to get them running in 3ds max 3.0. It also provides links to topics which discuss the specific changes for many affected plug-in types. Some of these changes are required while others are optional but advantageous.
Current Compiler Version
A new version of the compiler is required. Visual C++ 6.0 is used for 3ds max 3.0. Prior versions of the compiler are no longer supported.
DLL and File Loading Changes
The following changes were made affecting the loading of previous version DLLs and 3ds max files:
The value MAX_API_NUM was changed to 6 and thus DLL's compiled with the R2 API won't load.
The value MAX_RELEASE was changed from 2500 to 3000 to indicate the current release.
The name of the class directory in 3ds max R3 files from was changed from "ClassDirectory2" to "ClassDirectory3". This will prevent 3ds max R3 files from being loaded into 3ds max R2 (3ds max will put up an Invalid File message).
Library Files Renamed and Eliminated
The old \MAXSDK\LIB\UTIL.LIB file has been renamed to MAXUTIL.LIB. This prevents a conflict with a library file provided by VC++ 6.0. Therefore, developers will need to update their projects to point to the new LIB file instead.
PATCH.LIB has been eliminated from the SDK. Now simply use CORE.LIB.
Parameter Block and Parameter Map Improvements
There is a new scheme for parameter blocks and parameter maps in release 3. While the old system still exists and will run fine, developers are encouraged to support this new system in their plug-ins. This makes them available to the macro recorder, 3ds max Scripter and Schematic View. See the Advanced Topics section Parameter Blocks and Maps in Release 3 for implementation details.
Miscellaneous Changes in R3 That May Affect Plug-Ins
Floating Dialogs
This section relates to two common bugs in previous versions of 3ds max and thus likely many plug-ins that have copied or imitated 3ds max's source code.
The problems are that modal dialogs aren't "truly" modal, and that modeless dialogs aren't getting disabled when other modal dialogs are presented.
The first condition to be on the look out for is the "Orphaned Dialog" type of bug. An example of this occurs when a user brings up a modal dialog, then hits a 3ds max toolbar button like "Undo", and the object that brought the dialog up goes away. The problem here is that the dialogs aren't "modal enough". That is, when a modal dialog is displayed, one should never be able to hit any toolbar button or menu entry from 3ds max's main user interface. The problem is that modal dialogs created with "DialogBox" of "DialogBoxParam" are only modal relative to their parent window. The solution is to use 3ds max's main window as the parent window of any modal dialog created. Developers can get the proper window handle to use with Interface::GetMAXHWnd(). Once this is done, users can't hit "Undo" or any other operation from 3ds max's main user interface while a modal dialog is displayed.
The second condition, where modeless dialogs aren't disabled, occurs because the dialog is not registered with Windows. Developers using modeless dialogs must call Interface:: RegisterDlgWnd() to prevent this problem.
In Summary: ALL modeless dialogs in 3ds max have to be registered with Interface::RegisterDlgWnd() and ALL modal dialogs in 3ds max have to be a direct child of 3ds max (developers must use Interface::GetMAXHWnd() when the dialog is created).
Getting the Mesh from a TriObject
The method TriObject::Mesh() method has been renamed to TriObject::GetMesh(). Plug-ins using the old method name will have to be changed.
SaveRequired API Change
Two existing functions have been renamed and one has been added. This change will cause many existing plug-ins to fail to build, however the fix is trivial. See below:
The existing function:
void SetSaveRequired(int b=TRUE)
has been renamed to:
void SetSaveRequiredFlag(BOOL b=TRUE)
The existing function:
BOOL GetSaveRequired()
has been renamed to:
BOOL GetSaveRequiredFlag()
There is also a new function:
BOOL IsSaveRequired().
The reason for these changes is that these two functions had misleading names. GetSaveRequired() does not tell you if saving is required, it just returns the value of the 'save required' bit. To really know if saving is required, you have to check the undo buffer as well as this flag. This is what the new function IsSaveRequired() is doing. If this function reports true, then you'll get the prompt at reset, file open, etc. The same goes for SetSaveRequired(), SetSaveRequired(TRUE) will cause the "save changes" prompt to appear, but SetSaveRequired(FALSE) will not prevent it from coming up unless you also reset the undo buffer.
Middle Mouse Button
The middle mouse button may now be used to perform the arc-rotate function (by holding down the Alt-key). This new functionality necessitated an internal change where the viewport transformation might change inside a plug-ins mouse proc. To avoid problems plug-ins should not cache the viewport transformation at the start of the mouse proc as it may change due to the user performing an arc-rotate. Very few plug-ins do this currently, but those that do must not rely on this any longer.
Links to Topics By Plug-In Type
This section provides links to topics on the required and optional changes for each plug-in type.
Note that all developers should be sure to look over the "Miscellaneous Changes in R3 That May Affect Plug-ins" section above since there may be important changes listed there as well.
Required Changes To Atmospheric Plug-Ins
Required Changes To Bitmap Loader/Saver Plug-Ins
Required Changes To Controller Plug-Ins
Required Changes To File Export Plug-Ins
Required Changes To File Import Plug-Ins
Required Changes To Geometric Objects
Required Changes To Helper Objects
Required Changes To Light Plug-Ins
Required Changes To Materials Plug-Ins
Required Changes To NURBS Related Plug-Ins
Required Changes To Patch Related Plug-Ins
Required Changes To Procedural Shapes
Required Changes To Renderer Plug-Ins
Required Changes To Shape Objects
Required Changes To Snap Plug-Ins