Yes, I see this behavior in both Windows 10 and macOS (Sierra) when using Maya 2017.
So what's new here in Maya 2017 is the UI completely freezes - when compared to Maya 2016 where it is completely functional although it casts an error in the script editor. This behavior is also the same when running this PySide2 code in the terminal on macOS. But if you're using PyQt5, the UI completely crashes and disappears instantly. Hm. On Thu, Sep 29, 2016 at 10:16 AM Marcus Ottosson <[email protected]> wrote: > I can confirm this on Windows, or at least some odd behavior. > > from PySide2 import QtWidgets > def on_pressed(): > priknt("world") > > button = QtWidgets.QPushButton("Hello") > button.pressed.connect(on_pressed) > button.show() > > For me, when pressing the button, the window with the button in it stalls > and doesn’t do or say anything. The GUI is still responsive and works fine. > > When I run: > > button.close() > > The expected exception appears. > > # Error: NameError: file <maya console> line 4: global name 'priknt' is not > defined # > > But the GUI remains. > > The next time I call close(), the GUI closes, and all is well. > > This is with a fresh copy of Maya 2017 on Windows 10, all settings default. > > > On 29 September 2016 at 09:01, Fredrik Averpil <[email protected]> > wrote: > > Not sure if it's just me or if this is a thing. > > So, I've noticed that with e.g. Maya 2015 (Qt4) and PySide, when my UI > hits an error and I get the Traceback in the script editor the UI doesn't > crash/disappear. It's still fully functional in Maya as well as when I run > the UI in the cmd/terminal (standalone). > > However, with Maya 2017 (Qt5) and PySide2, the application still prints > the traceback in the script editor but then simply crashes. > If I run the UI in cmd/terminal (standalone) instead, the UI disappears as > well. > > The error can be e.g. that when I click a pushButton it calls a function > which prints "hello". But in this case let's say the function was > misspelled so when I click the button a non-existing function is called. > > Is this something you guys have observed as well -- or could it be > something specific to my code? > > Cheers, > Fredrik > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%2BVRJnB4Hpg%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM_m%3DrmaUaU%3D4gka1C4q0oH43cqROUgqqV4%2BVRJnB4Hpg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > > > -- > *Marcus Ottosson* > [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODypNPvuVxOjMFg1QFNtKsHgBubdz3d_WX9RhFn3SNb-Q%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODypNPvuVxOjMFg1QFNtKsHgBubdz3d_WX9RhFn3SNb-Q%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWOXC3umyEFe1uU%3D02Kpe-Fc-1GEBaFSW2CA-%3Dic_N_-gQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
