What's New in the MAX 4.0 SDK

3DS Max Plug-In SDK

What's New in the MAX 4.0 SDK

See Also: Required Changes to MAX 3.x Plug-Ins for MAX 4.0.

Overview

This section provides a general overview of the new capabilities of the 3ds max 4.0 API. New plug-in types, new classes, and new methods to existing classes have been added. In some cases new parameters to existing methods have been added as well.

Any new classes in the SDK begin their Description section with the line:

This class is available in release 4.0 and later only

Any new methods in a class begin:

This method is available in release 4.0 and later only

Newly added parameters to existing methods begin:

This parameter is available in release 4.0 and later only

Newly added data members begin:

This data member is available in release 4.0 and later only

New Plug-In Types

The following are the new plug-in types introduced in the 3ds max 4.0 SDK. Each has a link to the base class for the creation of that plug-in type.

Manipulator Plug-Ins

One of the new UI features for R4 is a system of direct manipulation plug-ins called manipulators. These plug-ins are a special kind of helper object that can be used to modify parameters of Objects, Modifiers, INodes and Controllers by using gizmos in the 3D viewports. See Class Manipulator or Class SimpleManipulator for more details.

The relevant classes are located in \MAXSDK\INCLUDE\MANIPULATOR.H

A sample on how to write these plugins is located in \MAXSDK\SAMPLES\HOWTO\BENDMANIP

Tone Operator Plug-Ins

In order to provide better quality images a tone operator plug-in has been added to 3ds max and the SDK. This is used to convert lighting energy values to RGB values for rendering and display after shading is performed. See Class ToneOperator for more information on this topic.

The relevant classes are located in \MAXSDK\INCLUDE\TONEOP.H

Render Element Plug-Ins

A new plug-in type called Render Elements has been added. A render element isolates a component of a rendering like specular, diffuse, emission, etc. and outputs it to either a separate bitmap or a multi-channel RPF or RLA file. The new plug-in type communicates with the ShadeContext, retrieving color data stored there by the shaders, compositing and saving the resulting image to file. See Render Elements for more details.

The relevant classes are located in \MAXSDK\INCLUDE\RENDERELEMENTS.H

Multi-Pass Render Camera Effect

The multipass camera effect allows modification of viewpoints & view directions or time for each pass of a multipass rendering. Algorithms such as Depth of Field, Scene motion blur can be implemented using multipass techniques. See Class ImultiPassCameraEffect for more details.

The relevant classes are located in \MAXSDK\INCLUDE\OBJECT.H

Inverse Kinematics, Solver Plugins.

IK solvers are now plug-able. The IK system will recognize a plug-in solver by putting it in the solver list wherever it appears. For more information refer to the section on Inverse Kinematics.

The API of the IK solver is defined in \MAXSDK\INCLUDE\IKSOLVER.H, IKHIERARCHY.H, IIKSYS.H, and IKCTRL.H. For an example, please look at \MAXSDK\SAMPLES\IKSOLVERS\IKLIMB

New Features By Category

Rendering

Interactive Reshading

The relevant classes are located in \MAXSDK\INCLUDE\MTL.H. See Class IReshading.

Interactive Rendering

With the likelihood of evolving rendering and shading techniques which are going to be markedly different from what is being used now, the 3ds max SDK provides the infrastructure to support interactive rendering. Since renderers are a plugin to 3ds max and since each renderer has a different set of resources and capabilities the interactive rendering and shading API is made into as much a general API and independent as possible. See Class IInteractiveRender.

Image Motion Blur

The new motion blur effect plug-in, MotionBlur.dlv, now contains code that used to be part of the renderer, and uses function publishing to allow the renderer to call functions to do image blur. For details on how this is done see Class IMBOps. Sample code is available in \MAXSDK\SAMPLES\RENDER\RENDEREFFECT\MOTIONBLUR\MOTIONBLUR.CPP.

Also, Image Motion Blur has been improved so that objects that are moving behind transparent object will blur fairly realistically. See Class GBuffer for details. The relevant classes are located in \MAXSDK\INCLUDE\GBUF.H, IMBLUR.H

Vertex Colors from a Non-Internal Color Array

A new method of the Mesh class allows the source data for vertex colors to come from other than the default, internal vertex color array (also known as map channel 0). Class Mesh (Color Per Vertex Methods) . An overview of this can be found in the Advanced Topics section Working With Meshes. The relevant classes are located in \MAXSDK\INCLUDE\MESH.H.

