Using tcl script in nuke, adding a group knob to a node looks like this
addUserKnob {20 start_group l "My Group" n 1}
... add other knobs
addUserKnob {20 end_group l endGroup n -1}
It appears that the Group knob uses the same knob type as the Tab knob, except that it uses the n
keyword argument. I don't see any information in the python api documentation on how to set the n
argument so that nuke creates a Group instead of a Tab.
My python code looks something like this
# Get node
node = nuke.toNode('MyNode')
# Add new tab to node
tab = nuke.Tab_Knob('custom_tab', 'Custom Tab')
node.addKnob(tab)
# Add a group knob
group = nuke.Tab_Knob('group_1', 'Group 1') # some other argument or flag?
node.addKnob(group)
# Add some other knobs
name = nuke.String_Knob('name', 'Name')
node.addKnob(name)
# Add some type of "end group" knob?
?
I'm assuming I should be using the Tab_Knob
in python just like I use the Tab knob type (i.e. 20
) in tcl script, and that there is both a start and end knob for the group, but I'm not sure how that should be done in python.