3ds Max C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
notify.h File Reference
#include "assert1.h"
#include "maxheap.h"
#include "coreexp.h"
#include "strbasic.h"
#include "maxtypes.h"
#include "notifyParams.h"

Classes

struct  notify_param_helper< code >
 Helper class to assign a param type to a notification code. See GetNotifyParam. More...
 

Macros

#define DEFINE_NOTIFY_CODE(notifyCodeName, codeVal, callParamType)
 Macro to define a notification code and associated type, and register it for GetNotifyParam.
 
#define NOTIFY_UNITS_CHANGE   0x00000001
 Sent if the user changes the unit setting.
 
#define NOTIFY_TIMEUNITS_CHANGE   0x00000002
 Sent if the user changes the time format setting.
 
#define NOTIFY_VIEWPORT_CHANGE   0x00000003
 Sent if the user changes the viewport layout.
 
#define NOTIFY_SPACEMODE_CHANGE   0x00000004
 Sent if the user changes the reference coordinate system.
 
#define NOTIFY_SYSTEM_PRE_RESET   0x00000005
 Sent before 3ds Max system is reset.
 
#define NOTIFY_SYSTEM_POST_RESET   0x00000006
 Sent after 3ds Max system is reset.
 
#define NOTIFY_FILE_POST_SAVE_OLD   0x00000011
 Sent after an old version file is saved.
 
#define NOTIFY_SELECTIONSET_CHANGED   0x00000012
 Sent after the selection set has changed.
 
#define NOTIFY_POST_RENDER   0x00000015
 Sent before rendering starts.
 
#define NOTIFY_PRE_IMPORT   0x00000018
 Sent before a file is imported.
 
#define NOTIFY_PRE_EXPORT   0x0000001B
 Sent if a file import fails or is cancelled.
 
#define NOTIFY_PRE_PROGRESS   0x0000001F
 These kinds of notifications are sent when the name of a target has been changed.
 
#define NOTIFY_POST_PROGRESS   0x00000020
 Sent after the progress bar is finished.
 
#define NOTIFY_MODPANEL_SEL_CHANGED   0x00000021
 Sent when the modify panel focuses on a new object because of opening the Modify panel or changing selection.
 
#define NOTIFY_RENDPARAM_CHANGED   0x00000023
 Sent when the common renderer parameters have changed via the render dialog.
 
#define NOTIFY_FILELINK_BIND_FAILED   0x0000002A
 Sent if a File Link Bind fails.
 
#define NOTIFY_FILELINK_DETACH_FAILED   0x0000002B
 Sent if a File Link Detach fails.
 
#define NOTIFY_FILELINK_RELOAD_FAILED   0x0000002C
 Sent if a File Link Reload fails.
 
#define NOTIFY_FILELINK_ATTACH_FAILED   0x0000002D
 Sent if a File Link Attach fails.
 
#define NOTIFY_FILELINK_PRE_BIND   0x00000030
 Sent before a File Link Bind.
 
#define NOTIFY_FILELINK_POST_BIND   0x00000031
 Sent after a successful File Link Bind.
 
#define NOTIFY_FILELINK_PRE_DETACH   0x00000032
 Sent before a File Link Detach.
 
#define NOTIFY_FILELINK_POST_DETACH   0x00000033
 Sent after a successful File Link Detach.
 
#define NOTIFY_FILELINK_PRE_RELOAD   0x00000034
 Sent before a File Link Reload (partial, full, or dynamic)
 
#define NOTIFY_FILELINK_POST_RELOAD   0x00000035
 Sent after a successful File Link Reload (partial, full, or dynamic)
 
#define NOTIFY_FILELINK_PRE_ATTACH   0x00000036
 Sent before a File Link Attach.
 
#define NOTIFY_FILELINK_POST_ATTACH   0x00000037
 Sent after a successful File Link.
 
#define NOTIFY_SCENE_POST_DELETED_NODE   0x00000045
 Sent before the renderer starts evaluating objects; NotifyInfo::callParam is a pointer to TimeValue.
 
