InExcludeData for tag



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



  • 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; } }
    


  • 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



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


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

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


Log in to reply