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)