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

    Target tag has no TagData?

    SDK Help
    0
    7
    548
    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
      Helper
      last edited by

      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

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

        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.

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

          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.

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

            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

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

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

              use constraint tag instead, more controllable.

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

                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).

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

                  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.

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