Custom Scripts VII: Quick custom backdrop

I love to keep my nodegraph tidy and organize, so I use to pack nodes related to certain tasks in backdrops with titles. I don’t like the randomness of the backdrop color that Nuke has by default. I created a hotkey (Shift+1) and linked this script to it.

This script creates a backdrop with certain default attributes (color and label, in this case) grouping a node selection, allowing me to organize my nodegraph quicker.

def bg_preset01():
    selNodes = nuke.selectedNodes()
    nodeGroup = []
    for nodes in selNodes:
    bg = nuke.createNode('BackdropNode', inpanel=False)
    padding = 50
    bgX = min([nuke.toNode(i).xpos() for i in nodeGroup]) - padding
    bgY = min([nuke.toNode(i).ypos() for i in nodeGroup]) - padding
    bgW = max([nuke.toNode(i).xpos() + nuke.toNode(i).screenWidth() for i in nodeGroup]) - bgX + padding
    bgH = max([nuke.toNode(i).ypos() + nuke.toNode(i).screenHeight() for i in nodeGroup]) - bgY + padding

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.