#define NOTIFY_SEL_NODES_POST_DELETE   0x00000047
 selected nodes will be deleted. (NotifyInfo::callParam is a pointer to Tab<INode*>)
 
#define NOTIFY_SYSTEM_SHUTDOWN   0x00000049
 Sent when main window gets an WM_ENABLE (BOOL enabled)
 
#define NOTIFY_SYSTEM_STARTUP   0x00000050
 3ds Max just went live
 
#define NOTIFY_SYSTEM_SHUTDOWN2   0x00000052
 A plug-in was just loaded. (NotifyInfo::callParam is a pointer to DllDesc).
 
#define NOTIFY_ANIMATE_ON   0x00000053
 Sent when Animate UI mode is activated.
 
#define NOTIFY_ANIMATE_OFF   0x00000054
 Sent when Animate UI mode is de-activated.
 
#define NOTIFY_COLOR_CHANGE   0x00000055
 Sent by the system when one or more custom colors have changed.
 
#define NOTIFY_PRE_EDIT_OBJ_CHANGE   0x00000056
 Sent just before the current edit object is about to change.
 
#define NOTIFY_POST_EDIT_OBJ_CHANGE   0x00000057
 Sent just after the current edit object changes.
 
#define NOTIFY_LIGHTING_UNIT_DISPLAY_SYSTEM_CHANGE   0x0000005C
 Sent when radiosity processing is started.
 
#define NOTIFY_RADIOSITY_PLUGIN_CHANGED   0x00000060
 Sent when starting to render a reflect/refract map.
 
#define NOTIFY_MANIPULATE_MODE_OFF   0x00000063
 Sent on scene undo (NotifyInfo::callParam is a pointer to a string (MCHAR*) with the undo entry name).
 
#define NOTIFY_MANIPULATE_MODE_ON   0x00000064
 Sent when manipulate mode starts.
 
#define NOTIFY_PRE_NOTIFYDEPENDENTS   0x0000006C
 Sent before a mirror operation begins.
 
#define NOTIFY_POST_NOTIFYDEPENDENTS   0x0000006D
 Sent after NotifyDependents from outside the recursion.
 
#define NOTIFY_TIMERANGE_CHANGE   0x00000070
 Sent by Mtl::RefAdded(). NotifyInfo::callParam is a Mtl pointer.
 
#define NOTIFY_FILELINK_POST_RELOAD_PRE_PRUNE   0x00000085
 Sent before a modifier is added to an object.
 
#define NOTIFY_BY_CATEGORY_DISPLAY_FILTER_CHANGED   0x00000092
 Sent before each set of clones is created.
 
#define NOTIFY_CUSTOM_DISPLAY_FILTER_CHANGED   0x00000093
 Sent AFTER custom display filters have been activated/deactivated.
 
#define NOTIFY_MXS_STARTUP   0x0000009B
 Sent after a layer is added to layer manager.
 
#define NOTIFY_MXS_POST_STARTUP   0x0000009C
 Sent by MAXScript when it has completed its initialization.
 
#define NOTIFY_MXS_SHUTDOWN   0x000000A7
 Sent when MAXScript has been shut down.
 
#define NOTIFY_D3D_PRE_DEVICE_RESET   0x000000A8
 This is sent by the D3D GFX (Dx9) when a device reset is going to happen.
 
#define NOTIFY_D3D_POST_DEVICE_RESET   0x000000A9
 This is sent by the D3D GFX (Dx9) when a device reset has happened.
 
#define NOTIFY_TOOLPALETTE_MTL_SUSPEND   0x000000AA
 Used to suspend material change tracking in VIZ.
 
#define NOTIFY_TOOLPALETTE_MTL_RESUME   0x000000AB
 Used to resume material change tracking in VIZ.
 
#define NOTIFY_RENDER_PREEVAL_FRAMEINFO   0x000000BC
 NotifyInfo::callParam is a pointer to a string (const MCHAR*) of the name of the created named set.
 
#define NOTIFY_POST_SCENE_RESET   0x000000BD
 Sent just after deleting all refs in existing scene.
 
#define NOTIFY_SELECTION_LOCK   0x000000D0
 < Sent before an INode's general property is changed.
 
