Plug-In Types Overview

3DS Max Plug-In SDK

Plug-In Types Overview

See Also: Plug-In Architecture Overview.

The following is a brief description of the categories of plug-ins one may create using the 3ds max Software Development Kit.

Sample code in the SDK is available to demonstrate techniques for programming many of these plug-in types. Additional sample code is available to Sparks Developers. Also see the section on Debugging.

The 3ds max 4.0 SDK comes provided with an SDK appwizard that can be used with Microsoft Visual C++. This appwizard allows you to quickly generate skeleton source code for a variety of different plugin types and essentially replaced the previous R3_SKELETON projects included in the previous release of the software.

The generated code from the appwizard provides a quick way to start building plugins. Each project follows a standard structure with regard to headers and code files. Developers should find it easy to take this generated code and can start creating plugins without manually setting up the entire project from scratch.

Procedural Objects

Procedural Objects are the general class of developer-defined objects that can be used in 3ds max.

Geometric Objects

These are the only procedural objects that actually get rendered.

Primitives

Primitive objects such as boxes, spheres, cones, cylinders, and tubes are implemented as procedural geometric objects. These are derived from class GeomObject or SimpleObject. Example code may be found in \MAXSDK\SAMPLES\OBJECTS\BOX.CPP, SPHERE.CPP, CONE.CPP, etc.

Particles

Developers may create procedural object particle system plug-ins. Some examples are particles that depend upon procedural motion like fireworks, explosions, and water, or particles that track the surface of objects like electrical fields or flame. Applications can be derived from ParticleObject or SimpleParticle. Example code is available in \MAXSDK\SAMPLES\OBJECTS\RAIN.CPP and \MAXSDK\SAMPLES\MODIFIERS\GRAVITY.CPP.

Loft Objects

The 3ds max Lofter is implemented as a procedural object plug-in. Developers may define other modeling modules that fit this form.

Compound Objects

Compound objects take several objects and combine them together to produce a new object. Examples are Booleans (which produce a new object using operations Union, Intersection and Difference) and Morph objects. Sample code for the boolean object can be found in \MAXSDK\SAMPLES\OBJECTS\BOOLOBJ.CPP.

Patches

Developers can create patch modeling systems that work inside MAX. The TriPatch and Patch Grid are examples of patch objects. These plug-ins are derived from PatchObject. See \MAXSDK\SAMPLES\OBJECTS\PATCHGRD.CPP, and TRIPATCH.CPP for sample code.

NURBS

The NURBS API provides an interface into the NURBS objects used by MAX. Using the API developer can create new NURBS objects or modify existing ones. See the Advanced Topics section Working with NURBS for more information.

Helper Objects

Helper objects are items such as dummy objects, grids, tape measurers and point objects. These objects may be derived from classes HelperObject or ConstObject. Sample code may be found in \MAXSDK\SAMPLES\OBJECTS\HELPERS\GRIDHELP.CPP, and PTHELP.CPP. See Class HelperObject and Class ConstObject.

Shape Objects

These are shapes such as Circles, Arcs, Rectangles, Donuts, etc. New splines may be subclassed off SimpleSpline. Sample code may be found in \MAXSDK\SAMPLES\OBJECTS\CIRCLE.CPP, ELLIPSE.CPP, ARC.CPP, etc.

Procedural Shapes

These are shapes that are defined procedurally. An example procedural shape, Helix, may be found in \MAXSDK\SAMPLES\OBJECTS\HELIX.CPP. When an edit spline modifier is applied to a procedural shape it is converted to splines with segments that provide vertices in a linear approximation of the shape. This allows the procedural shape to be edited. Procedural shapes may be derived from class SimpleShape. Other examples include Procedural lines, and Text.

Any of these objects can be edited with an edit spline modifier or extruded or surfrev'd.

Lights

Developers may create custom plug-in lights. There are several classes from which light plug-ins may be derived. These are LightObject, and GenLight. Example code may be found in \MAXSDK\SAMPLES\OBJECTS\LIGHT.CPP.

Cameras

Developers may create custom cameras. The two classes from which cameras may be derived are CameraObject and GenCamera. An example of a plug-in camera may be found in \MAXSDK\SAMPLES\OBJECTS\CAMERA.CPP.

Object Modifiers

