Change Handlers and Callbacks

 

   

Callback Notifications - Quick Navigation

Change Handlers and Callbacks are used to detect when certain types of events occur to scene objects or within 3ds Max.

Change Handlers are applied to individual MAXWrapper objects and specify an attribute to monitor for that object and an expression to evaluate when that attribute changes. Example attributes that can be monitored are geometry, name, transform, and parameters. Change Handlers are not stored in the 3ds Max scene.

Callbacks are used to register with 3ds Max functions that are called when specific events occur within 3ds Max. Events that can be monitored are changes to the time slider tim and redrawing of viewports. Callbacks are not stored in a 3ds Max scene.

MAXScript also provides several methods that automatically tie into 3ds Max’s Callback system. These General Event Callback Mechanism methods are used to register and unregister 3ds Maxs scripts that are called for a variety of 3ds Max events. These scripts can optionally be saved with the currently-open file and stay permanently with it, running whenever the scene is loaded, until they are explicitly removed.

The Node Event System introduced in 3ds Max 2009 provides a direct exposure of the SDK INodeEventCallback methods and allows more node-related events to be captured, including mapping changes and node-related Undo/Redo actions.

The above systems are described in more detail in the following topics:

Change Handlers and When Constructs

Time Change Callback Mechanism

Viewport Redraw Callback Mechanism

General Event Callback Mechanism

Node Event System

See Also