Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Core Message or use MSG_BASECONTAINER

    General Discussion
    0
    3
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 14/12/2017 at 04:10, xxxxxxxx wrote:

      Hello a question come at me in this thread
      So what is the best way for send message over our plugin.
      By that I mean should I use a CoreMessage with SpecialEventAdd or it's better to send a Message with  MSG_BASECONTAINER as primary ID and our data with for example bc[0] = Our Type of message then fill the rest of the bc with our datas.

      In more general when should we implement Core Message instead of a simple NodeData.Message?
      And what are the difference beetween both?

      Thanks in advance !

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 15/12/2017 at 04:04, xxxxxxxx wrote:

        Hi,

        Core messages are asynchronous and are always run in the main thread. These are sent around Cinema 4D application (i.e. to the GUI dialogs/user areas and message plugins) but never propagated to the nodes of a document.

        Node messages are synchronous and are run in the thread context of the caller (for instance an execution pipeline thread or the main thread).
        These are sent to specific nodes ( Message() ) and optionally also to their hierarchy ( MultiMessage() ).

        Core messages are useful to perfom operations in the main thread, e.g. GUI, respond to changes/events, access document.
        Node messages are meant to be evaluated in the context of a node to notify it about a change or send/retrieve data from it.

        Choosing between core and node messages depends on the task and the plugin's type/context.
        If you need to send data to a NodeData plugin then a node message is obvious. You can use _MSG_BASECONTAINER  _or a custom registered plugin ID.

        For more information read Core Messages Manual, NodeData::Message() Manual and C4DAtom Manual Messages.

        Note it's possible to set the ID of a container (with constructor or SetId() ) for the type of the message sent with MSG_BASECONTAINER.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 15/12/2017 at 04:27, xxxxxxxx wrote:

          Thanks a lot for this precise answerd, way more clear to me.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post