Object modifiers are applied to objects in their own local transform space to modify them in some way. Deformations like Bend, Taper, and Twist are examples of Object Modifier plug-ins. Example code may be found in \MAXSDK\SAMPLES\MODIFIERS\BEND.CPP, TAPER.CPP, etc.

Extrude and Surfrev are also object modifier plug-ins. Sample code for Extrude can be found in \MAXSDK\SAMPLES\MODIFIERS\EXTRUDE.CPP.

Developers may also create surface modifier plug-ins to alter smoothing groups, texture coordinates, and material assignments. See Class Modifier or Class SimpleMod.

Edit Modifiers

These plug-ins allow specific object types to be edited. For example, an Edit Mesh modifier allows objects that can convert themselves into triangle meshes to be edited, while an Edit Patch modifier allows objects that can convert themselves into patches to be edited. Edit modifiers typically allow the user to select sub-object elements of the object (vertices faces and edges in the case of the Edit Mesh modifier) and perform at least the standard move/rotate/scale transformations to them. They may also support additional operations (such as the extrude option of the Edit Mesh modifier). Example code may be found in \MAXSDK\SAMPLES\MODIFIERS\EDITMESH.CPP.

Space Warps

Space Warps are basically object modifiers that affect objects in world space instead of in the object's local space (they were originally called 'world space modifiers'). Space Warps are non-rendering objects that affect other objects in the scene based on the position and orientation of the other objects that are bound to the Space Warp object. For example, the Ripple Space Warp applies a sine wave deformation to objects bound to it. Other examples of Space Warps include things like explosions, wind fields, and gravity. Sample code may be found in \MAXSDK\SAMPLES\MODIFIERS\SINWAVE.CPP.

Space warps are created in the Creation branch of the command panel, which makes them slightly different from regular modifiers (because they are combinations of space warp objects and space warp modifiers).

Space warps may also affect particle systems. For example, a force field can be applied to a particle system by a space warp. The force field provides a function of position in space, velocity and time that gives a force. The force is then used to compute an acceleration on a particle which modifies its velocity. For details see \MAXSDK\INCLUDE\OBJECT.H, \MAXSDK\SAMPLES\MODIFIERS\GRAVITY.CPP, and \MAXSDK\SAMPLES\OBJECTS\RAIN.CPP.

A collision object can also be applied to a particle system by a space warp. The collision object checks a particle's position and velocity and determines if the particle will collide with it in the next period of time. If so, it modifies the position and velocity.

Controllers

Controller plug-ins are the objects in 3ds max that control animation. Controllers come in different types based on the data they control. The most common controllers are interpolating or keyframe controllers. Other controller types are position/rotate/scale, mathematical expressions and fractal noise. Example controller code may be found in \MAXSDK\SAMPLES\HOWTO\PCONTROL\PCONTROL.CPP, and NOIZCTRL.CPP etc. Controllers may be derived from Class Control or Class StdControl.

Systems

Systems are basically combinations of more than one type of procedural object, along with optional controllers, or modifiers, or space warps all working together. These plug-ins can provide high-order parametric control over very complex systems. An example system is Biped which uses procedural objects and master/slave controllers.

File Import

These plug-ins allows 3D geometry and other scene data to be imported and exported to file formats other than the 3ds max format. An example file import plug-in may be found in \MAXSDK\SAMPLES\IMPEXP\3DSIMP.CPP. These plug-ins are derived from Class SceneImport.

File Export

These plug-ins allows 3D geometry and other scene data to be exported to file formats other than the 3ds max format. Sample code may be found in \MAXSDK\SAMPLES\IMPEXP\3DSEXP.CPP. These plug-ins are derived from Class SceneExport.

Atmospheric Plug-Ins

These plug-ins are used for atmospheric effects. MAX's Fog, and Volume Fog are two atmospheric plug-ins. Certain particle system-ish effects can be accomplished via atmospherics more efficiently. For example, a fire effect that is not done with particles but rather as a function in 3D space (the Combustion plug-in is a good example of this). Instead of rendering particles you traverse a ray and evaluate a function. These plug-ins typically use very little memory relative to a particle system equivalent. Atmospheric plug-ins also have the ability to reference items in the scene. (For example, MAX's Volume Lights reference lights in the scene.) These plug-ins are derived from Class Atmospheric.

Plug-In Materials

These are additional developer-defined material types. Examples are Standard, Mix, and Multi/Sub-Object materials. New materials are subclassed from Class Mtl. Also see the section Working with Materials and Textures. The sample code for these plug-ins is in \MAXSDK\SAMPLES\MATERIALS.

