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.

    • 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.

    • 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.

    • 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.

    • doc: Current document.

    • drawflags: Draw flags.

    • descid: Description ID.

  • MSG_DESCRIPTION_INITUNDO

    Allows elements to create undo actions for the following parameter changes.

    • doc: Current document.

    • descid: Description ID.

  • MSG_DESCRIPTION_CHECKDRAGANDDROP

    Asks an atom if a drag and drop operation is accepted.

    • 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.

    • id: Description ID of the parameter that triggered the command.

  • MSG_DESCRIPTION_REMOVE_ENTRY

    Sent to tell an atom to remove a description entry.

    • id: Description ID of the parameter that triggered the command.

  • MSG_DESCRIPTION_EDIT_ENTRY

    Sent to tell an atom to edit a description entry.

    • id: Description ID of the parameter that triggered the command.

  • MSG_DESCRIPTION_POPUP

    Sent to handle description popup menus in the Attribute Manager.

    • 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.

    • descid: The description ID of the parameter that was set.

  • MSG_DESCRIPTION_ALLOWOVERRIDE

    Sent to check if take override operation is allowed.

    • _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.

    • 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.

    • 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_MENUPREPARE

    Sent to allow tags, objects, shaders etc. to do some setup work when called from the menu.

  • 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.

    • res: Real camera.

  • MSG_DESCRIPTION_CUSTOMGUI_NOTIFICATION

    Sent by a custom GUI to its parent node.

    • _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_DOCUMENT_MODE_CHANGED

    Sent to the active tool plugin when document mode is changed.

  • MSG_ANIMATE

    Sent to objects after they have been animated.