Hi Deke,
That's strange. If I add that line, it gives me this:
AttributeError: 'NoneType' object has no attribute 'setFlag'
So I guess the knob called "display" doesn't exist?
To check I ran this:
for item in nuke.selectedNode().allKnobs():
print str(type(item))+" : "+item.name()
Which gives this:
<type 'Obsolete_Knob'> : layer
<type 'File_Knob'> : file
<type 'File_Knob'> : proxy
<type 'Enumeration_Knob'> : frame_mode
<type 'String_Knob'> : frame
<type 'Enumeration_Knob'> : colorspace
<type 'Obsolete_Knob'> : transfer
<type 'Obsolete_Knob'> : linear
<type 'Boolean_Knob'> : premultiplied
<type 'Obsolete_Knob'> : apply through alpha
<type 'Boolean_Knob'> : raw
<type 'MultiView_Knob'> : views
<type 'Enumeration_Knob'> : file_type
<type 'Text_Knob'> :
<type 'Array_Knob'> : render_order
<type 'PyScript_Knob'> : Render
<type 'Array_Knob'> : first
<type 'Array_Knob'> : last
<type 'Boolean_Knob'> : use_limit
<type 'Text_Knob'> :
<type 'Boolean_Knob'> : reading
<type 'Boolean_Knob'> : checkHashOnRead
<type 'Enumeration_Knob'> : on_error
<type 'Array_Knob'> : version
<type 'Script_Knob'> : reload
<type 'Boolean_Knob'> : executing
<type 'Tab_Knob'> :
<type 'PythonKnob'> : beforeRender
<type 'PythonKnob'> : beforeFrameRender
<type 'PythonKnob'> : afterFrameRender
<type 'PythonKnob'> : afterRender
<type 'Tab_Knob'> :
<type 'String_Knob'> : name
<type 'EvalString_Knob'> : help
<type 'PythonKnob'> : onCreate
<type 'PythonKnob'> : onDestroy
<type 'PythonKnob'> : knobChanged
<type 'PythonKnob'> : updateUI
<type 'PythonKnob'> : autolabel
<type 'Obsolete_Knob'> : panel
<type 'ColorChip_Knob'> : tile_color
<type 'ColorChip_Knob'> : gl_color
<type 'Multiline_Eval_String_Knob'> : label
<type 'Font_Knob'> : note_font
<type 'Array_Knob'> : note_font_size
<type 'ColorChip_Knob'> : note_font_color
<type 'Text_Knob'> :
<type 'Boolean_Knob'> : selected
<type 'Array_Knob'> : xpos
<type 'Array_Knob'> : ypos
<type 'File_Knob'> : icon
<type 'Array_Knob'> : indicators
<type 'Boolean_Knob'> : hide_input
<type 'Boolean_Knob'> : cached
<type 'Boolean_Knob'> : postage_stamp
<type 'Boolean_Knob'> : disable
<type 'Boolean_Knob'> : dope_sheet
So there's no sign of the display knob you mentioned. This is with a Write
node. Are you calling that line on a different node type?
Thanks,
Andy
> I add this to my menu.py trailing the creation of the node with some
> type of python script which adds a tab.
>
> nuke.selectedNode().knob('display').setFlag(0)
>
>
> -deke
>
> On Thu, Mar 31, 2011 at 03:46, Andy Nicholas <[email protected]>
> wrote:
>> Hi guys,
>> This is my first post here and it's probably a silly question but I'm
>> just
>> starting out looking at Python in Nuke and I couldn't figure out a way
>> around this issue.
>>
>> I'm overriding the creation of the Write node, and using that creation
>> event to add an extra knob to the node. When I add this new knob to the
>> interface, I'm creating a new tab and placing the new control on it.
>> Doing
>> this, also brings this new tab to the front in the property editor.
>>
>> The undesirable result is that when the user now creates a Write node,
>> it
>> always shows them the new custom tab by default, rather than the main
>> one
>> (with the filename to write, etc.) which is what they would want to see
>> 99% of the time.
>>
>> My code looks something like this:
>>
>> import nuke
>>
>> nukeOriginalCreateNode = nuke.createNode
>>
>> def createMyCustomNodes(node, knobs = "", inpanel = True):
>> result = nukeOriginalCreateNode(node, knobs, inpanel)
>> if node == "Write":
>> tab = nuke.Tab_Knob('MyTab')
>> result.addKnob(tab)
>> btn = nuke.PyScript_Knob('Click Me')
>> btn.setCommand("print 'test'")
>> result.addKnob(btn)
>>
>> return result
>>
>> nuke.createNode = createMyCustomNodes
>>
>>
>> If you put this into menu.py, everytime you create a Write node, it will
>> show you the "MyTab" tab and not the main tab with the standard
>> settings.
>> I just want to know how to stop it showing "MyTab". by default, or how
>> to
>> switch it.
>>
>> Thanks for any help you can give.
>>
>> Cheers!
>> Andy
>>
>> P.S. I've trawled through the python SDK docs looking for something that
>> would help, but I've not had any luck so far. Is there a searchable
>> archive for this list somewhere?
>>
>>
>> - - - - - - - - - - - - -
>> Senior TD
>> The Mill, London
>>
>>
>> _______________________________________________
>> Nuke-python mailing list
>> [email protected]
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>
>
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python