Plug-In Textures

Procedural Texture plug-ins define 2- or 3-dimensional functions which can be assigned as maps within the shader tree architecture of the Materials Editor. Maps may be assigned as ambient, diffuse, specular, shininess, shininess strength, self-illumination, opacity, filter (transmission) color, bump, reflection and refraction maps. These functions may vary over time to produce animated effects. There are both 2D and 3D procedural textures, compositors and color modifiers. These plug-ins are derived from Class Texmap. Also see the section Working with Materials and Textures. The sample code for these plug-ins is in \MAXSDK\SAMPLES\MATERIALS.

2D Procedural

Examples of 2D texture are BITMAP.CPP and CHECKER.CPP.

3D Procedural

Examples of 3D textures are MARBLE.CPP and NOISE.CPP.

Compositor

Some examples of compositors are MASK.CPP and MIX.CPP.

Color Modifier

An example color modifier is RGB TINT.CPP.

Developers that have created a 3D Studio/DOS SXP and a corresponding 3ds max texture plug-in may want to have a look at Class Tex3D. It provides a way to have an instance of your 3ds max texture plug-in created automatically when the corresponding SXP is found in a 3DS file being imported.

Image Processing Plug-Ins

Filters

Filters may be used to alter images in the video post data stream. Filters may operate on a single image or may combine two images together to create a new composite image. These plug-ins are derived from Class ImageFilter. Also see the section Working with Bitmaps.

One Pass Filter

This plug-in type allows a single image in the video post data stream to be adjusted in some manner. An example plug-in of this type is \MAXSDK\SAMPLES\POSTFILTERS\NEGATIVE\NEGATIVE.CPP.

Layer Filter

This plug-in allows two images to be composited to create a single new image. An example of this type of plug-in is \MAXSDK\SAMPLES\POSTFILTERS\ADD\ADD.CPP or \MAXSDK\SAMPLES\POSTFILTERS\ALPHA\ALPHA.CPP.

G Buffer

A G-buffer is used to store, at every pixel, information about the geometry at that pixel. All plug-ins in video post can request various components of the G-buffer. When video post calls the renderer it takes the sum of all the requests and asks the renderer to produce the G-buffer. Developers can use this information to create visual effects that are impossible to achieve without access to a G-buffer. See Class GBuffer.

Rendering Effects

This plug-in type is available in release 3.0 and later only.

There is a new item under the Rendering menu which displays the Rendering Effects dialog. From this modeless dialog, the user can select and assign a new class of plug-in, called a "Rendering Effect," which is a post-rendering image-processing effect. This lets the user apply image processing without using Video Post, and has the added advantage of allowing animated parameters and references to scene objects. The base class for these plug-ins is Class Effect. Sample code is available in the directory \MAXSDK\SAMPLES\RENDER\RENDEREFFECT.

Snap Plug-Ins

This plug-in type is available in release 2.0 and later only.

This plug-in type allows custom points to be provided to the 3ds max snapping system. For example a door plug-in could provide a custom snap for the hinge center. See Class Osnap for details. For sample code see \MAXSDK\SAMPLES\SNAPS\SPHERE\SPHERE.CPP.

Image Loading and Saving Plug-Ins

Image loading and saving plug-ins allow the image file formats loaded and saved by 3ds max to be extended. An example is the JPEG loader / saver. Sample code may be found in the sub-directories of \MAXSDK\SAMPLES\IO. These plug-in types are derived from Class BitmapIO. Device drivers are also derived from this class. See the sample code in \MAXSDK\SAMPLES\IO\WSD\WSD.CPP.

Utility Plug-Ins

These plug-ins are useful for implementing modal procedures such as 3D paint, dynamics, etc. These plug-ins are accessed from the Utility page of the command panel. Example code may be found in the subdirectory \MAXSDK\SAMPLES\UTILITIES. These plug-ins are sub-classes off Class UtilityObj.

Global Utility Plug-Ins

This plug-in type is available in release 3.0 and later only.

These simple utility plug-ins are loaded at boot time, after initialization, but before the message loop starts, and remain loaded. This is how the new 3ds max COM/DCOM interface is implemented. For details see Class GUP.

Track View Utility Plug-Ins

