Jump to content

python - get all parms exclude specific specific folders


Recommended Posts

# check if the parameter is inside a specific folder.

#this code doesnt
        tmp = ['info','Image Settings','Color Settings']
        for folder in tmp:
            if folder in parm.containingFolders():
                print("excluded : " + str(parm.name()))
                continue

# this code works
        if 'Export Presets' in parm.containingFolders():
            continue

cant really figure why the list method doesnt work. Something i am missing?

Link to comment
Share on other sites

found another solution that works.
 

for parm in parms:
    
        skip_parameter = False

        # Check if the parameter is inside a specific folder. This is in case I want the parms of the HDA itself
        for folder in exclude_folders:
            containing_folders = parm.containingFolders()
            if folder in containing_folders:
                # Exclude parameter
                skip_parameter = True

        if skip_parameter:
            continue

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...