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

    InExcludeData for tag

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 692 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

      On 25/06/2017 at 10:25, xxxxxxxx wrote:

      Is there anyway to get something similar to InExcludeData but for storing tag instead of object?

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

        On 26/06/2017 at 03:12, xxxxxxxx wrote:

        Hi,

        In which context do you want to have an InExcludeData with tags? Do you want to manipulate an arbitrary InExcludeData object or one for a description parameter?

        Note, an InExcludeData can store any base list element, not only objects. The documentation isn't clear.
        And in a description resource file, filter the accepted base list elements with the ACCEPT/REFUSE flags.
        For instance, to accept only tags use:

        IN_EXCLUDE PLUG_INEXCLUDE { ACCEPT { Tbase; } }
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 26/06/2017 at 03:19, xxxxxxxx wrote:

          It would be nice to have it directly into userData.
          since I build my ui from user data for some reasons instead of passing via desciption.

          Anyway thanks you

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

            On 26/06/2017 at 05:59, xxxxxxxx wrote:

            It's also possible to setup the ACCEPT settings for an InExclude user data.
            This can be done via code with BaseList2D.GetUserDataContainer()/SetUserDataContainer() that retrieve/set a user data description.
            The following script changes all the InExclude user data of the active object to only accept tags:

            import c4d
              
            def main() :
                if op is None:
                    return
              
                # Loop through active object user data
                udList = op.GetUserDataContainer()
                for udID, udBC in udList:
              
                    # Filter INEXCLUDE user data
                    if udID[1].dtype == c4d.CUSTOMDATATYPE_INEXCLUDE_LIST:
                        # Setup DESC_ACCEPT settings container
                        accept = c4d.BaseContainer()
                        accept.InsData(c4d.Tbase, "")
                        # Set DESC_ACCEPT settings container
                        udBC[c4d.DESC_ACCEPT] = accept
                        # Set changed user data settings
                        op.SetUserDataContainer(udID, udBC)
                
                c4d.EventAdd()
              
            if __name__=='__main__':
                main()
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 26/06/2017 at 06:27, xxxxxxxx wrote:

              Nice thanks you !! 🙂
              This should be written in the documentaion I guess.

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