Custom Scripts VI: Quick label changer

Steps of Label Changer script
By default, Nuke has a quick way of changing the name of the nodes by pressing ‘N’. However, I don’t use it at all because I don’t think that changing nodes’ names is a good idea. I always let the name as it is and change the label.

This way I avoid problems related to coding or expressions. As I change the label of nodes quite often, I realized that I needed a quick way of achieving that, so I created this function that opens a window where I can edit the label of a node and linked it to hotkey ‘N’. In addition, this functions has some extra features that I used to do by hand.

def setLabel():
    txt = nuke.getInput('Change Label', '')
    if txt:
        sNodeClass = nuke.selectedNode().Class()
        if sNodeClass == 'BackdropNode':
            txt = '<center>'+txt
        elif sNodeClass == 'Dot':
            nuke.selectedNode().knob('note_font_size').setValue(20)
        nuke.selectedNode().knob('label').setValue(txt)

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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.