Custom Scripts II: Dot auto label

This script is prefect for camera projection based projects. It allows to have a clean and organised Nuke file very easily. After launching this script all the new dots check if they are connected to a camera, if so, they display the name and the label of that camera and hide the input, if not, they behave as usual.


def dot_label_auto():
    sel_node = nuke.selectedNode()
    input_class = sel_node.input(0).Class()
    if input_class == 'Camera2':
        input_name = sel_node.input(0).name()
        input_label = sel_node.input(0).knob('label').getValue()
        sel_node.knob('hide_input').setValue(1)
        sel_node.knob('label').setValue(input_name + '<br/>' + input_label)

nuke.knobDefault('Dot.label','[if [exists input] {[python dot_label_auto(); set dotLabel [value label]; return $dotLabel]} else {return ""}]')

You can use this script by copying and launching it in Nuke’s Script Editor.

If you need any help or you any suggestion to improve it, please feel free to contact me.

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 )

Google+ photo

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

Twitter picture

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