#define NOTIFY_SELECTION_UNLOCK   0x000000D1
 Sent when selection unlock is triggered. *‍/.
 
#define NOTIFY_OS_THEME_CHANGED   0x000000D7
 Sent after a custom attribute is added to an Animatable.
 
#define NOTIFY_ACTIVE_VIEWPORT_CHANGED   0x000000D8
 Sent when the current active viewport is changed.

 
#define NOTIFY_PRE_MAXMAINWINDOW_SHOW   0x000000DB
 NOTIFY_PRE_MAXMAINWINDOW_SHOW is being sent when main window of 3ds Max is about to show.
 
#define NOTIFY_POST_MAXMAINWINDOW_SHOW   0x000000DC
 NOTIFY_POST_MAXMAINWINDOW_SHOW is being sent immediately after the main window of 3ds Max is shown.
 
#define NOTIFY_PRE_APP_FRAME_THEME_CHANGED   0x000000E2
 Provides a notification that a new ClassDesc is being registered.
 
#define NOTIFY_APP_FRAME_THEME_CHANGED   0x000000E3
 Sent when the application theme is changed via IColorManager::SetAppFrameColorTheme().
 
#define NOTIFY_PRE_WORKSPACE_COLLECTION_CHANGE   0x000000E7
 Sent before a viewport is deleted. It usually occurs when removing a view tab.
 
#define NOTIFY_POST_WORKSPACE_COLLECTION_CHANGE   0x000000E8
 Sent after the collection of system workspaces has changed.
 
#define NOTIFY_KEYBOARD_SETTING_CHANGED   0x000000E9
 Sent after keyboard short-cut setting file(*.kbd) has changed.
 
#define NOTIFY_MOUSE_SETTING_CHANGED   0x000000EA
 Sent after mouse setting file has changed.
 
#define NOTIFY_APP_ACTIVATED   0x000000ED
 This provides a notification that a toolbar configuration is being saved, prior to save.
 
#define NOTIFY_APP_DEACTIVATED   0x000000EE
 Called when the main application window is deactivated.
 
#define NOTIFY_CUI_MENUS_UPDATED   0x000000EF
 
#define NOTIFY_CUI_MENUS_PRE_SAVE   0x000000F0
 
#define NOTIFY_CUI_MENUS_POST_SAVE   0x000000F1
 
#define NOTIFY_PLUGINS_PRE_SHUTDOWN   0x000000F3
 Called after the safe frame has been toggled on/off for the viewport.
 
#define NOTIFY_PLUGINS_PRE_UNLOAD   0x000000F4
 Sent during shutdown immediately before DllDesc::Unload is called on all plugin dlls.
 
#define NOTIFY_POST_NODE_SELECT_OPERATION   0x000000FC
 Called after a menu file has been loaded and the menu bar updated.
 
#define NOTIFY_WELCOMESCREEN_DONE   0x000000FE
 Sent before viewport tooltip pops. NotifyInfo::callParam is a INode* to the tip node.
 
#define NOTIFY_PLAYBACK_START   0x000000FF
 
#define NOTIFY_PLAYBACK_END   0x00000100
 
#define NOTIFY_SCENE_EXPLORER_NEEDS_UPDATE   0x00000101
 Sent if the scene explorer needs to refresh its display.
 
#define NOTIFY_FILE_POST_OPEN_PROCESS_FINALIZED   0x00000102
 Sent at the very end of the load sequence, note that any animatables created by the scene load may have been deleted by this point.
 
#define NOTIFY_FILE_POST_MERGE_PROCESS_FINALIZED   0x00000103
 Sent at the very end of the merge sequence, note that any animatables created by the scene merge may have been deleted by this point.
 
#define NOTIFY_PRE_PROJECT_FOLDER_CHANGE   0x00000104
 Sent before project folder is changed.
 
#define NOTIFY_POST_PROJECT_FOLDER_CHANGE   0x00000105
 Sent after project folder is changed.
 
#define NOTIFY_PRE_MXS_STARTUP_SCRIPT_LOAD   0x00000106
 Sent immediately before MAXScript loads its startup scripts. stdscripts will have already been read.
 
