Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    flag a tag so that it can be dstinguished

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 177 Views
    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 Offline
      Helper
      last edited by

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

      On 16/01/2008 at 15:38, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.5 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      OK, last question (for today). Promised!

      I create texture tags for objects with a plugin. Every time the user clicks on a button, a new texture tag is created for the active object.

      At some point in my plugin, I need to retrieve all of these texture tag and ONLY the ones that I created with the plugin, not the ones that the user created by creating a new material.

      So, can I flag my texture tags in a way so that they are distinguishable from the 'normal' texture tags?

      (What I did is this. I create a material + tag. Assign the material to the tag and give it a special name. When I want to retrieve all my tags, I loop through all the tags and look if it is linked to a material with this special name. Pretty complex, no?)

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

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

        On 17/01/2008 at 10:21, xxxxxxxx wrote:

        You can use the 'special name' (this is what I do in particular circumstances).

        Or you can create an AtomArray and store your tags in it as they are created. Think of this class as a dynamic array for storing C4DAtom-derived elements (most of the Cinema 4D elements are).

        AtomArray* tagArray = AtomArray::Alloc();
        if (!tagArray) // bad tagArray, bad! 🙂
        ...
        // a new texture tag 'texture' was created by your plugin
        tagArray- >Append(texture);
        ...
        // access the tagArray elements like this:
        TextureTag* tag;
        LONG tACnt = tagArray->GetCount();
        for (LONG i = 0L; i != tACnt; ++i)
        {
             tag = static_cast<TextureTag*>(tagArray->GetIndex(i));
        ...
        }
        ...
        // Don't forget to free the tagArray at some time
        AtomArray::Free(tagArray);

        If you are going to reuse this AtomArray for different objects or at different times collect other texture tags, just call tagArray->Flush() to reset the elements to which it points.

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