Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    interactions between two or more plugins which are in a single Python file

    Cinema 4D SDK
    python
    3
    8
    1.1k
    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.
    • L
      Ling
      last edited by Manuel

      how can I make interactions between two or more plugins which are created in a single Python file, including the commandData plugin and the toolData plugin. now, I want to send a message from a toolData plugin to two or more commandData plugins if the 'if' conditions is Ture. but, I don't want to use global values in Python. How can I realize that. Thank guys!

      1 Reply Last reply Reply Quote 0
      • C4DSC
        C4DS
        last edited by

        https://developers.maxon.net/forum/topic/11436/send-message-to-tooldata
        https://developers.maxon.net/forum/topic/13379/send-message-to-commanddata

        L 1 Reply Last reply Reply Quote 1
        • L
          Ling @C4DS
          last edited by Manuel

          @c4ds I had got a try.
          I write codes:

          commandPlugin=c4d.plugins.FindPllugin(the plugin id, c4d.PLUGINTYPE_ANY)
          commandPlugin.Message(the integer)
           in GetCursorInfo() called back function of toolData.
          and, codes:
          if type== the integer:
             print(the integer)
          

          in Message() called back function of commandData.
          but the codes can't print "the integer" when I move the mouse with the toolData.
          actually, I change codes like that:
          print(the integer)
          in Message() called back function of commandData. .
          but I still can not receive a message.
          I want to change a value or execute a function in the commandData baesd on the mouse movement of toolData or a message from toolData

          C4DSC 1 Reply Last reply Reply Quote 0
          • C4DSC
            C4DS @Ling
            last edited by C4DS

            @Ling
            You cannot simply call Message(the integer) on a CommandData.
            As I mentioned in the link (https://developers.maxon.net/forum/topic/13379/send-message-to-commanddata) the CommandData expects a message of type MSG_COMMAND. You cannot pass any integer.

            But since you want to send more information than just an integer you then cannot use the solution I provided by using the CommandData.ExecuteSubID.

            Note that a CommandData is more like a "single-shot" action. It would probably be a better idea to look for something else to "change a value" than a CommandData.
            Without knowing the whole idea behind your plugin it is hard to suggest something.

            L 1 Reply Last reply Reply Quote 0
            • L
              Ling @C4DS
              last edited by

              @c4ds Thanks! I had changed my solution. Thank you to reply me!

              C4DSC 1 Reply Last reply Reply Quote 0
              • C4DSC
                C4DS @Ling
                last edited by

                @ling said in interactions between two or more plugins which are in a single Python file:

                I had changed my solution.

                If you could share the solution, or at least the concept behind it, this might help others with a similar problem looking for a solution.

                1 Reply Last reply Reply Quote 0
                • L
                  Ling
                  last edited by Ling

                  I just use 'global value' to settle this problem. it is not good way or good solution for coding. but I have to solve this problem in a short time because it is just a little part of my plugin. I have so many problems to deal with that I can not waste my time.I think the message of commandData will update or call back when this command gui updates, or message maybe update with other conditions.sorry! I just a newbie for programming.

                  1 Reply Last reply Reply Quote 0
                  • ManuelM
                    Manuel
                    last edited by

                    Hi,

                    I'm happy that you solved your issue.
                    For your next post, and i know you can see that as a waste of time, please follow our guidelines. Use the functionalities of the forum to mark your thread as a question, and mark it as solved when it's done. (Even for a negative answer).

                    Please use also tags, that help us to understand and answer faster without guessing. Language you are using (python, c++) cinema4D version, everything that can help us to understand your issue.

                    You will also find on those guidelines how to explain your issue. Sometimes people want a solution for an issue creating by a bad workflow.

                    In your case, it looks more like sharing information between plugins. There are several answers/possibilities for that.

                    This forum is also about stepping back, having a fresh eye on your issue and move forward 🙂

                    Cheers,
                    Manuel

                    MAXON SDK Specialist

                    MAXON Registered Developer

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