#define NOTIFY_SYSTEM_SHUTDOWN_CHECK   0x00000108
 Sent when potentially starting to shut 3ds Max down, before checking for things that can cancel the shutdown, such as scene dirty or ExitMAXCallback callback object returning false.
 
#define NOTIFY_SYSTEM_SHUTDOWN_CHECK_FAILED   0x00000109
 Sent if system shutdown was cancelled.
 
#define NOTIFY_SYSTEM_SHUTDOWN_CHECK_PASSED   0x0000010A
 Sent if system shutdown was not cancelled. and system shutdown is about to start.
 
#define NOTIFY_COLOR_MANAGEMENT_PRE_CHANGE   0x0000010F
 Sent after a file is merged.
 
#define NOTIFY_CUI_MENUS_INVALID   0x00000113
 Sent after the system color management settings are changed, this includes mode changes, system-wide gamma setting or changes to color config.
 
#define NOTIFY_CUI_MENUS_VALID   0x00000114
 : Sent after menu structure is modified (for example after loading a mnxb file) The intent is to use this notification to perform any additional ui updates after new menus are loaded NotifyInfo::callParam is nullptr
 
#define NOTIFY_CUI_QUAD_MENUS_INVALID   0x00000115
 : Sent before quad menu structure is modified (for example before loading a qmnxb file) The intent is to use this notification to clear any storage related to menu structure to avoid keeping dangling pointers NotifyInfo::callParam is nullptr
 
#define NOTIFY_CUI_QUAD_MENUS_VALID   0x00000116
 : Sent after quad menu structure is modified (for example after loading a qmnxb file) The intent is to use this notification to perform any additional ui updates after new menus are loaded NotifyInfo::callParam is nullptr
 
#define NOTIFY_INTERNAL_USE_START   0x70000000
 : Sent before menu structure is loaded NotifyInfo::callParam is a string (MCHAR*) containing the path of the file that will be loaded
 
Material Library File Notifications
#define NOTIFY_MATLIB_PRE_OPEN   0x00000024
 Sent before loading a material library.
 
#define NOTIFY_MATLIB_PRE_SAVE   0x00000026
 Sent after loading a material library.
 
#define NOTIFY_MATLIB_POST_SAVE   0x00000027
 Sent after saving a material library.
 
#define NOTIFY_MATLIB_PRE_MERGE   0x00000028
 Sent before merging a material library.
 
#define NOTIFY_MATLIB_POST_MERGE   0x00000029
 Sent after merging a material library.
 
XRef System Notifications

These notices typically surround Merge notices

#define NOTIFY_SCENE_XREF_PRE_MERGE   0x00000065
 Sent before an XRef scene is merged.
 
#define NOTIFY_OBJECT_XREF_PRE_MERGE   0x00000067
 Sent after an XRef scene is successfully merged (NotifyInfo::callParam is a INode* pointer to the scene XRef tree).
 
#define NOTIFY_OBJECT_XREF_POST_MERGE   0x00000068
 Sent after an XRef object is successfully merged.
 
Undo/Redo Notifications

Sent before a Scene State is saved.

Sent after a Scene State is saved.

Sent before a Scene State is restored.

Sent after a Scene State is restored.

Sent after a Scene State is deleted.

Sent after a Scene State is renamed. NotifyInfo::callParam is pointer to NameChange

#define NOTIFY_SCENE_POST_UNDO   NOTIFY_SCENE_UNDO
 Sent before an Undo starts.
 
#define NOTIFY_SCENE_POST_REDO   NOTIFY_SCENE_REDO
 Sent to make the previous undo notification more explicit, and match the PRE_UNDO.
 
Asset Tracking System Notifications

Sent after a ClassDesc was successfully loaded from a plugin dll.

Remarks
For each non NULL class descriptor returned by a plugin's ClassDesc* LibClassDesc(int i) method, the system broadcasts this notification. The call parameter will be a pointer to the ClassDesc.
See also
~{ Required DLL Functions }~

