It's most likely still executing the knobChanged that triggered the
creation of the second panel.
Depending on what you need to do with that second panel, the easier
way to get around it may be to move what you have in knobChanged onto
the button knob itself.
So, from your example, you would remove the knobChanged method of your
panel, and define your knob button like this:
self._clientsListAdd = nuke.PyScript_Knob("...", "...",
"serverDialog().showModalDialog()")
Hope that helps.
Cheers,
Ivan
On Thu, Aug 11, 2011 at 8:10 AM, Albert Rizov <[email protected]> wrote:
> thanks, but this post did not help me.
>
> this is my code
>
> ---- cut ---
>
> from __future__ import with_statement
> import nuke
> import nukescripts
> from nukescripts import pyAppUtils
> from nukescripts import panels
> import pyui
> import os
> import thread
>
> class _Dialog(nukescripts.PythonPanel):
> def _titleString(self):
> return "Server"
>
> def _addPreKnobs(self):
> return
>
> def addKnob(self, knob):
> """ Add knob and make sure it cannot be animated."""
> knob.setFlag(nuke.NO_ANIMATION | nuke.NO_MULTIVIEW)
> super(_Dialog, self).addKnob(knob)
>
> def __init__(self):
>
> nukescripts.PythonPanel.__init__(self, self._titleString(), "",
> False)
>
> class serverDialog(_Dialog):
> def _titleString(self):
> return "Test dialog"
>
> def __init__(self):
> _Dialog.__init__(self)
>
> self._clientsListAdd = None
> self._clientsListAdd = nuke.PyScript_Knob("...")
> self._clientsListAdd.clearFlag(nuke.STARTLINE)
> self.addKnob(self._clientsListAdd)
>
> def knobChanged(self, knob):
> if (knob==self._clientsListAdd):
> e = serverDialog()
> thread.start_new_thread(e.showModalDialog(), ())
> #e.showModalDialog()
>
> def run(self):
> return
>
> def showServerDialogSelected(self):
>
> groupContext = nuke.root()
>
> e = serverDialog()
> if (e.showModalDialog()==True):
> e.run()
>
> def showServerDialog(self):
> try:
> showServerDialogSelected(nuke.root())
> except ValueError, ve:
> raise RuntimeError("Can't launch Server submit dialog, %s" %
> (ve.args[0]))
>
> showServerDialog(nuke.root())
>
> ---- cut ---
>
> and when I press a button "...", I get a message "I'm already executing
> something else"
> I tried to use threads. And without them, I got the same result.
>
>
>
> take a look at the thread:
> Re: [Nuke-python] running nuke.scriptExit() from a panel
> I fixed a similar issue with those tips. many thanks for them!
> jrab
>
>
> On Aug 10, 2011, at 10:30, Albert Rizov <[email protected]> wrote:
>
> Nobody don't know?
>
>
> Hi, All
>
> I try to open a child modal dialog box
>
> class serverDialog(Dialog):
>
> ....
>
> def knobChanged(self, knob):
>
> ...
>
> if (knob==self._clientsListAdd):
>
> r = RenderNodesDialog(_gserverNodesDialogState, nuke.root())
>
> if (r.showModalDialog()==True):
>
> return
>
> def showserverDialogSelected(nodes):
>
> groupContext = nuke.root()
>
> e = serverDialog(_gserverDialogState, groupContext, nodes)
>
> if (e.showModalDialog()==True):
>
> e.run()
>
>
> but when I press "Ok" or "Cancel" button in a child window I have an message
> "I'm already executing something else"
>
> are there any ideas what I'm doing wrong ?
>
> Thanks
>
> _______________________________________________
>
> 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
>
>
> _______________________________________________
> 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
>
>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python