Building a note checklist node in Nuke using Python

posted: Sept. 13, 2020, 11:12 a.m.

Note, we all get notes. Sometimes we had notes but the fact is there they are and they all need to be done.

Usually you will get your notes on some form of Shot Management system, Shotgun, FTrack but over the years I've got notes via email, Google docs or even a text from a Producer in the pub. Anyway you usually want to write these notes somewhere prominent and tick them off. You can do this on a bit of paper and it is quick satisfying and physical to cross them off as they're done.

This little tool is actually for keeping track of notes within Nuke - the nice thing of this is you can keep them all next to the Read node for the version the nodes were given on - then do a quick compare between the version with notes and the new one.

Anyway there are more advanced versions of this kind of tool, but I wanted to show how you can whip up something like this without losing too much time.

So first you will want to open Nuke's Script Editor and try out some of the code, starting with how we take in our notes. We need some kind of input box and Nuke has a whole bunch prebuilt. Looking on the Foundry website we can see that kind of panel we want is a MultilineTextInput panel.

So we can get that with the code:

p=nuke.Panel('notes')
p.addMultilineTextInput('copy paste notes here','')
getNotes=p.show()

notes=p.value('copy paste notes here')

First We create and assign our panel to the varable p The we add our MultilineTextInput to p then we run the panel and at the same time assign it (hence assinging the input) to the variable notes

So if you run that code in Nuke you will see the panel. And if you write some text in there, hit Okay and then print the variable notes you will see the text you wrote.

Okay, so now we need to split that text by line breaks (easiest way) and loop through them:

for line in notes.splitlines():

We are now running a loop that will work through every line of text and do something. The next lines of code will be indented and will describe what it does. For testing it could just be print line

Ok, but we don;t want empty lines to have checkboxes so we can extend it to:

if line != '':
   print (line)

Great! This works, so far we have it in the script editor. But who wants to open the Script Editor? No we want it in a node with a button. So we can create a NoOp node. A NoOp does nothing of course, but we can change up a few things:

First we change the name of our NoOp to 'NoteList' Next, in the Properties we can do a Right-Click,/Manage User Knobs and create a Python Button.

So we can give our button a name (this is the name that Nuke reads, so keep it lower_case and simple) and a Label (this is human readable, keep it short but also normal). We can copy in our code (sometimes indents break doing this, and that is just life, you will need to fix them). Also a ToolTip is the text the user sees if they hover over the button, write something helpful here for lost souls.

So we click ok and the panel comes up when we hit the button. Great. But the reason we added it to a node was so we could add the notes to the node and store them there:

So we can replace that print (line) statement with:

k=nuke.Boolean_Knob(str(noteCount)
nuke.thisNode().addKnob(k)

Okay. So when we run this it will actually add knobs to the node. Since we want new instances of the tool to be clean, we should save the node by copy pasting it to one side. Right, so now what you want to do is to run it and see if it works. Indeed you should get a line of text with each note (assuming each note is on a separate line)

Now we can add the checkboxes (don't forget to keep a clean copy of the node before running the button):

k=nuke.Boolean_Knob(str(noteCount)
nuke.thisNode().addKnob(k)

The rest is all just tidying up and making it a little prettier, adding a counter to list the number of notes and dividers between each line of notes.

The final tool is available from Nukepedia

If you like this tool please share and hit me up with comments here or on Nukepedia.

Lastly as a quick favour I would love it if you would check out the short film I am working hard at with my team on top of work. You can go to the website here and sign up the mailing list! There will be some really cool content coming soon!

Cheers,

Dan

modified Sept. 13, 2020, 11:19 a.m.

Leave a comment:

Comments:

On Nov. 4, 2020  Montaj Parbriz VOLVO F 6 1984 wrote:

Great delivery. Great arguments. Keep up the good work. https://vanzari-parbrize.ro/geamuri/geam-opel-kadett_e_box_t85_-1992-21829.html


On Sept. 14, 2020  Parbriz Citroen Berlingo 2000 wrote:

Asking questions are in fact fastidious thing if you are not understanding anything fully, except this article presents fastidious understanding yet. https://vanzari-parbrize.ro/parbrize/parbrize-citroen.html


On Sept. 14, 2020  Parbriz auto DACIA SANDERO II 2020 wrote:

Hi, all is going fine here and ofcourse every one is sharing information, that's genuinely excellent, keep up writing. https://vanzari-parbrize.ro/parbrize/parbrize-dacia.html