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
Nuke-python@support.thefoundry.co.uk
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to