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
    • Recent
    • Tags
    • Users
    • Login

    MessageData: Simultanious Sending of message

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 278 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 24/03/2010 at 12:12, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------

      I have a tag plugin with a MessageData class in it.  I use that MessageData to send a message to my tag which triggers the reading of data off of a queue (queue not related to the c4d api, so I know I can't get support for that part of the code).

      In the MessageData I have a while loop that searches the OM for all instances of my tag.  When each tag is found, the message is sent, then the process is repeated, through the entire OM.  However, this isn't ideal, since when the tags are "messaged" one at a time, the first found tag empties the queue, leaving no data for subsequent tags.

      Is there a way to send a message to all instances of my tag plugin in such a way that they all get a chance to receive the data in the queue before it gets emptied?

      Here's the function I'm using to iterate the OM and send the message (Gets called in the CoreMessage member of the MessageData class, activating code in the tag's Message member).

        
      Bool FindMyTags(BaseObject *fo) //recursive function, iterates through the complete object hierarchy  
      {  
        while(fo)  
        {  
            BaseTag *mytag = fo->GetTag(ID_MYPLUGINID, 0);  
            if(tag)  
            {  
                mytag->Message(ID_MESSAGEID);  
            }  
            FindMyTags(fo->GetDown()); //recursion  
            fo = fo->GetNext();  
        }  
      }  
      

      then it gets called in CoreMessages like so:

        
      FindMyTags(doc->GetFirstObject());  
      

      thanks in advance for any insight:)

      -kvb

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 29/03/2010 at 06:50, xxxxxxxx wrote:

        Howdy,

        Maybe it would work if you don't let the tag empty the que, but instead let the FindMyTags() function empty the que after the while loop has finished?

        Adios,
        Cactus Dan

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 31/03/2010 at 01:54, xxxxxxxx wrote:

          Thanks Dan,

          I might end up doing that as well, but I've found a way to store away all the data globally so the other tags can find it.

          thanks,
          kvb

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