top of page

LIST OF KNOBS IN NUKE PT.2.

In the first part I showed how can you create user knobs manually.

In the second part let's focus on how to create them with Python but first a detour

on why I wanted to make this collection.

My goal here was to create a page that helps python users to easily find the best type of user knobs when making a gizmo or a template and the manually available user knobs are just not enough.

Currently, for this purpose you can search the NDK doc which contains elements you can't create with Python so when you find one you like you need to check the API if it's available then search forums if you ran into some issues. So it can easily take up more time than anticipated.

For this reason my page contains a lot of links to these pages as I merely

wanted to create a purposefully organized page to support the current documentations.

I will also only list specific functions along the Classes (which knob's are in Py) that are created for a certain knob or can be especially useful when dealing with the mentioned user knob. For a full list of them I encourege to have a look at the documentation that I linked to each knob's name.

 But let's start in the beginning - ID numbers.

What are the ID numbers of the knobs and how to find it?

This is already a bit of a confusing matter so let's dive in from an easy access point:

ID numbers
006.jpg

If you add user knobs to a node and copy&paste it to a text editor you'll see a nuke syntax which is a same as in the .nk files and so how you store

your scripts!

So each manually added user knob adds a line that starts with addUserKnob followed by a curly bracket that can include first the ID number ( 7 ) than the name ( slider ) and the label ( Slider ) of the knob.

So each knob has it's unique

ID number!


Cool!

Got it!

id_num_001.jpg

Unfortunately, the story is not that simple!

Yes, the ID numbers are mostly correct but,

for some reasons we have cases on the list where:

1. The ID based on the documentation doesn't match with the actual ID in the syntax.

2. The ID is 0 which is the Obsolete knob therefore dissappears when the node is copied.

3. Knob has a different knob's ID.

4. Knob doesn't appear in recent API or NDK doc so the name to identify

was only possible by the use of a list provided for the KnobType. ( The API is for v14 as

v14`s KnobType just doesn't show the ID numbers, but we can still find them if you run
help(nuke.KnobType) in your script editor. ) 

I assume for this reason The Foundry is not using the ID numbers to sort the 

available knobs anymore as it did only in the v6.3's documentation.

Also this doc goes up to 74, the current number is 89.

( Since the 'Knobs by ID' part is simply empty )

So there are 2 main issues I bumped into regarding certain knobs 

Luckily, I'm not the first one who encountered these issues so will rather

reference solutions here:

Issue #1 - Changes / Disappears when copied


Mark Joey Tang or MJT Lab had already made a workaround for the disappearing knob issue which is brilliant and essentially using a callback onCreate() to create a

new knob every time it's opened. But let him explain better!
List of the knobs that are dissappearing: 

Help_Knob, LookUpCurves_Knob, Range_Knob (ID 78 - partially dissappear), Histogram_Knob, Keyer_Knob ( partially dissappear ), ViewView_Knob, IArray_Knob, Font_Knob

Issue #2 - panelDropped

This is an issue that only effects RGB_Knob and RGBA_Knob.

It is essentially adding an extra knob - panelDropped - to your list when

the node gets copied. The issue can be particularly annoying when you end up with muliple lines of panelDropped in your .nk file wich is also increasing the size of the script.

Luckily there is a forum thread of the issue and a solution too!
Apparently, also a bug report that has been closed . . .

paneldropped01.jpg

The solution is by Gene Hammond Lewis in a form of a snippet that can be run 

on the scripts everytime onScriptClose:

How to check the knob's specs?

Erwan Leroy did a great job on how to check certain things about nodes and knobs in

his python tutorial which is a good starting point for anyone new to this!

To specifically ask for the Class and the name and ID number here is a useful snippet:

Knob's specs

The Chart

Nuke knob useability chart (2).png

( 'Total ???' reffers to those knobs that doesn't appear in the API nor the NDK doc )

0

Finally, the LIST

#0 Obsolete_Knob

It is a mechanism for changing the name and action of knobs. Generally used when dealing with NDK development like versioning.

Using on its own not recommended.

#1 String_Knob OR EvalString_Knob

( manually: Text Input Knob or string )

A knob which holds a string value. Appears as a text entry field in a Node panel.

py_01.jpg
py_02.jpg

#2 File_Knob

( manually: Filename or filename )

Presents a string plus a button which launches the NUKE file browser. 

py_03.jpg

#3 Int_Knob

( manually: Integer Knob or integer )

 Presents just a numeric input box.

py_04.jpg

#4 Enumeration_Knob

( manually: Pulldown Choice or pulldown )

Presents a single selection dropdown menu.

py_05.jpg

#5 Bitmask_Knob

 A series of labelled checkboxes. 

py_06.jpg

Note:
- ID that appears in a syntax is 4 ( Enumeration_Knob ) instead of 5

- After copying the knob turns into an Enumeration_Knob

py_07.jpg

#6 Boolean_Knob

( manually: Check box or boolean )

 A single checkbox with a label to the right, and no new line by default.

py_08.jpg

#7 Double_Knob

( manually: Floating Point Slider or double )

A floating value slider.

py_09.jpg

#8 Float_Knob

Not in the module ( NDK )

#9 Array_Knob

Storing an arbitrary width and height matrix of floats.

py_10.jpg

#10 ChannelMask_Knob

Presents a dropdown list of the current channelsets in the script.

10
py_11.jpg

#11 Channel_Knob

Presents a dropdown list of the current channelsets in the script.

py_12.jpg

#12 XY_Knob

( manually: 2d Position Knob or position_2d )

Two numerical input boxes with hardcoded ‘x’ and ‘y’ labels, plus a draggable Viewer handle.

py_13.jpg

#13 XYZ_Knob

( manually: 3d Position Knob or position_3d )

Three numerical input boxes with hardcoded ‘x’, ‘y’, and ‘z’ labels, plus

a draggable 3D Viewer handle.

py_14.jpg

#14 WH_Knob

( manually: Width/Heigh Knob or size_wh )

A single numerical input box with a slider and a button to switch to two numerical input boxes with hardcoded ‘w’ and ‘h’ labels. When stored, the horizontal value is divided by the incoming format’s pixel aspect ratio, so that if the user sees equal values, the result in the Viewer is square.

py_15.jpg

#15 BBox_Knob

( manually: Bounding Box Knob or bbox )

Four numerical input boxes with a button to switch mode between x, y, r and t (bottom left x and y plus top right r and t) and x, y, w and h (bottom left x and y plus the box’s width and height) with hardcoded labels. It also draws a box widget into the Viewer with eight handles, allowing corner and edge dragging.

py_16.jpg

#16 Size_Knob

( manually: Size Knob or size )

Note: It's not appearing in the API or the NDK doc but you can create manually.

On the created knob the ID is 16 but the Class identified as Array_Knob.

#17 Format_Knob

 Presents a single select dropdown of all formats currently available in the script.

py_17.jpg

#18 Color_Knob

( manually: RGB Color Knob or color_rgb )

Stores color values at either double or float precision. Initially shows a single entry box and slider, a button to split to 3 entry boxes, a button to pop up the NUKE color wheel, and a swatch showing the current color plus an eyedropper for sampling. The color swatch is looked up through the root monitor LUT to present an interface representation in a

familiar color space.

Note: Look above for Issue #2 - panelDropped

py_18.jpg

#19 AColor_Knob

( manually: RGBA Color Knob or color_rgba )

As with Color_knob, but stores and allows editing of a fourth value, representing alpha.

Alpha is not represented in the swatch.

Note: Look above for Issue #2 - panelDropped

py_19.jpg

#20 Tab_Knob

( manually: Tab or tab )

Starts a new Tab in the parameter panel and resets BeginGroup hierarchy to zero. By default, without an initial Tab declaration, the first tab on a node inherits its name from the node itself. Declaring a name up front, before any other knobs, simply renames the first tab -

it does not create a new tab. 

20
py_20.jpg

Note: If you want to create a Group that you would create manually

you will need a Tab_Knob and a 3rd argument that turns this 

type of knob into a Group.

( manually: Group or group )

py_55.jpg

#21 Custom_Knob

Not in the module (NDK)

#22 PyScript_Knob

( manually: Python Script Button or python_button )

Presents a push button which does not start a new line by default. It has no data storage, but executes a passed string of Python inside NUKE’s Python scripting environment using this knob as ‘context’ so that relative names work.

py_21.jpg

#23 - Was Text_Editor_Knob - Not in use

#24 Transform2d_Knob

Describes an affine transform. Presents a number of lines of multiple instances of Float_knob, as well as a 2D transform jack in the Viewer. Requires Matrix4 object.

#25 Spacer_Knob

Not in the module (NDK)

#26 Text_Knob

( manually: Text or text and Divider Line )

Presents as user defined text on the Properties panel, but does not start a new line by default. Note that this can be used between knobs by clearing the start line flag on

the subsequent knob. By not providing label or text appears as Divider Line.

py_24.jpg

#27 Help_Knob

Presents a button with a ? label, used to pop up a help line.

Note: ID is 0 (Obsolete) - dissappears when copied ( Hide turns on )

Issue #1 - Changes / Disappears when copied

py_25.jpg

#28 MultiLine_String_Knob

Not in the module (NDK)

#29 Axis Knob

Describes a 3D, 6 degrees of freedom transformation. Presents a number of lines of multiple instances of Float_knob, as well as a 3D transform jack in the Viewer. Requires Matrix4 object.

#30 UV_knob

( manually: UV Coordinate Knob or uv )

 Presents two numeric input boxes, with hardcoded ‘u’ and ‘v’ sub-labels, plus an

animation menu button.

30
py_53.jpg

#31 Box3_Knob

Describes a cubic 3D volume using two 3D points.

py_26.jpg

#32 Script_Knob

( manually: TCL Script Button or tcl_button )

It has no data storage, but executes a passed string of TCL inside NUKE’s TCL scripting environment using this knob as ‘context’ so that relative names work.

py_27.jpg

#33 LookupCurves_Knob

Presents a curve interface with an arbitrary number of curves included.

Note: ID is 0 (Obsolete) - dissappears when copied ( Hide turns on )

Issue #1 - Changes / Disappears when copied

py_28.jpg

#34 - Was Tooltip_Knob - Not in use

#35_Pulldown_Knob

( manually: Command Menu or menu )

 Presents a dropdown menu where selecting an item executes TCL OR Python commands.

py_29.jpg

#36_Eyedropper_Knob

Presents a color swatch button that activates an eye dropper color sampling interface.

Note: ID is 0 (Obsolete) - dissappears when copied ( Hide turns on )

Issue #1 - Changes / Disappears when copied

py_30.jpg

#37_Range_Knob

A knob which the minimum and maximum for a range of values.

Note: ID is 78 (IArray) - slider dissappears when copied

Issue #1 - Changes / Disappears when copied

py_31.jpg

#38 Histogram_Knob

Presents a read only histogram graph interface with two sets of data .

Note: ID is 0 (Obsolete) - dissappears when copied ( Hide turns on )

Issue #1 - Changes / Disappears when copied

py_32.jpg

#39_ Keyer_Knob

Presents a trapezoid graph shape with corners defined by the data values. Used in the Keyer node and generally not recommended elsewhere.

Note: ID is 78 (IArray) - graph dissappears when copied

Issue #1 - Changes / Disappears when copied

py_35.jpg

#40 ColorChip_Knob

A knob which holds a single unsigned int that describes a user interface colour. The color format is 0xRRGGBB00.

40
py_36.jpg

#41 Link_Knob

Soft links to another node, identified by the name passed on construction.

Creates an expression line between the 2 nodes.

( Using a Blur node's size knob in the example )

py_37.jpg

#42 Scale_Knob

Presents a single numerical entry box with a slider, plus a button to flip the interface to two numerical interface boxes.

Note: ID is 78 (IArray) but nothing disappears when copied

py_38.jpg

#43 Multiline_Eval_String_Knob

A text field for multiple lines of text, including scroll bars.

py_39.jpg

#44 OneView_Knob

Presents a single selection dropdown list of the current views present in the script. 

Note: Note: ID is 4 (Enumeration) but nothing disappears when copied

py_40.jpg

#45 MultiView_Knob

Presents a multi-selection dropdown list of the current views present in the script.

py_41.jpg

#46 ViewView_Knob

Presents a ‘patch bay’ type interface allowing the user to specify a relationship

between pairs of views.

Note: ID is 0 (Obsolete) - dissappears when copied ( Hide turns on )

Issue #1 - Changes / Disappears when copied

py_42.jpg

#47 PyPulldown_Knob

Not in the module (NDK)

#48 GPUEngine_knob ?

#49 MultiArray_knob ?

#50 ViewPair_knob

Not in the module (NDK)

50

#51 List_knob

Not in the module (NDK)

#52 PythonKnob

A string-valued knob which evaluates its value as a Python expression.

Note: ID is 1 (String) - but nothing disappears when copied

Interestingly, there is a knob that has ID 52 and can be created with two different commands:

PyCustom

PythonCustomKnob

Both of these commands create a same type of knob.

These knobs doesn't do much on there own but allows you to use modules like QTWidget to add different type of knobs that are available in Nuke

without needing to use C++.

If you are interested in some of the best experiment on how far you can push Nuke using PyCustom I recommend the

fascinating two part tutorial of Erwan Leroy.

py_43.jpg

#53 MetaData_knob

Not in the module (NDK)

#54 PixelAspect_knob

Not in the module (NDK)

#55 CP_knob ?

#56 BeginToolbar/EndToolbar

Not in the module (NDK)

#57 BeginTabGroup_KnobEndTabGroup_Knob

Begin a group of tabs. Subsequent knobs will all be part of the same tab group, until a matching EndTabGroup knob is found.

Note: ID is 20 (Tab) - but nothing disappears when copied

py_56.jpg

#58 PluginPython_Knob ?

#59 BeginExoGroup/EndExoGroup

Not in the module (NDK)

#60 Menu_knob

Not in the module (NDK)

60

#61 Password_Knob

A knob which holds a password string value. Appears as a password entry field in a Node panel.

py_45.jpg

#62 Toolbox_knob  ?

#63 Table_knob

Not in the module (NDK)

#64 GeoSelect_Knob

Presents a button interface on the Viewer, and a series of selection based handles on 3D geometry. Creation of Geoselect_knobs is not recommended, however GeoOp’s inherit one automatically (assuming you chain the knob’s call back to the GeoOp parent). This can be accessed using the name “geo_select” and addressed using the interface defined in GeoSelectKnobI.h.

#65 InputOnly_ChannelSet_knob

Not in the module (NDK)

#66 InputOnly_Channel_knob

Not in the module (NDK)

#67 ControlPointCollection_knob  ?

#68 CascadingEnumeration_Knob

( manually: Cascading Pulldown Choice or cascading_pulldown )

Stores a single value between 0 and some maximum, and manages a set of keywords visible to the user. The words themselves are displayed on a pulldown list in the user interface, and are written to the saved scripts (so that the numerical values can change). To create cascading submenus simply use the forward slash ( '/' ) e.g. menu/item1

py_46.jpg

#69 Dynamic_Bitmask_knob

Not in the module (NDK)

#70 MetaKeyFrame_knob

Not in the module (NDK)

70

#71 PositionVector_knob

Not in the module (NDK)

#72 Cached_File_knob

Not in the module (NDK)

#73 TransformJack_knob  ?

#74 Ripple_knob

Not in the module (NDK)

#75 SceneView_Knob

Displays a list of items as a hierarchy. The hierarchy is specified using back or forward slashes within the item names to specify their level in the tree. Handles multiple selection

of items within the tree.

Note: Items disappear when copied.

py_47.jpg

#76 VSpacer_Knob  ?

#77 CancelExecution_Knob  ?

#78 IArray_Knob

Subclass of Array_Knob. Allows to set dimensions.

Note: Seems broken thank to a dropData function.

When copied turns into 1 dimension knob and gets animated values on frame 1.

From the script Editor when copied:

nuke.nodeCopy(nukescripts.cut_paste_file())

nuke.nodePaste(nukescripts.cut_paste_file())

nukescripts.dropData('text/plain', '''set cut_paste_input \[stack 0]\nversion 12.2 v1\npush \$cut_paste_input\nNoOp {\n name NoOp1\n selected true\n xpos 97\n ypos -10\n addUserKnob {20 User}\n addUserKnob {78 Array l 78_Array n 3}\n Array {\n {1 -3.795368826e-270 11}\n {-6.042383589e-311 1 -6.585614414e-311}\n {2.100775838e-312 -3.797784176e-270 1}\n }\n}\n''')

py_48.jpg

#79 ResizableArray_Knob ?

#80 Disable_Knob

A knob which holds a boolean value representing the disabled state of a node. This appears in a Node panel as a check box.

80
py_49.jpg

#81 Icon_Knob ?

#82 FrameExtent_Knob ?

#83 Radio_Knob

Stores a single value between 0 and some maximum, and manages a set of Radio Buttons visible to the user. This is essentially an Enumeration_Knob with a different widget.

py_54.jpg

#84 FreeType_Knob

A knob which holds a font family and style name.

py_50.jpg

Font_Knob

Note: Technically this is a slightly different font selecting knob than the FreeType_Knob only that its ID is 0 (Obsolete) and dissappears when copied and it doesn't appear on the list of knobTypes nor in the NDK documentation.

Therefore recommended to use FreeType_Knob instead.

py_51.jpg

#85 EditableEnumeration_Knob

This is essentially an Enumeration_Knob with editable options, therefore can be manually expand the list of options.

Note: For some reasons its description in the API is about the Radio_Knob and it doesn't appear on the NDK documentaton.

py_52.jpg

#86 Colorspace_Knob ?

Note: The only mentioning of this knob in the documentations I found was the argument that

the getColorspaceList requires ( source code ), although this has little to do

with what we are after here, probably.

#87 ParticleChannels_Knob

The same dropdown knob you can find in the ParticleEmitter.

py_57.jpg

#88_SceneGraph_Knob

The familar knob from ReadGeo. Displays a list of items as a hierarchy. The hierarchy is specified using back or forward slashes within the item names to specify their level in the tree. Handles multiple selection of items within the tree.

py_58.jpg

#89_PathExpression_Knob

A string-valued knob for entering stage path expressions.

py_59.jpg

Hope you will find it useful! 

bottom of page