Material Surface Evaluation

Material surface evaluation allows extraction of more precise color information from a material. The material interface now exports a set of functions in order to enable "interactive display" to show the material correctly in the viewport. Note that these functions do not take into consideration texture maps and other shading parameters. Relevant changes were made to Class Mtl and Class Texmap.

Multiple Map Display in the Viewports

The code in the Mesh class and associated classes has been modified so that multiple textures are available for display in the interactive viewport. See Class Mesh. Plug-In Materials have several new methods to implement related to this. These are SetupGfxMultiMaps and SupportsMultiMapsInViewport from Class MtlBase. The relevant classes are located in \MAXSDK\INCLUDE\MESH.H, IMTL.H.

New Material Handlers for New Particle Systems

This interface allows particle systems to support material per face and particle ID per face. This class may also be used by plug-ins that want to support this capability. See Class IChkMtlAPI. The relevant classes are located in \MAXSDK\INCLUDE\CHKMTLAPI.H

New Network Rendering API

This is the new API for network rendering. The relevant classes are located in \MAXSDK\INCLUDE\MAXNET_MANAGER.H. See the Advanced Topics section Network Rendering for details.

A New Interface to Allow Multiple Image Viewers (VFBs)

Up until this point, the VFB has been tightly coupled with the 3ds max Bitmap implementation. This new abstract interface will let multiple image viewer implementations be used to view Bitmaps.

See Class IImageViewer for details.

The relevant classes are located in \MAXSDK\INCLUDE\IIMAGEVIEWER.H

User Interface

Action Tables

New in R4 is a class called ActionTable that is a generalization of the ShortcutTable class added for R3. ActionTable contains operations that can be tied to various UI elements in 3ds max including toolbar buttons, keyboard shortcuts and menu items. See the Advanced Topics section UI Customization for details. The relevant classes are located in \MAXSDK\INCLUDE\ACTIONTABLE.H, MAXAPI.H, PLUGAPI.H.

Function Publishing

See the Advacned Topics section on Function Publishing System for details.

Track Bar Update

The Track Bar API has been updated to support the new functionality provided in R4. See Class ITrackBar. The relevant classes are located in \MAXSDK\INCLUDE\MAXAPI.H

Menu Manager

This is an interface to the menu customization system. See Class IMenuManager. The relevant classes are located in \MAXSDK\INCLUDE\IMENUMAN.H

Color Manager

The color manager allows plug-ins to register colors that can be customized and saves / restores them from a file. See Class IColorManager. The relevant classes are located in \MAXSDK\INCLUDE\ICOLORMAN.H

OLE DragAndDrop Manager

The DragAndDrop manager is a new component in R4 that provides a general framework for handling OLE-based drag-and-drop in 3ds max. The prime motivations for adding this new component were to accommodate the new iDrop™ tool for dragging 3ds max content from the web and to provide a general way to implement drop targets for the new dropScript capability in 3ds max.

The new manager is a generalization of the VIZ R3 OLE-based DragAndDrop manager that has been ported into 3ds max 4. It is exposed through a public API in the 3ds max SDK and the Function Publishing system, supports an extensible set of clipboard formats and drop types and permits individual 3ds max windows to specialize drop handling. This allows you to support new iDrop™ file types, such as dropScripts, fold the 3ds max internal drag-and-drop into the same system that handles external drag-and-drop, and allows custom drops to various interesting windows in 3ds max, such as the material editor, schematic view, the new modifier stack, etc. or other 3rd-party windows. See Class IDragAndDropMgr for more details.

The relevant classes are located in \MAXSDK\INCLUDE\IDRAGANDDROP.H

Dialog Position / Size Manager API

This feature may be used to increase UI consistency by having all major floating dialogs remember their previous position and size, like Track View and Medit do now. This is done by calling methods to save the size / position to the CUI file.

R4 Parameter Wiring System

The parameter wiring features are encapsulated in an interface class that allows you to directly control the various parameter wiring operations. See Class IParamWireMgr for more information.

The relevant classes are located in \MAXSDK\INCLUDE\ IPARAMWIRE.H

New Mouse Manager Functionality

