Hi Jim,

you can create a Panel in three different ways, this must be implemented as
methods in your pyui.Dialog subclass.


1. Adding to a Pane

This will only works if command is launched from the Pane menu, thats the
only menu where 'nuke.thisPane()' returns a valid value.

def add2pane( self ):

    pane = nuke.thisPane()
    if pane:
        pane.add( self )

    return self



2. Show

Will create a float Pane and then put your Panel in it.

def show_float( self ):

   self.show()
   return self



3. ShowModal

Same as Show but with in a modal window.

def show_modal( self ):

    self.showModal()
    return self


Once this methods are defined,  invoke your panel with:

"myPanel.add2pane" from the Pane menu

"myPanel.show_float" or  "myPanel.show_modal"  from any other menu.


Hope it helps and good luck with Panels.

J




El 13 de diciembre de 2011 02:25, Jim Berndt <
[email protected]> escribió:

> **
> I am having a problem when invoking my script from a menu.
>
> I added an item under the Render Menu that calls a new pane. This pane has
> some fields, and a few buttons. The pane will not display UNLESS I have
> created another one first.
>
> By default, on the right I see the "Properties" Pane. If I attempt to
> execute my script, nothing happens. If on the other hand, I add a new pane
> by hand first ( a Script pane, for example), then when I click on my new
> menu item my UI shows up as expected.
>
> I've tried different combinations of code but no luck. If any of you out
> there has a working example (even barebones) that can be shared or can
> point me to where I can find some examples I would be much obliged.
>
> Thanks much
>
> Jim
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to