MSG PLUGINS¶
This page provides information on the messages sent to plugins data Message().
MSG_UPDATE
Sent if the bounding box has to be recalculated. (Otherwise use MSG_CHANGE.)
MSG_SMALLUPDATE
Sent if the object has changed and it does not need cache rebuilding.
MSG_CHANGE
Sent if any data (except for the matrix) has been changed.
MSG_COMMANDINFORMATION
Sent to retrieve command information.
Note
Allows to restict shortcuts to a dialog. To do so, managergroup has to be set to a dialog ID. parentid can be set to a command ID to get its shortcut, icon, tooltip etc.For instance, if IDM_SELECTALL is set for parentid, then command_id inherits Cinema “Select All” standard command.Input: {command_id: int, managergroup: int, parentid: int}
Output: {managergroup: int, parentid: int}
command_id: Command ID.
managergroup: Manager group.
parentid: Parent ID.
MSG_GETALLASSETS
Sent to retrieve all assets from an object.
Input: {doc:
c4d.documents.BaseDocument
, flags: int, assets: list}Output: {assets: list of {filename: str, bl:
c4d.BaseList2D
, netRequestOnDemand: bool}}
assets: List of assets:
filename: Filename of the asset.
bl: Base list reporting the missing name.
netRequestOnDemand: Net request on demand.
MSG_SEGMENTS_CHANGED
Sent to notify an object its segments have changed.
Input: {old_cnt: int, new_cnt: int, vc_flags: int, map: list of int}
old_cnt: Number of elements before the change.
new_cnt: Number of elements after the change.
vc_flags: Flags. See VC_FLAGS.
map: Optional translation map.
MSG_POLYGONS_CHANGED
Sent to notify an object its polygons have changed.
Input: {old_cnt: int, new_cnt: int, vc_flags: int, map: list of int}
old_cnt: Number of elements before the change.
new_cnt: Number of elements after the change.
vc_flags: Flags. See VC_FLAGS.
map: Optional translation map.
MSG_POINTS_CHANGED
Sent to notify an object its points have changed.
Input: {old_cnt: int, new_cnt: int, vc_flags: int, map: list of int}
old_cnt: Number of elements before the change.
new_cnt: Number of elements after the change.
vc_flags: Flags. See VC_FLAGS.
map: Optional translation map.
MSG_GETCUSTOMICON
Sent to retrieve a custom icon.
Input: {}
Output: {filled: bool, bmp:
c4d.bitmaps.BaseBitmap
, x: int, y: int, w: int, h: int, flags: int}
filled: True if the icon was set.
bmp: Icon’s bitmap. Can be None.
x: X coordinate of the upper-left corner of the icon.
y: Y coordinate of the upper-left corner of the icon.
w: Width of the icon.
h: Height of the icon.
flags: Flags. See ICONDATAFLAGS.
Changed in version R21: In R21 two additional fields, are present so instead of filling previously bmp, x,y, w,h, flags in a plugin implementation it’s possible to directly feed a
c4d.IconData
instance.useDat: bool, sets to True if you want to use Dat instead of the other values.
dat:
c4d.IconData
, the IconData to represents.
MSG_GETCUSTOMICON_SETTINGS
New in version R21.
Sent to retrieve the custom icon settings of an object.
Input: {setting:
c4d.CustomIconSettings
}
setting: The custom icon settings to modify.
MSG_EDIT
Allows to perform some action when element is edited, e.g. if the user edits an object double-clicking it in the Object Manager.
MSG_FILTER
Sent to allow or block
C4DAtom.MultiMessage()
calls.Input: {type: int, route: int, data: PyCObject}
type: Message type.
route: Flags. See MULTIMSG_ROUTE.
data: Message data. Depends on the message type.
MSG_DESCRIPTION_CHECKUPDATE
Allows elements to determine the type of refresh after a parameter change. This is automatically handled for keys, tags, objects etc.
Note
This message is completely handled by all base data classes.
Input: {doc:
c4d.documents.BaseDocument
, drawflags: int, descidc4d.DescID
}
doc: Current document.
drawflags: Draw flags.
descid: Description ID.
MSG_DESCRIPTION_INITUNDO
Allows elements to create undo actions for the following parameter changes.
Input: {doc:
c4d.documents.BaseDocument
, descid:c4d.DescID
}
doc: Current document.
descid: Description ID.
MSG_DESCRIPTION_CHECKDRAGANDDROP
Asks an atom if a drag and drop operation is accepted.
Input: {id:
c4d.DescID
, element:c4d.BaseList2D
}Output: {result: bool}
id: ID of the drop field.
element: Element to drop.
result: Set to True if the drop is acceptable, otherwise False.
MSG_DESCRIPTION_VALIDATE
Sent to update dependencies or to check for invalid values after a parameter change.
For example the light’s inner radius always must be smaller than the light’s outer radius. The light object uses this message to perform such check.
Input: {flags: int}
flags: Not used.
MSG_DESCRIPTION_COMMAND
Sent by button description elements. See example here.
Input: {id:
c4d.DescID
}
id: Description ID of the parameter that triggered the command.
MSG_DESCRIPTION_REMOVE_ENTRY
Sent to tell an atom to remove a description entry.
Input: {id:
c4d.DescID
}
id: Description ID of the parameter that triggered the command.
MSG_DESCRIPTION_EDIT_ENTRY
Sent to tell an atom to edit a description entry.
Input: {id:
c4d.DescID
}
id: Description ID of the parameter that triggered the command.
MSG_DESCRIPTION_POPUP
Sent to handle description popup menus in the Attribute Manager.
Input: {id:
c4d.DescID
, chosen: int, popup:c4d.BaseContainer
}Output: {id:
c4d.DescID
, chosen: int, popup:c4d.BaseContainer
}
id: Description ID of the parameter that triggered the command.
chosen: Selected element of the popup.
popup: Popup menu container.
MSG_DESCRIPTION_POSTSETPARAMETER
Sent after a
C4DAtom.SetParameter()
call.Input: {descid:
c4d.DescID
}
descid: The description ID of the parameter that was set.
MSG_DESCRIPTION_GETBITMAP
Queries a
c4d.gui.BitmapButtonCustomGui
bitmap.Input: {id:
c4d.DescID
}Output: {bmp:
c4d.bitmaps.BaseBitmap
, bmpflags: int}
id: Description ID of the bitmap button.
bmp: Bitmap for the button.
bmpflags: Flags. See ICONDATAFLAGS.
MSG_DESCRIPTION_ALLOWOVERRIDE
Sent to check if take override operation is allowed.
Input: {_takeData:
c4d.modules.takesystem.TakeData
, _overrideTake:c4d.modules.takesystem.BaseTake
, _descid:c4d.DescID
}Output: {_parent:
c4d.BaseList2D
, _parentId:c4d.DescID
, _allow: bool, _overrideEnabled: bool}
_takeData: Take system context.
_overrideTake: The take asking for the override.
_descid: Description ID to be overridden.
_parent: Parent node if the override must be assigned to it and not to the original node. Especially useful in case of branched structures.
_parentId: If parent is set also a translated parameter ID needs to be set.
_allow: True if the parameter can be overridden, otherwise False.
_overrideEnabled: True if the global switch allow the override, otherwise False.
MSG_DRAGANDDROP
Received by an element in the Object Manager when something is dropped on it.
Input: {doc:
c4d.documents.BaseDocument
, sender:c4d.BaseList2D
, flags: int, type: int, data: PyCObject, x: int, y: int, msg:c4d.BaseContainer
,}Output: {flags: int, type: int, data: PyCObject, result: int}
doc: Current document.
sender: Sender of the drag operation.
flags: Flags.
type: The drag type.
data: Dragged data.
x: X position where the drag was released.
y: Y position where the drag was released.
msg: Valid if DRAGANDDROP_FLAG_MSGVALID is set so items like BFM_INPUT_QUALIFIER are available.
result: Unused.
MSG_DOCUMENTINFO
Sent as broadcast message by the document when it is loaded, saved, merged etc.
Input: {type: int, fileformat: int, filename: str, doc:
c4d.documents.BaseDocument
, bl:c4d.BaseList2D
}
type: The message type. See MSG_DOCUMENTINFO_TYPE.
fileformat: The file format. See FORMAT Export.
filename: The document filename.
doc: The current document.
bl: The object/tag/material that got inserted. It is set if type is of one of the following values:
MSG_DOCUMENTINFO_TYPE_OBJECT_INSERT
MSG_DOCUMENTINFO_TYPE_TAG_INSERT
MSG_DOCUMENTINFO_TYPE_MATERIAL_INSERT
MSG_MULTI_RENDERNOTIFICATION
Sent to a document and all of its elements before a render starts.
Input: {doc:
c4d.documents.BaseDocument
, external: bool, start: bool, animated: bool}Output: {external: bool, start: bool, animated: bool}
doc: Current document.
external: True if the rendering is not in the editor view, otherwise False.
start: Determines if it is a start (True) or stop (False) notification. Stop notifications are only sent if the document will not be deleted, which only should happen if it is an editor render.
animated: Determines if it is an animation sequence being rendered.
MSG_MULTI_DOCUMENTCLONED
Sent when document is cloned.
MSG_MULTI_CLEARSUGGESTEDFOLDER
Objects have to remove absolute paths (only if MSG_GETALLASSETS is supported).When “Save Project with Assets” is invoked, everything is moved to the new target directory.In this case all absolute paths must be converted to just filenames because the files are next to the document and the absolute paths are not needed anymore.Note
Both MSG_GETALLASSETS and MSG_MULTI_CLEARSUGGESTEDFOLDER are important for “Save Project” to work and to collect all items.
MSG_BASECONTAINER
Message that carries a container.
Input:
c4d.BaseContainer
MSG_SCALEDOCUMENT
Sent to tell that another document with different scale has been merged.
Input: {scale: float}
Output: {}
scale: Merged document’s scale.
MSG_GETREALCAMERADATA
Sent to get a real camera object from a generator.
Input: {}
Output: {res:
c4d.BaseObject
}
res: Real camera.
MSG_DESCRIPTION_CUSTOMGUI_NOTIFICATION
Sent by a custom GUI to its parent node.
Input: {_descId:
c4d.DescID
, _customGuiId: int, _subId: int, _data:c4d.BaseContainer
}
_descId: Description ID.
_customGuiId: Custom GUI plugin ID.
_subId: Message type sub-ID. Depending on the custom GUI implementation a different sub-ID can be passed with different data.
_data: Data for the message.
MSG_COLLECTC4DFALLOFF
Sent to atoms that might contain a falloff.
Output: {falloff:
c4d.modules.mograph.C4D_Falloff
}
falloff: Falloff to be set if any.
MSG_DOCUMENT_MODE_CHANGED
Sent to the active tool plugin when document mode is changed.
See also
MSG_ANIMATE
Sent to objects after they have been animated.