These plug-ins are launched via the 'Track View Utility' icon just to the left of the track view name field in the toolbar. Clicking on this button brings up a dialog of all the track view utilities currently installed in the system. Most utilities will probably be modeless floating dialogs, however modal utilities may be created as well. These can provide general utility functions that operate on keys, time or function curves in Track View. Sample code is available in \MAXSDK\SAMPLES\UTILITIES\RANDKEYS.CPP, ORTKEYS.CPP and SELKEYS.CPP. These plug-ins are sub-classes off Class TrackViewUtility.

Plug-In Renderers

Plug-In renderers are derived from the class Renderer. The standard 3ds max scanline renderer is itself derived from this class. In a trivial sense, there are only a few methods to implement to create a renderer: Open(), Render(), Close(), ResetParams() and CreateParamDlg(). See Class Renderer for more details on this plug-in type.

Shader Plug-Ins

This plug-in type is available in release 3.0 and later only.

This plug-in type works with the new Standard material. It allows plug-in developers to add additional shading algorithms to the drop down list of available options (previously Constant, Phong, Blinn, Metal). This was only possible previously by writing an entire Material plug-in (which could be a major undertaking). See the base class for this plug-in type Class Shader for details.

Sampler Plug-Ins

This plug-in type is available in release 3.0 and later only.

This plug-in type works with the Standard material of release 3. A Sampler is a plug-in that determines where inside a single pixel the shading and texture samples are computed. The user interface of Samplers appears in the Super Sampling rollout in the Sampler dropdown. See Class Sampler for details.

Anti-Aliasing Filter Plug-Ins

This plug-in type is available in release 3.0 and later only.

This plug-in type is used for filtering and anti-aliasing the image. Documentation for the base class for these filters is in Class FilterKernel. Sample Code is available in the subdirectory \MAXSDK\SAMPLES\RENDER\AAFILTERS.

Shadow Generator Plug-Ins

This plug-in type is available in release 3.0 and later only.

The generation of shadows is accessible via this plug-in type. The standard 3ds max mapped and raytraced shadows have are plug-ins of this form. See Class ShadowType and ShadowGenerator for details. There is also a handy class for creating shadow map buffers. See Class ShadBufRenderer.

Sound Plug-In

A sound plug-in can take control of sound/music production in MAX. These plug-ins control not only the sounds they generate but also the system clock. They can thus coordinate the timing of external sound input / output devices with the animation. Sound plug-ins can provide their user interface as part of the 3ds max Track View.

Sound plug-ins are derived from Class SoundObj.

Color Selector Plug-In

This plug-in type is available in release 3.0 and later only.

This plug-in type provides the user with a custom color picker that appears whenever a standard 3ds max color swatch control is clicked. These plug-ins are selected in the General tab of the Preferences dialog. The color picker chosen is saved in the 3DSMAX.INI file in the "ColorPicker" section so that the choice is maintained between sessions. If the DLL for the selected color picker is not available, it will always default back to the "Default" color picker. See Class ColPick for details.

Front End Controllers

These plug-ins allow a developer to completely take over the 3ds max user interface. This includes the toolbar, pulldown menus, and command panel. See Class FrontEndController for details.

Motion Capture Input Devices

Motion Capture Input Device plug-ins can now be written that plug-in to the 3ds max motion capture system. See Class IMCInputDevice for details. Sample code is available in the subdirectory \MAXSDK\SAMPLES\MOCAP.

Image Viewer Plug-In

An image viewer is available from the 3ds max File menu under View File. A developer may replace the viewer DLL launched by this command to provide enhanced functionality for image browsing. The source code for this viewer is in \MAXSDK\SAMPLES\VIEWFILE\VIEWFILE.CPP. This plug-in is derived from Class ViewFile.

Notification Program

There is a program whose source code is in \MAXSDK\SAMPLES\UTILITIES\NOTIFY\NOTIFY.CPP. This program gets invoked by the network manager to handle network progress notifications.

A developer may write another "Notify" program in order to do any proprietary type of notifications. Note that "Notify" can be either a "*.exe", a "*.bat", or a "*.cmd" executable. This allows a user to create a simple script file to do something without having to resort to writing a binary program.

The current Notify.exe is very simple as it is used simply as a demonstration. It plays a different wave file for each of the event types. If invoked with no command line, it will bring up a dialog box asking the user to define each of the three wave files. The dialog has "Browse" buttons next to each wave file field which puts the user right into the Windows' "Media" directory where wave files are saved. There are also "play" buttons next to each sound so they can be tested.