Target tag has no TagData?

On 13/01/2016 at 14:14, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R16 
Platform:      
Language(s) :     C++  ;

---------
Sorry for the many questions recently. This one doesn't have a very high priority. :)

When I use tag- >GetNodeData() on a "Target" tag, I always get nullptr. Why is that? And how do
I get the TagData for that tag then?

BaseTag tag* = op->GetFirstTag();
while (tag) {
    auto data = (TagData* ) tag->GetNodeData();
    GePrint(tag->GetName() + " | " + String::UIntToString((UInt) data));
    tag = tag->GetNext();
}

It seems to work (ie. not return a nullptr) for some other tags I tested.

Thanks,
Niklas

On 14/01/2016 at 02:28, xxxxxxxx wrote:

Hi Niklas,

you are right. There are indeed tags, that have no NodeData. Same is true for the Coffee tag for example.
As for the why, I can only guess, that these tags were implemented before the actual plugin structure for tags got developed.

On 14/01/2016 at 02:37, xxxxxxxx wrote:

Sorry, forgot to answer the "How to get the data?" question:
I think, it's just a simple matter of using GetParameter() on the BaseTag with the defines from ttargetexpression.h.

On 14/01/2016 at 03:41, xxxxxxxx wrote:

Thanks for the reply Andreas,

Originally posted by xxxxxxxx

Sorry, forgot to answer the "How to get the data?" question:
I think, it's just a simple matter of using GetParameter() on the BaseTag with the defines from ttargetexpression.h.

My question was "How to get the TagData when GetNodeData() returns nullptr", but it might be my
fault for not being specific enough.

Originally posted by xxxxxxxx

you are right. There are indeed tags, that have no NodeData. Same is true for the Coffee tag for example.
As for the why, I can only guess, that these tags were implemented before the actual plugin structure for tags got developed.

So there really just is  no TagData for the plugin? Jeez, that would be a bummer. I need the TagData
so I can call it's Execute() method at a specific point. It's very hacky, but it should be just a proof of
concept.

Thanks,
Niklas

On 14/01/2016 at 06:28, xxxxxxxx wrote:

use constraint tag instead, more controllable.

On 14/01/2016 at 07:33, xxxxxxxx wrote:

Originally posted by xxxxxxxx

use constraint tag instead, more controllable.

It's not a matter of the tags functionality and behaviour, it's a matter of "works for every tag" (as you
would expect it) compared to "works for most tags" (as it is right now, the Target tag, and 
possibly other tags, are an exception as can't get their TagData).

On 15/01/2016 at 04:49, xxxxxxxx wrote:

Hi Niklas,

sorry, I got your question wrong.
No, there's no way of calling Execute() for these tags. These tags are not implemented as plugins/modules but rather directly derived from the internal representation of BaseTag.