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

    coffee tag finding itself ?

    SDK Help
    0
    4
    362
    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

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

      On 20/02/2008 at 06:55, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10 
      Platform:      
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      i have a coffee tag that has some userdata attached which i want to retreive in the tag code...
      does
      var tag = op->GetFirstTag();
      find the first tag of the object, or the first tag in the whole scene ?

      how can i find the "actual" running coffee tag ???
      the one with the code which is running?
      specially if there are more than 1 of these tags present in the code....

      help ! .)

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

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

        On 20/02/2008 at 07:53, xxxxxxxx wrote:

        Quote: _var tag = op- >GetFirstTag();
        >
        > * * *
        _


        This gives you the first tag of the object.

        > Quote: _how can i find the "actual" running coffee tag?
        >
        > * * *
        _


        I think this is impossible.

        The code of the COFFEE tag is stored within its conatiner, see example code:

        > \> var bc = mycoffeetag- >GetContainer(); \> println(bc->GetData(1000)); //1000 is the ID of the code string within the container \>

        cheers,
        Matthias

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

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

          On 20/02/2008 at 09:16, xxxxxxxx wrote:

          var bc = mycoffeetag->GetContainer();

          looks promising !

          what is , or how do i get "mycoffeetag" ?

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

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

            On 20/02/2008 at 10:23, xxxxxxxx wrote:

            If the tag is your plugin tag and has a unique ID, then you can do something like this:

            var tag;
            for (tag = op->GetFirstTag(); tag; tag = tag->GetNext())
            {
            if (tag->GetType() == myID) // this is your tag, do something
            }

            Note that 'myID' should instead be the actual ID number. This is on an object basis (BaseObject op). If you need to traverse the document for all objects with your tag, you'll need to set up a recursive traversal.

            If the tag is just a COFFEE tag with your COFFEE code, that'll require the extra steps provided by Matthias. Use the ID of the COFFEE tag in lieu of 'myID' (Tcoffeeplugin or Tcoffeeexpression might work here).

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