This provides a notification that a toolbar configuration is being loaded, prior to load. NotifyInfo::callParam is a pointer to a string (MCHAR*) and is NULL if the default file is being loaded, or the full path to the file being loaded

This provides a notification that a toolbar configuration is being loaded, after the load. NotifyInfo::callParam is a pointer to a string (MCHAR*) and is NULL if the default file is being loaded, or the full path to the file being loaded

These notification bracket ATS traversal of the entire scene (or ReferenceTarget hierarchy, in the case of a general retarget action) and repath any assets that should be repathed.
No parameters are sent with these notifications.

#define NOTIFY_ATS_PRE_REPATH_PHASE   0x000000B3
 Sent before the ATS traversal starts.
 
#define NOTIFY_ATS_POST_REPATH_PHASE   0x000000B4
 Sent after the ATS traversal completes.
 
Bitmap Proxy System Notifications

Any specific operation during which proxies should be disable can be surrounded by these notifications.

This method of disabling proxies is different from actually disabling the bitmap proxies through the proxy manager; these notifications do not actually result in re-loading of any bitmaps. Rather, the Bitmap Texture will only load the high-res image when it is asked to, which makes the process efficient.

Note
One should ideally NOT broadcast these notifications. Instead, use class BitmapProxyTemporaryDisableGuard; it is safer as it handles multiple nested disables.
#define NOTIFY_PROXY_TEMPORARY_DISABLE_START   0x000000B5
 
#define NOTIFY_PROXY_TEMPORARY_DISABLE_END   0x000000B6
 
New Scene Options

Flag values in callParam for NOTIFY_SYSTEM_PRE_NEW and NOTIFY_SYSTEM_POST_NEW indicating the type of new scene operation that was carried out.

#define PRE_NEW_NEW_ALL   0x1
 All objects are deleted, including their animation data.
 

Typedefs

template<NotifyCode code>
using notify_param_t = typename notify_param_helper< code >::type
 Helper type alias to assign a param type to a notification code.
 
using NOTIFYPROC = void(*)(void *param, NotifyInfo *info)
 

Functions

template<NotifyCode code, NotifyCode... more_codes>
notify_param_t< code > GetNotifyParam (NotifyInfo *info)
 !
 
 DEFINE_NOTIFY_CODE (NOTIFY_FILE_PRE_OPEN, 0x00000009, FileIOType *)
 Sent before a new scene is requested.
 
 DEFINE_NOTIFY_CODE (NOTIFY_FILE_POST_OPEN, 0x0000000A, NotifyPostOpenParam *)
 Sent after a file is opened successfully.
 
 DEFINE_NOTIFY_CODE (NOTIFY_FILE_PRE_MERGE, 0x0000000B, DWORD *)
 Sent before a file is merged.
 
 DEFINE_NOTIFY_CODE (NOTIFY_FILE_PRE_SAVE, 0x0000000D, const MCHAR *)
 Sent before a file is saved (NotifyInfo::callParam is a pointer to a string (MCHAR *) of the file name).
 
 DEFINE_NOTIFY_CODE (NOTIFY_FILE_POST_SAVE, 0x0000000E, const MCHAR *)
 Sent after a file is saved (NotifyInfo::callParam is a pointer to a string (MCHAR *) of the file name).
 
 DEFINE_NOTIFY_CODE (NOTIFY_FILE_OPEN_FAILED, 0x0000000F, FileIOType *)
 Sent after a file open fails. NotifyInfo::callParam is a pointer to type FileIOType.
 
 DEFINE_NOTIFY_CODE (NOTIFY_FILE_PRE_SAVE_OLD, 0x00000010, DWORD *)
 Sent before an old version file is saved.
 
 DEFINE_NOTIFY_CODE (NOTIFY_BITMAP_CHANGED, 0x00000013, const MCHAR *)
 Sent after a bitmap is reloaded.
 
 DEFINE_NOTIFY_CODE (NOTIFY_PRE_RENDERFRAME, 0x00000016, RenderGlobalContext *)
 Sent before rendering each frame.
 
 DEFINE_NOTIFY_CODE (NOTIFY_POST_RENDERFRAME, 0x00000017, RenderGlobalContext *)
 Sent after rendering each.
 
 DEFINE_NOTIFY_CODE (NOTIFY_POST_IMPORT, 0x00000019, const MCHAR *)
 Sent after a file is imported successfully.
 
 DEFINE_NOTIFY_CODE (NOTIFY_POST_EXPORT, 0x0000001C, const MCHAR *)
 Sent after a file is exported successfully.
 