Newly added to the mouse manager is the ability to add a callback function that lets a command mode get all the raw mouse windows messages from a viewport. This way developers can avoid using the MouseCallBack::proc() method, which does a lot of filtering on the messages that it sends.

The relevant classes are located in \MAXSDK\INCLUDE\MOUSEMAN.H

Modeling

Node Handles

This is a new unique ID for each node in the scene. See Class INode and Class Interface, in particular the methods Interface::GetINodeByHandle() and INode::GetHandle(). The relevant classes are located in \MAXSDK\INCLUDE\INODE.H and MAXAPI.H

Node Display Callback

The feature enables a plug-in developer to register a callback function that gets called whenever a node needs to be drawn. The developer can hide the standard mesh and display their own image for the node. This allows one to control a node's display without being part of the modifier stack. See Class NodeDisplayCallback.

The relevant classes are located in \MAXSDK\INCLUDE\NODEDISP.H

New Callback Classes

Two new callbacks are available. One is used to filter the display of nodes in the scene by category. See Class DisplayFilterCallback. The other is to filter the selection of nodes. See Class SelectFilterCallback. Also see the methods in Class Interface associated with activating these callbacks (Interface callback methods).

Extension Object -- New Extension Channel

This feature enhances the geometry pipeline by allowing a developer to add a custom object to the pipeline object. This object will get notified whenever something in the pipeline changes. This extends the flexibility of the Modifier Stack by being able to implement a combination of a custom data notification system. An example of this in use is a game developer who wants to indicate when a certain object becomes invalid for export to their game engine. By inserting an Extension Object into the pipeline they can accomplish this, by constantly checking the structure of the object and displaying wrong faces/vertices etc. in the viewport. See Class XTCObject.

Sample code is available in: \MAXSDK\SAMPLES\EXTENSIONCHANNELOBJECTS\XMODIFIER.H

The relevant classes are located in \MAXSDK\INCLUDE\CHANNELS.H, XTCOBJECT.H

Geometry Pipeline Enumeration

There is a new class and several new global functions that can be used to enumerate the geometry pipeline.

For details see Class GeomPipelineEnumProc.

Vertex Alpha

This feature adds map channels to support "Vertex Alpha" and "Vertex Illumination" in all object types and gives the user editing controls for these channels in Editable Objects and Edit Modifiers. See Class Mesh. The relevant prototypes are located in: \INCLUDE\MESH.H

Custom Face Data Storage

This feature allows a Mesh object to support up to 100 custom data channels for Faces. Each channel provides an array to store data as defined by the developer. The types of data will often be standard items such as floats and ints, however, pointers to more sophisticated objects may be stored as well. The number of elements in the array for each channel will correspond to the number of faces in the Mesh.

The main advantages and differences over the current per-vertex-data support are: face-data channels are identified by a Class_ID rather than an integer; face-data channels can store objecst of a user defined type, not just float; 3rd party developers can derive their own face-data channel from Class IFaceDataChannel. The Mesh notifies all its face-data channel objects of events and operations related to faces, so 3rd parties can really manage their per-face data the way they want, they have a lot of flexibility.This is different from the current per-vertex-data because the vertex data channels are entirely exposed to and managed by the Mesh. Note that only Meshses support the IFaceDataMgr interface. See Class IFaceDataChannel, Class IFaceDataMgr.

Object Conversion Between Types

There is a new class that allows developers to convert between their object types and the native 3ds max types. See Class ObjectConverter for details.

Conversion Modifiers

There are now modifiers to perform explicit object type conversions in the pipeline. Specifically, modifiers which will operate on all object types:

Turn to Mesh

Turn to Patch

Turn to Poly

There are new global functions for doing this conversion. See the Explicit Conversion Functions.

The relevant prototypes are located in \MAXSDK\INCLUDE\PATCH.H and POLYOBJ.H

SubObjType API

There is a new API for working with Sub-Objects. The new Stack View in the command panel uses this API. There are several new classes related to it. See Class BaseObject[the Class BaseObject page has the wrong font on its title], Class ISubObjType, Class GenSubObjType, Class MaxIcon. The relevant classes are located in \MAXSDK\INCLUDE\OBJECT.H.

Polymesh Object

See Class PolyObject.

The relevant classes are located in \MAXSDK\INCLUDE\POLYOBJ.H

Editable Poly

See Class EPoly.

