Hi Jim,

I forgot to mention that trigger functions to show panels should return the
panel itself.

( code file is attached in mail )


# in menu.py

import searchReplacePanel


# First create a static instance of your panel
SRPanel = searchReplacePanel.SearchReplacePanel()


# This is the register function
def registerSRPanel():
 global SRPanel
 return SRPanel


# This is the show panel function, to be used from any menu but Pane ( if
the Panel is showed already this will have no effect )

def floatSRPanel():
 global SRPanel
SRPanel.show()
 return SRPanel


# This is the addToPane function, to be called from "Pane" menu

def dockedSRPanel():
 global SRPanel
SRPanel.addToPane()
 return SRPanel


# Add it to the Render Menu
menubar = nuke.menu('Nuke');
m = menubar.addMenu("&Render")
m.addCommand("-", "", "")
m.addCommand('Search and Replace', *floatSRPanel* )  # show a floating Panel

# Add it to the pane menu
paneMenu = nuke.menu('Pane')
paneMenu.addCommand('SearchReplace', *dockedSRPanel* ) # show a docked Panel


nukescripts.registerPanel('com.ohufx.SearchReplace', *registerSRPanel* )  #
Register the Panel for layout restore


Hope this fix your problems.

J




El 14 de diciembre de 2011 23:57, Jim Berndt <
[email protected]> escribió:

> **
> Hi Javier. Thank you for replying. I still have some trouble with the
> panes.
>
> To illustrate my problem I will reference a piece of code from the
> foundry's online docs (
> http://docs.thefoundry.co.uk/nuke/63/pythondevguide/custom_panels.html#pythonpanel-ref-label
> ).
>
> I have a custom menu.py file that is attached, and the actual function
> (also attached).
>
> As you can see, if the function is invoked from the pane menu, it works.
> If the function is thereafter invoked from the "Render" menu, it also
> works. The function on the other hand, will not work if first invoked from
> the Render menu, and this is what I am trying to troubleshoot.
>
> For your help I am grateful.
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>

Attachment: _menu.py
Description: Binary data

_______________________________________________
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