CoreExport int RegisterNotification (NOTIFYPROC proc, void *param, int code)
 
CoreExport int UnRegisterNotification (NOTIFYPROC proc, void *param, int code)
 
CoreExport int UnRegisterNotification (NOTIFYPROC proc, void *param)
 
CoreExport void BroadcastNotification (int code)
 It is not recommended to use this function directly.
 
CoreExport void BroadcastNotification (int code, void *callParam)
 It is not recommended to use this function directly.
 
template<NotifyCode code>
void BroadcastNotification ()
 
template<NotifyCode code>
void BroadcastNotification (notify_param_t< code > callParam)
 

Typedef Documentation

◆ NOTIFYPROC

using NOTIFYPROC = void (*)(void* param, NotifyInfo* info)

Function Documentation

◆ RegisterNotification()

CoreExport int RegisterNotification ( NOTIFYPROC  proc,
void param,
int  code 
)
Remarks
This global function is called to establish the connection between the event and the callback.
Parameters
procThe callback function called when the event occurs
paramA pointer to a parameter which will be passed to the callback function
codeSpecifies which notification to register. See System Notification Codes.
Returns
Value Nonzero if the event was registered; otherwise zero.

◆ UnRegisterNotification() [1/2]

CoreExport int UnRegisterNotification ( NOTIFYPROC  proc,
void param,
int  code 
)
Remarks
This global function is called to break the connection between the event and the callback. After this function executes the callback is no longer invoked when the event occurs.
Parameters
procThe callback function called when the event occurs.
paramThis parameter must be identical to the param sent into RegisterNotification(). This function will only unregister a callback if this parameter equals the param sent in to the RegisterNotification() function.
codeSpecifies which notification to unregister. See System Notification Codes
Returns
Nonzero if the event was unregistered; otherwise zero.

◆ UnRegisterNotification() [2/2]

CoreExport int UnRegisterNotification ( NOTIFYPROC  proc,
void param 
)
Remarks
This global function unregisters the callback from all codes
Parameters
procThe callback function called when the event occurs.
paramA pointer to a parameter which will be passed to the callback function.
Returns
Nonzero if the events were unregistered; otherwise zero.

◆ BroadcastNotification() [1/4]

CoreExport void BroadcastNotification ( int  code)

It is not recommended to use this function directly.

Consider using the templated version of this function for improved type safety

◆ BroadcastNotification() [2/4]

CoreExport void BroadcastNotification ( int  code,
void callParam 
)

It is not recommended to use this function directly.

Consider using the templated version of this function for improved type safety

◆ BroadcastNotification() [3/4]

void BroadcastNotification ( )
inline
Remarks
Calling this global function causes the callback corresponding to the specified code to be called.
Parameters
codeSpecifies which notification to broadcast. See System Notification Codes
1221{
1222 // Fail if something other than void* is expected and param is missing in function call
1223 static_assert(std::is_same_v<notify_param_t<code>, void*>, "Missing param for notification code");
1225}
void BroadcastNotification()
Definition: notify.h:1220

◆ BroadcastNotification() [4/4]

void BroadcastNotification ( notify_param_t< code >  callParam)
inline
Remarks
This causes the callback corresponding to the specified code to be called and passes the specified parameter along to the callback. code Specifies which notification to broadcast. See System Notification Codes
Parameters
callParamThis parameter is passed to the callback.
1233{
1234 if constexpr (std::is_pointer_v<decltype(callParam)>)
1235 {
1236 BroadcastNotification(code, (void*)callParam);
1237 }
1238 else
1239 {
1240 BroadcastNotification(code, (void*)static_cast<intptr_t>(callParam));
1241 }
1242}