MAXScript allows you to register callback scripts for all of the notification events supported by 3ds Max, such as pre/post scene file open, new, reset, scene file save, pre/post render, selection change, etc.
You can specify any number of callback scripts per notification event.
Callback scripts can be bundled into sets with user-defined IDs and can be deleted by type, by ID or by both.
Callback scripts can be specified as persistent so that they are saved and loaded with the currently open file.
Topic Navigation: | |
---|---|
Additional Notification Information on the Callback Render Dialog and Render Plugin Notifications |
Material Library Notifications |
The callbacks are added using the following syntax:
callbacks.addScript <callback_type_name> (<script_string> | <script_stringstream> | fileName:<filename_string>) [id:<name>] [persistent:<boolean>]
This method is used to register a new callback script. Requires as the first argument a name that specifies which type of notify event this script is associated with. The list of valid callback_type_name values is listed below.
The script is supplied either as a direct String or StringStream value containing the text of the script to run, or as a fileName: keyword argument, in which case the named file is loaded and run whenever the event notification callback occurs. You can specify either a direct string or a fileName: , but not both.
The optional id: parameter lets you tag one or a group of callbacks with a unique name so that you can remove them all as a group without interfering with other callbacks, perhaps registered by other scripted tools.
The optional persistent: parameter lets you control whether the script is saved permanently in the currently open scene file or is a global callback script that remains in place no matter what file opening and closing is performed. A true value for the parameter specifies that the script should be stored in the current file and loaded and registered for callback whenever that file is opened again. Persistent callback scripts are always removed when a new file is loaded or a reset is performed so that persistent scripts in one file don't accidentally get copied to a later file. The default for this parameter is false , indicating the script is a global script and is not persistent.
EXAMPLE: |
callbacks.addScript #preRender "setUpRenderGeom()" id:#jbwRender |
This registers a new callback script that will be called just before a render is performed. The script invokes a function (that has presumably already been set up). A unique ID has been assigned to the script for later selective removal. |
callbacks.removeScripts [<callback_type_name>] [id:<name>]
This method is used to unregister and remove one or more callback scripts.
Specifying just a callback event type name removes all the callback scripts for that event type.
Specifying just an id: removes all callback scripts in all events with that ID.
Specifying both limits the ID-based removal to the specified event type.
callbacks.show [<callback_type_name>] [id:<name>] [to:<stream>] \ [asArray: <bool>]
This method lists out the current callback scripts in the Listener window, or to an optional stream. Callbacks are listed with their ID, persistent setting, and the script or filename in which they are defined.
If the optional callback type name argument is specified in 3ds Max 2009 and higher, only callbacks of that type will be shown.
If the optional keyword argument id: is specified, only callbacks with that ID will be shown.
If type name and ID are both specified, only callbacks of the type with the given ID will be shown.
Available in 3ds Max 2018.4 and higher: If the optional keyword argument to: is specified, output from the method is sent to the specified stream.
NEW in 3ds Max 2019.3 Update: If the optional keyword argument
asArray: is specified, the output is returned as an array, with an element for each callback. Each element is an array that contains information about the callback.
Example |
-- show callbacks of type #filePreOpen callbacks.show #filePreOpen --> output: filePreOpen: id:#PhysXPlugin, persistent:false, script:"px_filePreOpen()" id:#ALC_SecurityTool, persistent:false, script:"::ALC_SecurityTool.scenePreOpen()" id:#CRP_SecurityTool, persistent:false, script:"::CRP_SecurityTool.m_in_file_open = true;::CRP_SecurityTool.register_post_load_check()" id:#ADSL_SecurityTool, persistent:false, script:"::ADSL_SecurityTool.m_in_file_open = true;::ADSL_SecurityTool.register_post_load_check()" -- the same thing, but as an array: callbacks.show #filePreOpen asArray:true --> output: #(#(#filePreOpen, #PhysXPlugin, false, false, "px_filePreOpen()"), #(#filePreOpen, #ALC_SecurityTool, false, false, "::ALC_SecurityTool.scenePreOpen()"), #(#filePreOpen, #CRP_SecurityTool, false, false, "::CRP_SecurityTool.m_in_file_open = true;::CRP_SecurityTool.register_post_load_check()"), #(#filePreOpen, #ADSL_SecurityTool, false, false, "::ADSL_SecurityTool.m_in_file_open = true;::ADSL_SecurityTool.register_post_load_check()")) |
callbacks.broadcastCallback <callback_type_name>
This method provides a way for you to simulate one of the events and have all the callback scripts for it executed.
Within 3ds Max, the #preRenderFrame and #postRenderFrame callbacks can only be called by the renderer. These callbacks can not be called by using this method.
callbacks.notificationParam()
This method can be called in a callback script to provide additional information on the callback. The value returned by this method varies based on the callback type. If no additional information was present for the callback, a value of 'undefined' is returned.
EXAMPLE: |
--Remove any existing callbacks with this ID. callbacks.removeScripts id:#MXSHelp --Add a new callback script which will call --callbacks.notificationParam() before selected nodes are deleted --and thus will print the deleted objects to the Listener: callbacks.addScript #selectedNodesPreDelete" print (callbacks.notificationParam())" id:#MXSHelp |
Below are all supported Callback Event Names and the callbacks.notificationParam() values typically returned. Depending on how the broadcast is generated, a value of 'undefined' may be returned by this method instead of the value shown.
#actionItemExecutionEnded: array
Sent when an action item finished executing.
Calling callbacks.notificationParam() returns an array with two elements:
#actionItemExecutionStarted: array
Sent when an action item starts executing.
Calling callbacks.notificationParam() returns an array with two elements:
#actionItemHotKeyPostExecute: array
Sent after an action item is executed via a keyboard shortcut (hotkey).
Calling callbacks.notificationParam() returns an array with two elements:
#actionItemHotkeyPreExecute: array
Sent before an action item is executed via a keyboard shortcut (hotkey).
Calling callbacks.notificationParam() returns an array with two elements:
#animateOff: undefined
Sent when the Animate button is turned off.
#animateOn: undefined
Sent when the Animate button is turned on.
#animationRangeChange: undefined
Sent when the Animation range is changed.
#animLayersDisabled: array of nodes
Sent just after animation layers are disabled on some nodes in the scene.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
#animLayersEnabled: array of nodes
Sent just after animation layers are enabled on some nodes in the scene.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
#tabbedDialogCreated: #(integer, integer)
Sent after the tabbed render dialog has been created.
#tabbedDialogDeleted: #(integer, integer)
Sent after the tabbed render dialog has been deleted.
#renderParamsChanged: undefined
Sent whenever the common renderer parameters have changed.
#preRendererChange: undefined
Sent before the current renderer is changed, or the type of one of the renderers is changed.
#postRendererChange: undefined
Sent after the current renderer is changed, or the type of one of the renderers is changed.
#imageViewerUpdate: IVFB Interface
Sent by an image viewer (or the rendered frame window) to request that its custom rollouts update their UI. Calling callbacks.notificationParam() returns an IVFB interface which allows rollouts to be added to the Virtual Frame Buffer (a.k.a. Rendered Frame Window).
#preImageViewerDisplay: IVFB Interface
Sent after the image viewer is created, but before it becomes visible. Calling callbacks.notificationParam() returns an IVFB interface which allows rollouts to be added to the Virtual Frame Buffer (a.k.a. Rendered Frame Window).
Available in 3ds Max 2009 and higher.
#postImageViewerDisplay: IVFB Interface
Sent after the image viewer becomes visible. Calling callbacks.notificationParam() returns an IVFB interface which allows rollouts to be added to the Virtual Frame Buffer (a.k.a. Rendered Frame Window).
Available in3ds Max 2009 and higher.
#preRender: Array
Sent before rendering is started. This notification is sent out before the renderer creates the render instance objects, which means that you can create nodes and other objects as a response to this event. When rendering multiple frames, this event is sent only once at the beginning of the rendering phase, and not on a per-frame basis. In the #preRender callback, you can't change any of the render parameters (height, width, aliasing, etc) and affect the current render sessions. Those parameters have already been set up internally in 3ds Max, and so changes to them won't occur until the next render session occurs.
Returns a 28 element array - see the SDK help file, class RendParams, for more information on the parameter definitions.
1 - Name - rpar -> rendType
2 - Boolean - rpar -> isNetRender
3 - Boolean - rpar -> fieldRender
4 - Integer - rpar -> fieldOrder
5 - Time - rpar -> frameDur
6 - Boolean - rpar -> colorCheck
7 - Integer - rpar -> vidCorrectMethod
8 - Integer - rpar -> ntscPAL
9 - Boolean - rpar -> superBlack
10 - Integer - rpar -> sbThresh
11 - Boolean - rpar -> rendHidden
12 - Boolean - rpar -> force2Side
13 - Boolean - rpar -> inMtlEdit
14 - Float - rpar -> mtlEditTile
15 - Boolean - rpar -> mtlEditAA
16 - Boolean - rpar -> multiThread
17 - Boolean - rpar -> useEnvironAlpha
18 - Boolean - rpar -> dontAntialiasBG
19 - Boolean - rpar -> useDisplacement
20 - Boolean - rpar -> useRadiosity
21 - Boolean - rpar -> computeRadiosity
22 - TextureMap - rpar -> envMap
23 - Time - rpar -> firstFrame
24 - Integer - rpar -> scanBandHeight
25 - Integer - rpar -> extraFlags
26 - Point2 - rpar -> width, rpar -> height
27 - Boolean - rpar -> filterBG
28 - Boolean - rpar -> alphaOutOnAdditive
#postRender: undefined
Sent after rendering has finished. This notification is sent out after the renderer destroys the render instance objects, which means that you can create nodes and other objects as a response to this event. When rendering multiple frames, this event is sent only once at the end of the rendering phase, and not on a per-frame basis.
#preRenderEval: time
Sent just before the renderer starts evaluating objects.
Returns the time being rendered
#preRenderFrame: Array
Sent just before each frame is rendered by the renderer. This notification is sent out after the renderer has taken a snapshot of the scene geometry. At the time of this call the scene cannot be modified. The renderer has already called GetRenderMesh() on all the object instances, and the materials and lights are already updated. If you don't modify anything that is rendered, then it is okay to use this callback. The current frame being rendered is set into the MAXScript currentTime context and system global, so any references to other scene object properties will automatically be resolved at the currently rendering frame's time. This notification is not sent out when the renderer is called to update the Material Editor sample spheres, only during output rendering.
#postRenderFrame: Array
Sent just after each frame is rendered by the renderer. The current frame being rendered is set into the MAXScript currentTime context and system global, so any references to other scene object properties will automatically be resolved at the currently rendering frame's time. This notification is not sent out when the renderer is called to update the Material Editor sample spheres, only during output rendering.
Returns a 22 element array - see the SDK help file, class RenderGlobalContext, for more information on the parameter definitions.
1 - Integer - rendParams -> projType
2 - Point2 - rendParams -> devWidth, rendParams -> devHeight
3 - Point2 - rendParams -> xscale, rendParams -> yscale
4 - Point2 - rendParams -> xc, rendParams- > yc
5 - Boolean - rendParams -> antialias
6 - Matrix3 - rendParams -> camToWorld
7 - Matrix3 - rendParams -> worldToCam
8 - Point2 - rendParams -> nearRange, rendParams -> farRange
9 - Float - rendParams -> devAspect
10 - Float - rendParams -> frameDur
11 - TextureMap - rendParams -> envMap
12 - Color - rendParams -> globalLightLevel
13 - Time - rendParams -> time
14 - Boolean - rendParams -> wireMode
15 - Float - rendParams -> wire_thick
16 - Boolean - rendParams -> force2Side
17 - Boolean - rendParams -> inMtlEdit
18 - Boolean - rendParams -> fieldRender
19 - Boolean - rendParams -> first_field
20 - Boolean - rendParams -> field_order
21 - Boolean - rendParams -> objMotBlur
22 - Integer - rendParams -> nBlurFrames
#beginRenderingReflectRefractMap: undefined
Sent before preparing Reflect and Refract Maps for rendering
#beginRenderingActualFrame: undefined
Sent after render setup and immediately before the actual render begins
#beginRenderingTonemappingImage: undefined
Sent before rendering Tonemapping image
WARNING: |
You cannot change an object's mesh in a #preRenderFrame , #postRenderFrame or any of the #beginRendering* callbacks, particularly if the mesh isn't animated. The renderer has already evaluated the original mesh and holds a pointer to that mesh. Changing the object's mesh will delete the old mesh, but the renderer doesn't know this, and when trying to render the now deleted mesh will crash. |
EXAMPLE: |
For an example of using the #preRender and #postRender callbacks, see |
#fileLinkPreAttach: undefined
Sent just before a file link attach.
#fileLinkPostAttach: undefined
Sent just after a file link attach.
#fileLinkPreBind: undefined
Sent just before a file link bind.
#fileLinkPostBind: undefined
Sent just after a file link bind.
#fileLinkPreDetatch: undefined
Sent just before a file link detach.
#fileLinkPostDetatch: undefined
Sent just after a file link detach.
#fileLinkPreReload: undefined
Sent just before a file link reload.
#fileLinkPostReload: undefined
Sent just after a file link reload.
#filelinkPostReloadPrePrune: undefined
Sent after all of the new objects for a reload have been created, but before any objects have been deleted.
#filePreOpen:(integer | undefined)
Sent before a new file is opened.
Calling callbacks.notificationParam() returns an integer value of 2 if a render preset file is being opened, undefined otherwise.
#filePostOpen: (integer |undefined)
Sent after a new file is opened successfully.
Calling callbacks.notificationParam() returns an integer value of 2 if a render preset file is being opened, undefined otherwise.
#filePreOpenProcess: #(integer, string)
Sent before the file open process starts.
Calling callbacks.notificationParam() returns an array with two elements:
Element 1 is
1 if doing a normal file load,
2 if doing an Edit>Fetch
Element 2 is the scene file name being loaded.
EXAMPLE: |
callbacks.removeScripts id:#testCallback callbacks.addScript #filePreOpenProcess "print (callbacks.notificationParam())" id:#testCallback |
PERFORM A FETCH - THE CALLBACK WILL PRINT: |
2 "C:\Documents and Settings\user\My Documents\3dsmax\autoback\maxhold.mx" |
#fileOpenFailed: integer
Sent after a file open fails.
Calling callbacks.notificationParam() returns an integer indicating the file type, where 0 is a 3ds Max file, and 1 is a material library.
#filePostOpenProcess: undefined
Sent after the file open process has finished.
#filePreSave: string
Sent before a file is saved.
Calling callbacks.notificationParam() returns a String containing the file name.
#filePostSave: string
Sent after a file is saved.
Calling callbacks.notificationParam() returns a String containing the file name.
#filePreSaveProcess: #(integer, string)
Sent before the save process has started.
Calling callbacks.notificationParam() returns a 2 element array:
Element 1 is
1 if doing a normal file save,
2 if doing an Edit>Hold
3 if doing an Autobackup
Element 2 is the scene file name being saved.
EXAMPLE: |
Evaluate the following code: |
callbacks.removeScripts id:#testCallback callbacks.addScript #filePreSaveProcess "print (callbacks.notificationParam())" id:#testCallback |
Save the file to "TestingCallback.max" - the callback will print: |
1 "C:\Documents and Settings\user\My Documents\3dsmax\scenes\testingcallback.max" |
Perform an Edit>Fetch at this point - the callback will print: |
2 "C:\Documents and Settings\user\My Documents\3dsmax\autoback\maxhold.mx" |
Wait fro the Autobackup to kick in - the callback will print: |
3 "C:\Documents and Settings\user\My Documents\3dsmax\autoback\AutoBackup01.max" |
#filePostSaveProcess: #(integer, string)
Sent after the save process has finished.
Calling callbacks.notificationParam() returns the same 2-element array as #filePreSaveProcess - please see above for details.
#filePreSaveOld: undefined
Sent before an old version file is saved.
#filePostSaveOld: undefined
Sent after an old version file is saved.
#filePreMerge: integer
Sent before a file is merged.
Calling callbacks.notificationParam() returns an integer value of 1 if object or scene Xref merged, undefined otherwise.
#filePostMerge: integer
Sent after a file is merged successfully.
Calling callbacks.notificationParam() returns an integer value of 1 if object or scene Xref merged, undefined otherwise.
#filePostMerge2: #(integer, integer)
Sent after a file is merged successfully, right after #filePostMerge.
Calling callbacks.notificationParam() returns an array with two elements, with the first element being the file save version, and the second element the file save as version.
For example, if loading a file saved from 3ds Max 2017, where a Save As Type was set to 3ds Max 2016, the values would be 19000 (MAX_RELEASE_R19) and 18000 (MAX_RELEASE_R189).
#filePostMergeProcess: undefined
Sent after the merge process has finished.
#preImport: undefined
Sent before a file is imported.
#postImport: filename
Sent after a file is imported successfully.
Calling callbacks.notificationParam() returns the name of the file being imported. Available in in 3ds Max 2017 and higher.
#importFailed: undefined
Sent if import fails.
#preExport: undefined
Sent before a file is exported.
#postExport: filename
Sent after a file is exported successfully.
Calling callbacks.notificationParam() returns the name of the file being exported. Available in in 3ds Max 2017 and higher.
#exportFailed: undefined
Sent if export fails.
#objectXrefPreMerge: undefined
Loading XRef (typically surrounding Merge notices)
#objectXrefPostMerge: undefined
Loading XRef (typically surrounding Merge notices)
#sceneXrefPreMerge: undefined
Loading XRef (typically surrounding Merge notices)
#sceneXrefPostMerge: undefined
Loading XRef (typically surrounding Merge notices)
#layerCreated: BaseLayer (reftarg)
Sent after layer created.
Calling callbacks.notificationParam() returns a layer ReferenceTarget.
#layerDeleted: BaseLayer (reftarg)
Sent before layer deleted, callbacks.notificationParam() returns the layer.
#layerParentChanged: #(BaseLayer, BaseLayer)
Sent after the parent of a layer was changed.
Calling callbacks.notificationParam() returns an array containing two elements, the new parent and the old parent.
#nodeLayerChanged: #(node, BaseLayer, BaseLayer)
Sent after node placed on new layer, callbacks.notificationParam() returns an array containing 3 elements - the node, the old layer and the new layer
#manipulateModeOn: undefined
Sent when entering manipulate mode.
#manipulateModeOff: undefined
Sent when exiting manipulate mode.
#modPanelObjPreChange: undefined
Sent just before the current edit object is about to change in Modify panel.
#modPanelObjPostChange: undefined
Sent just after the current edit object changes in Modify panel.
#modPanelSelChanged: undefined
Sent whenever the Modify panel opens on a new selection, either because the Modify panel was just selected or because a new selection is made in the scene. The notify occurs at a point just prior to panel redraw but after the selection has been established, so that callback functions can modify the panel state without it being overwritten.
#ModPanelSubObjectLevelChanged: #(newSOlevelIndex, oldSOlevelIndex)
Sent whenever the Modify panel changes the sub-object level. Calling callbacks.notificationParam() returns an array containing the new SO level number and the old SO level number. Available in 3ds Max 9 and higher.
#preModifierAdded: #(node, modifier)
Sent before a modifier is added to a node.
Calling callbacks.notificationParam() within the callback function will return a 2 element array containing the node and the modifier which was added.
#postModifierAdded: #(node, modifier)
Sent after a modifier is added to a node.
Calling callbacks.notificationParam() within the callback function will return a 2 element array containing the node and the modifier which was added.
#preModifierDeleted: #(node, modifier)
Sent before a modifier is deleted from a node.
Calling callbacks.notificationParam() within the callback function will return a 2 element array containing the node and the modifier which was deleted.
#postModifierDeleted: #(node, modifier)
Sent after a modifier is deleted from a node.
Calling callbacks.notificationParam() within the callback function will return a 2 element array containing the node and the modifier which was deleted.
#mtlLibPreOpen: undefined
Sent just before loading a material library.
#mtlLibPostOpen: materiallib
Sent just after loading a material library.
Calling callbacks.notificationParam() within the callback function will return the MaterialLibrary loaded.
#mtlLibPreSave: undefined
Sent just before saving a material library.
#mtlLibPostSave: undefined
Sent just after saving a material library.
#mtlLibPreMerge: undefined
Sent just before merging a material library.
#mtlLibPostMerge: undefined
Sent just after merging a material library.
#FailedDirectXMaterialTextureLoad: undefined
Sent when a bitmap fails to load in the DirectX Shader Material.
This is usually when DirectX does not support the file format. The developer can register for this notification so that they can convert the format into a DirectX texture resource.
#mtlRefAdded: material
Called when a material reference is added.
Calling callbacks.notificationParam() within the callback function returns the Material.
#mtlRefDeleted: material
Called when a material reference is deleted.
Calling callbacks.notificationParam() within the callback function returns the Material
#proxyTempDisableStart: undefined
#proxyTempDisableEnd: undefined
Sent before and after an operation that temporarily disables bitmap proxies.
Calling callbacks.notificationParam() within the callback function returns undefined
#nodeCreated: node
Sent when a node is created.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodeCloned: node
Sent after a node is cloned but before theHold.Accept(..).
Calling callbacks.notificationParam() within the callback function returns the node.
#sceneNodeAdded: node
Sent just after a node is added to the scene.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodeFreeze: node
Sent when a node is frozen.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodeUnfreeze: Node
Sent when a node is unfrozen.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodeHide: node
Sent when a node is hidden.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodeUnhide: Node
Sent when a node is unhidden.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodeLinked: Node
Sent when a new parent-child link is made. Calling callbacks.notificationParam() within the callback function returns the node.
#nodeUnlinked: Node
Sent when a parent-child link is broken.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodePreDelete: Node
Sent before a node is deleted.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodePostDelete: undefined
Sent after a node is deleted.
#nodePreMaterial: Node
Sent just before a node gets a new material.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodePostMaterial: Node
Sent just after a node gets a new material.
Calling callbacks.notificationParam() within the callback function returns the node.
#nodeRenamed: #(name, name)
Sent if a scene node is renamed.
Calling callbacks.notificationParam() within the callback function returns a 2 element array containing the old and new node name as strings
#nodeNameSet: #(name, name, node)
Sent when a scene node name is set or changed.
Calling callbacks.notificationParam() within the callback function returns a 3 element array containing the old name, the new name, and the node.
#preNodeBonePropChanged: Array of nodes
Pre bone property change.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
This notification was broken in versions prior to 3ds Max 2014.
The fixed version will be called for individual bones, so the return value will still be an array, but containing only one node per call.
The notification will be broadcast for all bone anim property changes except for InvalidateObjectTM() which also alters a flag in the bone's property, but that flag would be changed also when a child bone is altered. This could happen by simply moving nodes in the viewport, so this case is excluded to avoid an avalanche of notifications.
#postNodeBonePropChanged: Array of nodes
Post bone property change.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
This notification was broken in versions prior to 3ds Max 2014.
The fixed version will be called for individual bones, so the return value will still be an array, but containing only one node per call.
The notification will be broadcast for all bone anim property changes except for InvalidateObjectTM() which also alters a flag in the bone's property, but that flag would be changed also when a child bone is altered. This could happen by simply moving nodes in the viewport, so this case is excluded to avoid an avalanche of notifications.
#preNodeGeneralPropChanged: Array of nodes
Pre general property change.
Calling callbacks.notificationParam() within the callback function returns the array of nodes
#postNodeGeneralPropChanged: Array of nodes
Post general property change.
Calling callbacks.notificationParam() within the callback function returns the array of nodes whose properties have been changed.
#preNodeGiPropChanged: Array of nodes
Sent before Advanced Lighting property changes.
Calling callbacks.notificationParam() within the callback function returns the array of nodes whose properties will be changed.
#postNodeGiPropChanged: Array of nodes
Sent after Advanced Lighting property changes.
Calling callbacks.notificationParam() within the callback function returns the array of nodes whose properties have been changed.
#preNodesCloned: Array of nodes
Sent before node clone.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
#postNodesCloned: #(array of nodes, array of nodes, name)
Sent after nodes are cloned.
Calling callbacks.notificationParam() within the callback function will return a 3 element array where the first element is an array of the original nodes, the second element is an array of the cloned nodes, and the third element is a name value of #copy , #instance , or #reference , reflecting the clone type.
#preNodeUserPropChanged: Array of nodes
Pre user property change.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
#postNodeUserPropChanged: Array of nodes
Post user property change.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
#preMirrorNodes: Array of nodes
Beginning of the mirror operation.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
#postMirrorNodes: Array of nodes
End of the mirror operation.
Calling callbacks.notificationParam() within the callback function returns the array of nodes.
#selectedNodesPreDelete: Array of nodes
Sent just before selected nodes are deleted.
Calling callbacks.notificationParam() within the callback function returns the Array of nodes about to be deleted.
#selectedNodesPostDelete: undefined
Sent just after selected nodes are deleted.
#selectionSetChanged: undefined
Sent after the selection set has changed.
#postNodeSelectOperation: undefined
Sent after the system Node Selection Processor has finished selecting nodes.
#ClassDescAdded: MAXClass
Provides a notification that a new ClassDesc is being registered.
This occurs when DLLs containing plugins are loaded, and when a ClassDesc is dynamically created and registered with 3ds Max (for example, when a scripted plug-in is defined). When loading a DLL containing plugins, for each plugin you will get a #classDescLoaded notification followed by a #ClassDescAdded notification. When a ClassDesc is dynamically created and registered with 3ds Max, you will get just a #ClassDescAdded notification.
Calling callbacks.notificationParam() within the callback function returns a MAXClass wrapper of the ClassDesc being registered.
#classDescLoaded: MAXClass
Sent after a ClassDesc was successfully loaded from a plug-in dll.
Calling callbacks.notificationParam() within the callback function returns a MAXClass wrapper of the ClassDesc being loaded.
#interactivePluginCreationStarted: MAXClass
Sent when the user starts creating a plug-in instance.
Examples of when this notification is sent include interactive creation of objects via the Create and Modify panels or the main menu. This notification is not sent when plug-in instances are created programmatically (via the SDK, MAXScript, python etc).
Calling callbacks.notificationParam() within the callback function will return a MAXClass wrapping the plug-in.
#interactivePluginCreationEnded: MAXClass
Sent when the user ends creating a plug-in instance.
This notification is not sent when plug-in instances are created programmatically (via the SDK, MAXScript, python etc).
Calling callbacks.notificationParam() within the callback function will return a MAXClass wrapping the plug-in.
#ObjectDefinitionChangeBegin: MAXClass
Sent immediately before object instances are updated to a new object definition.
MAXScript allows scripted plugin and scripted custom attribute definitions to be updated by re-evaluating the definition script. The new definition can add or remove local variables, parameter blocks, parameter block items, rollouts, and rollout controls. After the new definition is evaluated, existing plugin instances are converted to this new definition. This notification is sent immediately before the instances are converted to the new definition.
A plugin may use this notification to, for example, control the rebuilding of rollout displays for instances of the plugins using the definition.
Calling callbacks.notificationParam() within the callback function will return a MAXClass wrapping the scripted plug-in.
#ObjectDefinitionChangeEnd: MAXClass
Sent after object instances are updated to a new object definition. See #ObjectDefinitionChangeBegin.
Calling callbacks.notificationParam() within the callback function will return a MAXClass wrapping the scripted plug-in.
#pluginLoaded: string
Sent whenever a plug-in is loaded.
Calling callbacks.notificationParam() within the callback function will return the String containing the name of the dll loaded
#appActivated: undefined
Called when the main application window is activated.
#appDeactivated: undefined
Called when the main application window is deactivated.
#postSystemStartup: undefined
Sent when the software goes live.
#selectionLocked: undefined
Sent when selection lock is triggered.
#selectionUnlocked: undefined
Sent when selection unlock is triggered.
#systemPreNew: integer
Sent just before 3ds Max is reset.
Calling callbacks.notificationParam() within the callback function will return an integer value corresponding to the option selected in the New Scene dialog:
1 - New All
2 - Keep Objects
3 - Keep Objects and Hierarchy
#systemPostNew: undefined
Sent just after 3ds Max is reset.
#systemPreReset: undefined
Sent before 3ds Max is reset.
#systemPostReset: undefined
Sent after 3ds Max is reset.
#systemPreDirChange: undefined
System path has changed - Catalogs dir modified from the Configure Path dialog.
#systemPostDirChange: undefined
System path has changed - Catalogs dir modified from the Configure Path dialog.
#preSystemShutdown: undefined
Sent just before the software enters the shutdown process.
#postSystemShutdown: undefined
Sent just before the software finishes the shutdown process.
Some operations involving the MAXScript Listener and the 3ds Max UI will not be available when this callback is run because they have been shut down already. Non-UI related operations like writing to a file would be performed correctly though.
#welcomeScreenDone: undefined
Sent once initial welcome screen is done (either it did not show or it has been closed).
#preAppThemeChange: undefined
Sent before the application theme is changed.
#postAppThemeChange: undefined
Sent after the application theme is changed.
#postLoadingMenus: undefined
Called after a menu file has been loaded and the menu bar updated.
Clients registered for this notification could add their own menu or menu item to the currently loaded set of menus.
#preLoadingCuiToolbars: string
Sent before the main application menu bar is saved.
Calling callbacks.notificationParam() returns the loading path, or empty if loading the default toolbars.
#postLoadingCuiToolbars: string
Sent after the main application menu bar is saved.
Calling callbacks.notificationParam() returns the loading path, or empty if loading the default toolbars.
#preSavingCuiToolbars: string
Sent before a toolbar configuration is saved.
Calling callbacks.notificationParam() returns the saving path, or empty if saving the default toolbars.
#postSavingCuiToolbars: string
Sent after a toolbar configuration is saved.
Calling callbacks.notificationParam() returns the saving path, or empty if saving the default toolbars.
#preSavingMenus: string
Sent before the main application menu bar is saved.
Calling callbacks.notificationParam() returns the saving path.
#postSavingMenus: string
Sent after the main application menu bar is saved.
Calling callbacks.notificationParam() returns the saving path.
#postSceneReset: undefined
Sent just after deleting all refs in existing scene.
This notification is sent after wiping the existing scene. Examples of when this occurs is immediately before loading in the new scene from a file, and when doing a file new
#preSceneStateRestore: string
Sent before a Scene State is restored.
Calling callbacks.notificationParam() returns the Scene State name.
#postSceneStateRestore: string
Sent after a Scene State is restored.
Calling callbacks.notificationParam() returns the Scene State name.
#preSceneStateSave: string
Sent before a scene state is saved.
Calling callbacks.notificationParam() returns the Scene State name.
#postSceneStateSave: string
Sent after a scene state is saved.
Calling callbacks.notificationParam() returns the Scene State name.
#preWorkspaceChange: undefined
Sent before a CUI workspace is about to change.
Calling callbacks.notificationParam() returns the workspace name.
#postWorkspaceChange: string
Sent after a CUI workspace has changed.
Calling callbacks.notificationParam() returns the workspace name.
#preWorkspaceCollectionChange: undefined
Sent before the collection of system workspaces is about to change.
#postWorkspaceCollectionChange: undefined
Sent after the collection of system workspaces has changed.
#preStartupScriptLoad: undefined
NEW in 3ds Max 2019.2 Update: Sent immediately before the startup scripts are executed.
#radiosityPluginChanged: undefined
Sent when the Radiosity plugin has changed.
#radiosityProcessDone: undefined
Sent when the Radiosity process has finished.
#radiosityProcessReset: undefined
Sent when the Radiosity process has been reset.
#radiosityProcessStart: undefined
Sent when the Radiosity process has started.
#radiosityProcessStopped: undefined
Sent when the Radiosity process has been stopped.
#sceneUndo: string
Sent after a scene undo is performed. callbacks.notificationParam() returns the name of the undo entry in 3ds Max 8 and higher.
#sceneRedo: string
Sent after a scene redo is performed. callbacks.notificationParam() returns the name of the undo entry 3ds Max 8 and higher.
EXAMPLE: |
callbacks.removeScripts id:#test callbacks.addScript #sceneRedo "format \"Redo: %\\n\" (callbacks.notificationParam())" id:#test callbacks.addScript #sceneUndo "format \"Undo: %\\n\" (callbacks.notificationParam())" id:#test |
#preSceneRedo: string
Sent before a scene redo is performed. callbacks.notificationParam() returns the redo string.
#preSceneUndo: string
Sent after a scene undo is performed. callbacks.notificationParam() returns the undo string.
#postRestoreObjsDeleted: unefined
Sent when the undo system is flushed, and at least one RestoreObj was present in the undo system.
#svSelectionSetChanged: integer
Sent when the Schematic View selection set has changed. callbacks.notificationParam() returns the Schematic View index.
#svDoubleClickGraphNode: undefined
Sent when the user double-clicked a Schematic View node.
#svPreLayoutChange: integer
Sent before Schematic View applies its layout algorithm.
Calling callbacks.notificationParam() within the callback function returns the Schematic View index.
#svPostLayoutChange: integer
Sent after Schematic View applies its layout algorithm.
Calling callbacks.notificationParam() within the callback function returns the Schematic View index.
#NamedSelSetCreated: string
Sent after a named selection set is created.
Calling callbacks.notificationParam() will return the new selection set name.
Available in 3ds Max 9 and higher.
#NamedSelSetDeleted: string
Sent after a named selection set is deleted.
Calling callbacks.notificationParam() will return the name of the deleted named selections set.
Available in 3ds Max 9 and higher.
#NamedSelSetRenamed: string
Sent after a named selection set is renamed.
Calling callbacks.notificationParam() will return an array containing the old name and new name of the renamed selection set.
Available in 3ds Max 9 and higher.
#NamedSelSetPreModify: string
Sent when the node set of a named selection set begins to be changed. For example, when nodes are added or removed from a named selection set,or the node set of a named selection set is completely replaced.
Calling callbacks.notificationParam() will return the name of the modified selection set.
#NamedSelSetPostModify: string
Sent when the node set of a named selection set has been changed.
Calling callbacks.notificationParam() will return the name of the modified selection set.
#D3DPreDeviceReset: undefined
Sent before the DirectX device is being reset.
Available in 3ds Max 9 and higher.
#D3DPostDeviceReset: undefined
Sent after the DirectX device has been reset.
Available in 3ds Max 9 and higher.
#activeViewportChanged: undefined
Sent when the current active viewport is changed.
#atsPostRepathPhase: undefined
Sent after the asset tracking system traversal completes.
#atsPreRepathPhase: undefined
Sent before the asset tracking system traversal starts.
#bitmapChanged: string
Sent after a bitmap is reloaded.
Calling callbacks.notificationParam() within the callback function returns the String containing bitmap texture bitmap file name.
#byCategoryDisplayFilterChanged: undefined
Sent AFTER object categories marked to be hidden\unhidden.
#colorChanged: undefined
Sent when the system is updating it’s custom colors.
#cuiMenusUpdate: undefined
Sent when the main application menu bar is updated.
#customDisplayFilterChanged: undefined
Sent AFTER custom display filters have been activated\deactivated.
#lightingUnitDisplaySystemChange: undefined
Sent when lighting unit display system is changed.
#mouseSettingsChanged: undefined
Sent after mouse setting file has changed, for example, after loading/saving a new mouse setting file.
#preViewPanelDelete: integer
Sent before a viewport is deleted. It usually occurs when removing a view tab.
Calling callbacks.notificationParam() within in the callback function returns the HWND of the viewport.
#preViewportTooltip: node
Sent before a viewport tooltip pops up.
Calling callbacks.notificationParam() within in the callback function returns the node triggering the tooltip.
#sceneExplorerNeedsUpdate: undefined
Sent if the scene explorer needs to refresh its display.
#sceneStateDelete: string
Sent when a scene state is deleted.
Calling callbacks.notificationParam() within in the callback function returns the scene state name.
#sceneStateRename: #(string, string)
Sent when a scene state is renamed.
Calling callbacks.notificationParam() within in the callback function returns an array of two elements containing the old name and the new name.
#spacemodeChange: undefined
Sent if the user changes the reference coordinate system.
#timeunitsChange: undefined
Sent if the user changes the time format setting.
#unitsChange: undefined
Sent if the user changes the unit setting.
#viewportChange: undefined
Sent every time the viewport parameters change, including panning, zooming and orbiting the viewport or changing the active viewport.
Currently, there is no notification for viewport layout change.
#viewportSafeFrameToggle: integer
Sent when the viewport Safe Frame is turned on or off.
Calling callbacks.notificationParam() within in the callback function returns an Integer value - 1 for on, 0 for off.
Available in 3ds Max 2014 and higher.
#mainWindowEnabled: boolean
Sent when the main application window gets enabled.
Calling callbacks.notificationParam() within the callback function returns a Boolean value - true if the main 3ds Max window is being enabled, false if another window is being enabled.
#heightMenuChanged: undefined
Sent when a user operated the height menu.
#playbackStart: undefined
Sent when the animation playback starts.
#playbackEnd: undefined
Sent when the animation playback ends.
#preProgress: undefined
Sent before the progress bar is displayed.
#postProgress: undefined
Sent after the progress bar is finished.