coffee tag finding itself ?



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



  • 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



  • 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" ?



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


Log in to reply