OK, here's an interesting problem... Well, it's "interesting" in the sense that I can't figure out how to solve it!!  (8^\

---- When I add a custom PythonPanel to the Pane menu, create it as a tab, save the Nuke script and recall it - the panel does not appear! 

---- The thing that is causing it to *not* appear is assigning an initial value to the knob. If I don't assign an initial value, the panel appears in the tab, as expected. This happens with more than one type of knob, by the way. It seems to be a general problem...

---- For debugging purposes, I am making a simple PythonPanel and adding a String_Knob to it. If I comment out the last .setValue line, the tabbed panel saves and restores with the Nuke script without a problem. If I assign a default value, it doesn't.

---- Here's the test class:
import nuke
import nukescripts
class testpanel( nukescripts.PythonPanel ):
    def __init__(self):
        nukescripts.PythonPanel.__init__(self, 'View Selector', 'com.richbobo.testpanel')
        self.partStartsWith_knob = nuke.String_Knob('startswith', 'View Name - Starts With :')        
        self.addKnob(self.partStartsWith_knob)
        self.partStartsWith_knob.setValue('foobar')

---- Here's what I have in my menu.py:
import test_panel
def addtestpanel():
    global testpanel
    testpanel = test_panel.testpanel()
    testpanel.addToPane()
    return testpanel
nuke.menu('Pane').addCommand( 'testpanel', addtestpanel )
nukescripts.registerPanel( 'com.richbobo.testpanel', addtestpanel )

--- Note that there are no errors reported when the panel does not appear.

It seems that assigning initial values to the knobs of a registered panels somehow interrupts the mechanism that causes the panel to show. How do I make sure to insert initial values in the knobs - without causing the registered PythonPanel to not show?!?


Thanks for any help,
Rich

Rich Bobo 
Senior VFX Compositor
Email:  richb...@mac.com			
Mobile:  248.840.2665
Web:  http://richbobo.com
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to