MessageData: Simultanious Sending of message
-
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
-
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 -
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