Message System Manual¶
Send and receive messages to react to system events, actions on scene elements and events in user interfaces.
Table of Contents
Overview¶
Messages are a core principal of the classic API of Cinema 4D and fulfill an event-like purpose. Various interfaces in the classic API have methods attached to them which are linked to the message system. A message is always denoted by an identifier, e.g., MSG_DESCRIPTION_EDIT_ENTRY, which does signify the message event to the object it is being send to. Messages can also be accompanied by ingoing or outgoing message data which does qualify that event. This message data can consist out of multiple elements and is usually wrapped as a dictionary in the Python API.
The message data that is related to a message can be treated in an in- or outgoing fashion or both. The message MSG_DESCRIPTION_EDIT_ENTRY will be broadcasted with a dictionary containing the DescID
for the element which did raise that message. Attempting to modify this DescID
or returning modified message data will have no effect on the DescID
of the raising element, the data is only ingoing. Other message events will however explicitly being sent with the intent that the recipient does modify or complement the data. MSG_GETCUSTOMICON for example is being sent so that a NodeData.Message()
instance can return a specific icon for the associated node with the returned message data.
Technical Overview¶
There are three major categories of messages in Cinema 4D: Core messages, messages to scene elements, and messages to dialogs and custom interface elements. Message to C4DAtom
instances, e.g., objects, tags, or other scene elements, are being sent with C4DAtom.Message()
. When the message identifier sent to an atom is being supported by the atom type and the message data is well formed, then the message will invoke a certain action in the atom as documented by the message symbols below. Sending MSG_UPDATE to a PointObject
will for example force a point object to update all its internal data that does rely on the vertices of the point object. The handling of messages sent to C4DAtom
instances plays a fundamental role when implementing plugin interfaces, e.g., c4d.ObjectData
, c4d.TagData
or c4d.ShaderData
. Listening for MSG_DESCRIPTION_COMMAND in the Message
method of an ObjectData
interface will allow for example to react on button clicks in the description interface of the corresponding BaseObject
instances of that type.
Core messages are a message category that is related to global system wide events; as opposed to the messages sent to C4DAtom
instances which only affect a single atom. Core messages can be invoked among other functions with c4d.SendCoreMessage()
and c4d.GeSyncMessage()
and received with MessageData
, GeDialog
and GeUserArea
instances by overwriting their CoreMessage
methods. Core messages convey broad events as for example enforcing redraw event or reacting on the modification of the active document.
A third category of messages is received by GeDialog
and GeUserArea
instances in their Message
methods. The messages received here differ from those broadcasted to the Message
methods of C4DAtom
instances. These messages only rarely have to be sent by users and instead are primarily intended to react to events in the respective user interface, e.g., a mouse or key press event. These messages also do play an important role in the execution of the event loop of such GUI elements, e.g., sending BFM_DRAW to a GeUserArea
instance will cause its GeUserArea.DrawMsg()
being called.
Message Contexts¶
C4DAtom Messages¶
The following messages can be broadcasted to C4DAtom
instances with the method C4DAtom.Message()
.
Symbol |
Numeric Value |
Description |
---|---|---|
300001037 |
Sent to objects after they have been animated. |
|
9 |
Sent to pass arbitrary data in a container to a node. |
|
7 |
Sent if any data except for the matrix has been changed. |
|
440000221 |
Sent to atoms that might contain a falloff. |
|
300001001 |
Sent to retrieve command information. |
|
431000094 |
Sent to check if take override operation is allowed. |
|
26 |
Sent to ask an atom if a drag and drop operation is accepted. |
|
17 |
Sent to allow elements to determine the type of refresh after a parameter has been changed. |
|
18 |
Sent for button description elements. |
|
431000175 |
Sent by a custom GUI to its parent node. |
|
25 |
Sent to tell an atom to edit a description entry. |
|
27 |
Sent to query a description for a |
|
300001046 |
Sent to handle description popup menus in the Attribute Manager. |
|
19 |
Sent after a |
|
24 |
Sent to tell an atom to remove a description entry. |
|
20 |
Sent to update dependencies or to check for invalid values after a parameter change. |
|
200000091 |
Sent to the active tool plugin when document mode is changed. |
|
1001078 |
Sent when a document has been loaded, saved, merged or other document related actions occurred. |
|
1018756 |
Sent to elements in the Object Manager when something is dropped on it. |
|
21 |
Sent to perform an action when element is being edited. |
|
14 |
Sent to allow or block |
|
1021339 |
Sent to retrieve the data of MoGraph selection tags. |
|
440000230 |
Sent to retrieve the data for MoGraph weights tags. |
|
112004 |
Sent to retrieve all assets from an object. |
|
1001090 |
Sent to retrieve a custom icon. |
|
1041699 |
Sent to retrieve the custom icon settings of an object. |
|
1028476 |
Sent to get a real camera object from a generator. |
|
1036447 |
Sent to get the real tag object from a virtual ‘generator’ tag. |
|
22 |
Sent to allow tags, objects, shaders etc. to do some setup work when called from the menu. |
|
200000040 |
Sent to nodes to convert absolute paths to filename. |
|
11 |
Sent when a document is being cloned. |
|
1001071 |
Sent to a document and all of its elements before a render starts. |
|
1 |
Sent to notify an object its points have changed. |
|
2 |
Sent to notify an object its polygons have changed. |
|
23 |
Sent to retrieve private data from an atom. |
|
300001069 |
Sent to signal that another document with different scale has been merged with the current document. |
|
10 |
Sent to notify an object that its segments have changed. |
|
6 |
Sent if part of an object has changed and does not need cache rebuilding. |
|
5 |
Sent to inform an object that its bounding box must be recalculated. Otherwise use MSG_CHANGE. |
Core Messages¶
The following messages can be broadcasted with c4d.SendCoreMessage()
.
Symbol |
Numeric Value |
Description |
---|---|---|
200000023 |
Executes the command with ID specified by |
|
300001037 |
Pass whether to open the option dialog or not for |
|
300001036 |
Pass the sub-ID for |
|
1001077 |
Forces an Attribute Manager update. |
|
300000115 |
Checks if the command with ID specified by |
|
200000035 |
Checks if the command with ID specified by |
|
200000234 |
Gets the help string of a command. Pass the command’s ID. |
|
200000033 |
Returns the name of the command with ID specified by |
|
1733248844 |
Retrieves machine features. Returned container IDs see MACHINEINFO and Viewport. |
|
200000100 |
Private |
Event Messages¶
The following messages can be broadcasted with c4d.GeSyncMessage()
and received in the CoreMessage
methods in
MessageData
, GeDialog
and GeUserArea
interfaces.
Symbol |
Numeric Value |
Description |
---|---|---|
1633908343 |
Private |
|
1701080438 |
The user moved something in the editor window. |
|
200000009 |
The autokey mode was changed. |
|
-1002 |
Something in the browser has been changed (local event). |
|
604 |
Sent by |
|
1685218156 |
Sent while drawing after the animation, expressions and cache building have been done. |
|
-1010 |
Something in the F-Curve manager has been changed (local event). |
|
400008000 |
Something in XPresso has been changed (local event). |
|
-1008 |
Private |
|
-1009 |
A material selection has been changed (local event). |
|
-1003 |
Private |
|
1055256 |
Private |
|
-200000076 |
Show in Function Curve editor. |
|
-200000077 |
Show in Layer Manager. |
|
-200000078 |
Show in Motion editor. |
|
-200000074 |
Show in Scene Browser. |
|
-200000075 |
Show in Timeline. |
|
431000159 |
Sent by the Take System when the current Take ID changed to let all managers react to the new status. |
|
1952671847 |
Private |
|
-1001 |
A timeline selection has been changed (local event). |
|
-200000079 |
Show and frame fcurve position tracks. |
|
-200000080 |
Show and frame fcurve rotation tracks. |
|
-200000081 |
Show and frame fcurve scale tracks. |
|
-465001000 |
Private |
|
-826267 |
A tool setting has changed (local event). |
|
200000099 |
Sent in the case that the view should be redrawn. |
|
200000073 |
A special message sent by Cinema 4D in the case that only the highlighting changes. |
|
200000010 |
Scheme has been updated. |
|
-1012 |
Private |
|
-1011 |
Private |
GUI Messages¶
The following messages can be send to and received by the Message
methods of GeDialog
and GeUserArea
instances.
Symbol |
Numeric Value |
Description |
---|---|---|
300001037 |
Sent to objects after they have been animated. |
|
1648444244 |
One of the child elements made action. |
|
1634038627 |
Internal |
|
1835362660 |
ID of the dialog element that triggered the action. |
|
1835361394 |
Slider in dragging mode (not finished). |
|
1801812324 |
Key Down pressed while editfield is active. |
|
1801812341 |
Key Up pressed while editfield is active. |
|
1634887027 |
Reset to default value on right-click of input field arrows. |
|
1835365236 |
String in text field changed. |
|
1970300020 |
Internal |
|
1986226279 |
Edit/slider changed. |
|
1835365985 |
GeData Action value. |
|
2002871156 |
Private |
|
1633907830 |
Private |
|
1648444231 |
Private |
|
1715553354 |
Private |
|
4 |
Private |
|
1 |
Private |
|
2 |
Private |
|
3 |
Private |
|
1937006946 |
Internal |
|
1634954083 |
Ask if a dialog is able to close. Return false it is OK to close, otherwise true. |
|
1648574803 |
Called if the element has to calculate its own minimum X and Y dimensions. |
|
1667787619 |
Check if a dialog is able to close. Return false it is OK to close, otherwise true. |
|
1667460204 |
Check if a dialog is able to close when layouts are switched. Return false it is OK to close, otherwise true. |
|
1 |
Private |
|
1649567085 |
Private |
|
1648576067 |
Private |
|
1668050803 |
Internal |
|
1668246595 |
Color chooser settings: |
|
1668246608 |
Color chooser parent message. |
|
2 |
RGB range: COLORSYSTEM_RANGE |
|
5 |
Sends a parent message BFM_COLORCHOOSER_PARENTMESSAGE if the settings change. |
|
1668113256 |
Private |
|
1298360649 |
Core message ID. |
|
1298360653 |
Core message. |
|
1298360625 |
Parameter 1. |
|
1298360626 |
Parameter 2. |
|
1935894884 |
Special manager ID for sync message. |
|
1299540324 |
Time stamp. |
|
1970300001 |
Private |
|
1970300003 |
Internal |
|
1667854957 |
Sent when mouse cursor has left a user area. |
|
1734636404 |
Internal |
|
1685288057 |
Sent just before the window is destroyed. |
|
1648650611 |
Internal |
|
2 |
Internal |
|
9 |
Internal |
|
10 |
Drag escaped. |
|
5 |
Drag finished. |
|
7 |
Drag lost. |
|
3 |
Screen X. |
|
4 |
Screen Y. |
|
8 |
Drag type: DRAGTYPE |
|
10005 |
Internal |
|
10004 |
Internal |
|
10003 |
Drag receive. |
|
10001 |
Internal |
|
1648644673 |
Redraw message for user areas. |
|
4 |
Bottom clipping. |
|
5 |
Internal |
|
1 |
Left clipping. |
|
6 |
Internal |
|
7 |
BaseContainer Message which started the redraw. |
|
3 |
Right clipping. |
|
2 |
Top clipping. |
|
1970500196 |
Private |
|
1 |
Internal |
|
1718383982 |
Flushes the undo stack for a multi-line edit text. |
|
1734702178 |
Returns the block start position in an edit field. |
|
1734702179 |
Return the cursor position in an edit field. |
|
1970172788 |
Internal |
|
1920169077 |
Restore the undo container for a multi-line edit text. |
|
1936028771 |
Set the cursor position in an edit field. |
|
1937011317 |
Stores the undo container for a multi-line edit text. |
|
1 |
The undo stack size. |
|
2 |
The current undo level. |
|
1648717409 |
Internal |
|
1717658725 |
Sent to blend GUI color with ease in a GeUserArea. |
|
1178682437 |
Private |
|
1718971440 |
Internal |
|
1718971441 |
Internal |
|
1734759011 |
Returns the coordinates of the input field with the current focus. |
|
3 |
Input field height. |
|
2 |
Input field width. |
|
0 |
Input field X coordinate. |
|
1 |
Input field Y coordinate. |
|
1952539508 |
Private |
|
1667853926 |
Respond this message to display help information in the bubble help or global statusbar. |
|
1818327367 |
Private |
|
1648838229 |
A custom GUI receives this message before the layout is updated. This is used to avoid losing the focus over a specific gadget after the layout is updated. |
|
1648979558 |
Private |
|
1735420260 |
Private |
|
1733706060 |
Private |
|
1987077236 |
Private |
|
10014 |
Private |
|
10013 |
Private |
|
10011 |
Private |
|
10012 |
Private |
|
1648838211 |
Item got the focus. |
|
1735418728 |
Private |
|
1648968771 |
Private |
|
1648971337 |
Sent after an element has been created. |
|
1649822030 |
Sent after the layout is done. |
|
1648971854 |
A dialog/user area receives this message if mouse or keyboard input is received. See Input Events for more information. |
|
1648968019 |
Input message ID sent after scroll area processed input messages. |
|
1801548643 |
String Contains the Unicode input from keyboard. |
|
1768973153 |
Contains the key or mouse button. See also KEY. |
|
1768973430 |
Device: |
|
1768973410 |
Double click. |
|
1768320615 |
Finger wheel (tangential pen pressure). |
|
1768452963 |
Amount of horizontal scrolling (touch pad, mouse ball) |
|
1801812322 |
Keyboard. |
|
102 |
Zoom guesture on touch pad or touch screen (or mouse scroll with ctrl to indicate zoom). Value in BFM_INPUT_VALUE_REAL. |
|
1768975727 |
Private |
|
1836021107 |
Mouse. |
|
1 |
Left mouse button. |
|
3 |
Middle mouse button. |
|
101 |
Mouse move. |
|
2 |
Right mouse button. |
|
100 |
Mouse wheel or panning on touch pad or touch screen. Values in BFM_INPUT_HSCROLL, BFM_INPUT_VSCROLL. |
|
5 |
Fourth mouse button. |
|
6 |
Five mouse button. |
|
1768780643 |
True for scroll events on a multitouch device (which also supports magnify), false for scroll-only mice. |
|
1769107316 |
Pen rotation. |
|
1886547828 |
Pen rotation around its own axis. |
|
1768976737 |
A bit mask with the qualifiers at the time when the event occurred: QUALIFIER |
|
1769237620 |
Pen tilt. |
|
1769237875 |
Time stamp of the event or 0.0 (unavailable). |
|
1768978017 |
Value of the input channel (true/false or a value, e.g. for scroll wheel data). |
|
1768977985 |
Channel value (e.g. pen pressure). |
|
1769370467 |
Amount of vertical scrolling (touch pad, mouse wheel/ball) |
|
1769436003 |
True for scroll events on a classic wheel mouse. False for everything else (touchpad, magic mouse). |
|
1768978040 |
X value. |
|
1768978041 |
Y value. |
|
1768978042 |
Z value. |
|
1768846437 |
Sent when user interaction ends. |
|
1768846433 |
Sent when user interaction starts. |
|
1767990132 |
Private |
|
1716273497 |
Internal |
|
1818327399 |
Sent when saving the layout. Return a container to store with the layout for this dialog. |
|
1818327411 |
Receive the container saved with BFM_LAYOUT_GETDATA when loading a layout. |
|
1649165891 |
Item lost the focus. |
|
2 |
Internal |
|
1649231427 |
Private |
|
1835755116 |
Private |
|
1649230147 |
Private |
|
4 |
Internal |
|
2 |
Internal |
|
1 |
Internal |
|
10000 |
Private |
|
8 |
Internal |
|
1718185572 |
Private |
|
1649232195 |
Private |
|
1648774744 |
Private |
|
1648775250 |
Private |
|
1869640809 |
Private |
|
1886545262 |
Internal |
|
1886351470 |
Notification of popup before the menu opens. |
|
1685546340 |
Private |
|
1818520942 |
Private |
|
1649558861 |
Internal |
|
2003985774 |
Internal |
|
1919250802 |
Set to true in the passed container for |
|
10010 |
Internal |
|
1666139718 |
Internal |
|
1935897443 |
Private |
|
1935897203 |
Scroll group scrolled. |
|
1 |
Internal |
|
2 |
Internal |
|
1651078253 |
Private |
|
1649623363 |
Private |
|
1649623363 |
Private |
|
1936028771 |
Same as BFM_EDITFIELD_SETCURSORPOS. |
|
1649624646 |
Internal |
|
1649624643 |
Internal |
|
1649624661 |
A custom GUI description receives this message after the layout is updated to reactivate previously focused gadget. |
|
1649626182 |
Private |
|
1836345716 |
Private |
|
1397969747 |
Private |
|
1397969732 |
Private |
|
1937006964 |
Sets a statusbar. |
|
1987081068 |
Private |
|
1666142791 |
Internal |
|
1 |
Internal |
|
2 |
Internal |
|
1666402650 |
Private |
|
1935766117 |
Internal |
|
1933996653 |
Internal |
|
1 |
Internal |
|
1648972617 |
Element has been sized. |
|
1735684980 |
Private |
|
1936879213 |
Set the multi-line edit field to the right language mode. |
|
1936879207 |
Private |
|
5 |
Help second text. |
|
11 |
Internal |
|
9 |
Internal |
|
12 |
Internal |
|
8 |
Internal |
|
10 |
Internal |
|
3 |
Between 0.0 and 1.0. |
|
6 |
Internal |
|
1 |
Statusbar active. |
|
4 |
Spinning bar. |
|
7 |
Color ID for the status bar, or as RGB value (Vector). |
|
2 |
Help first text. |
|
1937012583 |
Private |
|
1937337955 |
Sync message. |
|
1952805748 |
Private |
|
10020 |
Timer message. Use |
|
1649690947 |
Private |
|
1970303591 |
Private |
|
1649819972 |
Private |
|
1649819971 |
Private |
|
1649824578 |
Private |
|
1986622278 |
Internal |
|
1986622292 |
Internal |
|
1987079284 |
Private |
|
1987079544 |
Private |
|
1987078500 |
Private |
|
2000906343 |
Group weights changed. |
Plugin Messages¶
The following messages can be received in the Message
methods of CommandData
, FalloffData
, NodeData
, SculptBrushToolData
, and ToolData
interfaces and their derived interfaces.
Symbol |
Numeric Value |
Description |
---|---|---|
300001037 |
Sent to objects after they have been animated. |
|
9 |
Sent to pass arbitrary data in a container to a node. |
|
7 |
Sent if any data except for the matrix has been changed. |
|
440000221 |
Sent to atoms that might contain a falloff. |
|
300001001 |
Sent to retrieve command information. |
|
431000094 |
Sent to check if take override operation is allowed. |
|
26 |
Sent to ask an atom if a drag and drop operation is accepted. |
|
17 |
Sent to allow elements to determine the type of refresh after a parameter has been changed. |
|
18 |
Sent for button description elements. |
|
431000175 |
Sent by a custom GUI to its parent node. |
|
25 |
Sent to tell an atom to edit a description entry. |
|
27 |
Sent to query a description for a |
|
16 |
Sent to allows elements to create undo actions for the following parameter changes. |
|
300001046 |
Sent to handle description popup menus in the Attribute Manager. |
|
19 |
Sent after a |
|
24 |
Sent to tell an atom to remove a description entry. |
|
20 |
Sent to update dependencies or to check for invalid values after a parameter change. |
|
200000091 |
Sent to the active tool plugin when document mode is changed. |
|
1001078 |
Sent when a document has been loaded, saved, merged or other document related actions occurred. |
|
1018756 |
Sent to elements in the Object Manager when something is dropped on it. |
|
21 |
Sent to perform an action when element is being edited. |
|
14 |
Sent to allow or block |
|
112004 |
Sent to retrieve all assets from an object. |
|
1001090 |
Sent to retrieve a custom icon. |
|
1041699 |
Sent to retrieve the custom icon settings of an object. |
|
1028476 |
Sent to get a real camera object from a generator. |
|
22 |
Sent to allow tags, objects, shaders etc. to do some setup work when called from the menu. |
|
200000040 |
Sent to nodes to convert absolute paths to filename. |
|
11 |
Sent when a document is being cloned. |
|
1001071 |
Sent to a document and all of its elements before a render starts. |
|
1 |
Sent to notify an object its points have changed. |
|
2 |
Sent to notify an object its polygons have changed. |
|
300001069 |
Sent to signal that another document with different scale has been merged with the current document. |
|
10 |
Sent to notify an object that its segments have changed. |
|
6 |
Sent if part of an object has changed and does not need cache rebuilding. |
|
5 |
Sent to inform an object that its bounding box must be recalculated. Otherwise use MSG_CHANGE. |