THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/01/2011 at 09:00, xxxxxxxx wrote:
It can be done that way, nux95, but best from a SceneHook plugin (something to keep track of the scene). In other words, it is impossible for the tag to remove itself unless you really like crashing C4D. :)
If you go that route then it might also be worthwhile to open a dialog explaining that the tag was removed for that reason so that the user doesn't go batty wondering why the tag keeps disappearing on certain objects.
Also, I would use a for loop and do it this way (assuming C++), especially if multiple instances of the tag are possible on an object:
if (!op->IsInstanceOf(Onull))
{
BaseTag* ntag = NULL;
for(BaseTag* tag = op->GetFirstTag(); tag; tag = ntag)
{
ntag = tag->GetNext();
if (tag->IsInstanceOf(MYPLUGINTAG_ID))
{
tag->Remove();
PluginTag::Free(tag);
}
}
}