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

    Marking a tag

    PYTHON Development
    0
    3
    380
    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 12/03/2013 at 07:50, xxxxxxxx wrote:

      Hey Everyone,

      Thanks to you guys I've gotten pretty far in the creation of my plugin, so thanks for that!
      I'm now trying to mark a compositing tag (or it's host, since it can only have one compositing tag anyway) so that i can later on delete all those compositing tags again that were created by the plugin. But those compositing tags that were already on some objects (hence not marked) previous to the plugins execution should remain untouched.

      How can that be achieved?

      Any help is much appreciated!

      Aurel

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

        On 12/03/2013 at 07:57, xxxxxxxx wrote:

        Hi Amadeo,

        if you run the adding and removing of the tags in the same execution pipeline, you can simply
        store a list of all tags you have created. After you're done, you can iterate over each item in the
        list and remove it.

        In case you can not communicate between the adding and removing procedures, you can obtain
        a unique ID from the plugincafe and store a boolean value in the tags you have created. When
        removing, you can check if 1. the ID exists and 2. the value is True (checking twice is better) and
        then remove the tag.

        I_CREATED_THAT_TAG = 1002350 # Must be a unique ID from the plugincafe!
          
        for tag in tags: # iterate over tags
            bc = tag.GetDataInstance()
            if bc.FindIndex(I_CREATED_THAT_TAG) >= 0 and bc.GetBool(I_CREATED_THAT_TAG) :
                tag.Remove()
        

        -Niklas

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

          On 12/03/2013 at 08:14, xxxxxxxx wrote:

          Thanks a lot! I will try that  !Smile[URL-REMOVED]

          Aurel


          [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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