Instead of the busy loop I'd wager you want a call to
PySide.QtCore.QCoreApplication.exec_() after setting everything up. I'd
guess, -t/--tg would both avoid starting the event processing loop and
just give you the machinery to kick off things if you wanted

-Anthony

On Sun, Dec 27, 2015, at 03:35 PM, Frank Rueter|OHUfx wrote:
> >>The trick is to let the session alive
> Haha, I was thinking exactly that but then kinda stopped thinking. I
> needed this to debug stuff in Wing with Nuke's interpreter but am
    now using Hugh's NukeExternalControl scripts instead.
>
> Thanks, frank
>
> On 27/12/15 5:29 pm, Hugo Léveillé
      wrote:
>> After some test, it is working. Cause if I do a terminal
        session without launching a script, I can create a widget and
        show it. But if lauched via a .py file, Nuke think it has
        nothing more to do and end the session.
>>
>> The trick is to let the session alive
>>
>> quick ex:
>>
>> from PySide.QtGui import *
>>
>> class Panel(QWidget):    def __init__(self):        super(Panel,
>> self).__init__()
>>
>>
>>
>>
>> def test():
>>
>> test.panel = Panel()    test.panel.show()    while True:        pass
>>
>> test()
>>
>>
>> ========
>>
>> I'll check for a better way to do that, but at least you know
        its possible.
>>
>>
>>
>>
>>
>> On Sat, Dec 26, 2015, at 22:05, Hugo Léveillé wrote:
>>> But I would definitely like to be proven wrong on this
            one. But last time I asked The Foundry, they told me showing
            a widget from an external IDE was not possible, so that
            could be related.
>>>
>>> Sent from my iPhone
>>>
>>> On Dec 26, 2015, at 10:02 PM, Frank Rueter|OHUfx <fr...@ohufx.com>
            wrote:
>>>> Hm, that would explain things. Oh well, workaround it is.
>>>>
>>>> Cheers, frank
>>>>
>>>> On 27/12/15 3:51 pm, Hugo Léveillé wrote:
>>>>> Hey
>>>>>
>>>>> My understanding of this flag is that it's made to
                use core pyside functions inside a nuke terminal
                session, not UI related. So that a module where you
                import pyside won't fail.
>>>>>
>>>>> I might be completly wrong about this since I never
                used this flag before, but that's my first feeling
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Hugo Léveillé  Head of 2D, MELS hu...@fastmail.net
>>>>>
>>>>>
>>>>>
>>>>> On Sat, Dec 26, 2015, at 19:40, Frank Rueter|OHUfx
                wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I'm trying to get the --tg flag working to run
                  PySide code via command line, but it's not behaving
                  as expected.
>>>>>> Nuke launches but then stops, without showing the
                  widget. I am guessing I am missing the obvious.
>>>>>>
>>>>>> This is what I'm trying
>>>>>> /Applications/Nuke9.0v8/Nuke9.0v8.app/Contents/MacOS/Nuke9.0v8

                  --tg -i /path/to/MyScript.py
>>>>>>
>>>>>> Where MyScript.py instantiates a QWidget and runs
                  the show() method on it.
>>>>>> It never pops up though.
>>>>>>
>>>>>> Any ideas what I'm doing wrong?
>>>>>>
>>>>>> Cheers, frank
>>>>>>
>>>>>>
>>>>>> --
>>>>>> <mime-attachment.png>[1] *vfx


                                compositing[2] | *workflow


                                  customisation and consulting[3]**
>>>>>> <mime-attachment.png>
>>>>>> _________________________________________________
>>>>>> 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
>>>>>> Email had 1 attachment:


>>>>>>  * ohufxLogo_50x50.png  4k (image/png)
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
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
>>>>
>>>> --
>>>> <ohufxLogo_50x50.png>[4] *vfx

                            compositing[5] | *workflow

                              customisation and consulting[6]**
>>>> _______________________________________________
>>>> 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
>>> _________________________________________________
>>> 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
>>
>>
>>
>> _______________________________________________
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
>
> --
> ohufxLogo 50x50 *vfx
                    compositing[7] | *workflow  customisation and
                    consulting[8]**
>
> _________________________________________________
> 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
> Email had 1 attachment:


>  * ohufxLogo_50x50.png  4k (image/png)



Links:

  1. http://www.ohufx.com
  2. http://ohufx.com/index.php/vfx-compositing
  3. http://ohufx.com/index.php/vfx-customising
  4. http://www.ohufx.com
  5. http://ohufx.com/index.php/vfx-compositing
  6. http://ohufx.com/index.php/vfx-customising
  7. http://ohufx.com/index.php/vfx-compositing
  8. http://ohufx.com/index.php/vfx-customising
_______________________________________________
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