The relevant classes are located in \MAXSDK\INCLUDE\IEPOLY.H

Patches

A large number of new methods and data members have been added to the various classes relating to patches. Details on these new methods and data members can be found by browsing through the classes listed below and looking for the R4 specific availability notes. In this section a shortlist of general additions and changes will be listed.

Class PatchMesh has gained a number of methods dealing with unifying and flipping normals, welding and cloning, vertex weights, and linear and curved mapping.

Class PatchObject has gained a number of methods dealing with setting the Show End Results option and handling the status thereof, getting and setting vertex and patch colors, selecting vertices by color and illumination, creating shapes from edges, welding and breaking, flipping and unifying normals, deleting selected patches, and changing the mapping type of patches.

Class Patch has gained a few methods dealing with linear and curved mapping, finding edges and vertices based on vertex indices.

Class TVPatch has gained some extra data members and methods dealing with patch handles and interiors.

Class PatchVert will now deal with an array of edges used by a vertex.

See Class PatchMesh, Class PatchObject, Class Patch, Class PatchEdge, Class TVPatch, Class PatchVert

See Required Changed from R3.x to R4.

The relevant classes are located in \MAXSDK\INCLUDE\PATCH.H and PATCHOBJ.H

Animation

New Interface Classes for Various Controllers

There are several new classes for accessing the parameters of new or modified controllers in R4. These are listed below. The relevant classes are located in \MAXSDK\INCLUDE\ISTDPLUG.H

LookAt Constraint

This is the new Look At Controller (rotation only as opposed to the previous LookAt Transform controller). An interface to its parameters is available in Class ILookAtConstRotation.

Orientation Constraint

The Orientation Constraint matches the orientation of an object to its target without affecting its position. See Class IOrientConstRotation for the interface details.

Position Constraint

A 3ds max user can use the Position Constraint to make an object move to and be coincident with another target object. The Position Constraint can also move an object to the position of the weighted average of several different targets. See Class IPosConstPosition for access to this controller.

Path Constraint

The old path controller has been modified and renamed the Path Constraint. For an interface to the parameters of this controller see Class IPathPosition.

New System Utilities

New Notification Codes

Numerous new notification codes have been added for R4. See Structure NotifyInfo.

The relevant structure is located in \MAXSDK\INCLUDE\NOTIFY.H

New Reference Messages

There are a few new reference message that may be used. See List of Reference Messages.

The relevant defines are located in \MAXSDK\INCLUDE\REF.H

Scanline Pager template

This new template is used to minimize memory usage when rendering. Bitmaps (for instance textures and the frame buffer) are normally accessed on a scanline basis when rendering. Currently they are fully loaded into memory when rendering starts. This class is used to try to keep only the active block of scanlines in memory and the rest of the bitmap on disk – making the extra RAM available for geometry and other memory buffers.

The relevant classes are located in \MAXSDK\INCLUDE\SCANLINEPAGEMGR.H

New Miscellaneous Global Functions

See List of Miscellaneous Utility Functions for a few new global functions related to checking the number of processors in the system, determining the version of Windows running, and checking the screen width and height.

Custom Attributes

An unlimited number of custom attributes (e.g. parameters) can be added dynamically to individual objects. These can be very useful for game developers and/or other project specific data. The SDK provides a way to define and add these custom attributes to objects in the scene.

A sample on how to write these plugins is located in \MAXSDK\SAMPLES\HOWTO\CUSTATTRIBUTIL

See Class CustAttrib for details on custom attributes.

Particle Collision Encapsulation

The SDK adds new support for particle collision detection whereby other systems such as Flex and MaxScript can also benefit from this more open architecture. These collision API’s provide an interface to determine if a particle hits a surface. Three basic collision detection classes are provided, a planar, spherical, and a mesh deflection class.

See Class ICollision for more information.

Random Number Generator

A new and improved random number generator class has been provided in order to deal with the shortcomings of the standard random number generation functions.

See Class RandGenerator for more information.

Support for Hardware Shaders

3ds max 4.0 supports custom hardware vertex shaders and pixel shaders using Direct-3D, right in the graphics viewports. The primary aim of this support is to enable a 1:1 relation between what users see in the viewport and the content they are creating for other Direct-3D enabled applications.

See Class ID3DGraphicsWindow, Class IDX8PixelShader, and Class IDX8VertexShader for more information.