Small improvement to Pr_Suite for Nuke

Small improvement to Pr_Suite for Nuke

One of the most tool I use constantly in Nuke is Pr_Suite_v1.1, created by Parimal VFX. What is included in the suite can be found on the linked website so I will not go into details. What this is about is some small improvement I made over the time I use it.

OpenFolder.py located in Pr_Suite > python > Prp

OpenFolder.py does exactly what its name implies. It opens folder of selected read/write node, or nuke script location directly from Nuke. Allows user to access those folders without navigating there manually. The original code doesn’t work with nodes with relative path however, hence the first improvement below. Second improvement is for linux only.

  • Works with nodes with relative file path.
  • Launches with default file manager instead of hard coded to gnome.
def open_folder(path):
    """
    Open folder based on OS.
    :param path: Directory path
    :type path: str
    :return: None
    :rtype: None
    """
    if platform.system() == "Windows":
        os.startfile(os.path.abspath(path))
    elif platform.system() == "Darwin":
        subprocess.Popen(["open", path])
    elif platform.system() == "Linux":
        subprocess.check_call(["xdg-open", path])
    else:
        nuke.message("Unsupported OS")


def open_read_file():
    """
    Open folder for selected node with file knob.
    :return: None
    :rtype: None
    """
    read_path = nuke.selectedNode()["file"].evaluate()
    open_folder(os.path.dirname(read_path))

ShufferEXRPasses.py located in Pr_Suite > python > Prp

This script gives you a pop up Window for you to select the passes you want, and shuffle all of them out neatly. Small complain I have for this is it adds the channel name to the shuffle node’s label. Which is nice but I don’t want them hardcoded, in case I want to change the channel to something else. Note that there’s already another python script in Pr_Suite 1.1 to add ‘[value in]’ in a shuffle’s label, so it reflects whatever the in channel is. But why not add it in the ShuffleEXRPasses

            for layer in extract:
                shuffle = nuke.nodes.Shuffle(label='[value in]')
                shuffle["in"].setValue(layer)
                shuffle.setInput(0, self.node)

Leave a Reply

Your email address will not be published. Required fields are marked *