Note that there are some explanatory texts on larger screens.

plurals
  1. POException display to the right of Command Line for PyQt/PySide callbacks/slots in Autodesk Maya
    primarykey
    data
    text
    <p><strong>Updated: to make it much clearer.</strong></p> <p>In the following code snippets, making use of Maya widgets through <code>pymel</code>, there is an error highlight on the right of Command Line.</p> <pre><code>import pymel.core as pm def raiseError(): pm.select("ooxx") # ooxx doesn't exist print "Something after the exception." class pymelWindow(object): def __init__(self): self.mainWin = pm.window("test") with self.mainWin: mainForm = pm.formLayout() with mainForm: btn = pm.button(label='show error',command=pm.Callback(raiseError)) mainForm.redistribute() def show(self): self.mainWin.show() win = pymelWindow() win.show() </code></pre> <p>Here attached is an snapshot of Maya 2011 (the same issue in Maya2014) with an error highlight (<strong>in red</strong>).</p> <p><img src="https://i.stack.imgur.com/FKV2g.jpg" alt="Maya with error highlight to the right of Command Line."></p> <p>and here is the Stack Trace:</p> <pre><code># Error: Maya Node does not exist: u'ooxx' # Traceback (most recent call last): # File "/usr/autodesk/maya2014-x64/lib/python2.7/site-packages/pymel/internal/factories.py", line 778, in callback # res = origCallback( *newargs ) # File "/usr/autodesk/maya2014-x64/lib/python2.7/site-packages/pymel/internal/factories.py", line 701, in __call__ # return self.func(*self.args, **self.kwargs) # File "/dept/rdworks/drake/Desktop/pyqt_issues/testPyQtSpitError.py", line 119, in raiseError # pm.select("ooxx") # File "/usr/autodesk/maya2014-x64/lib/python2.7/site-packages/pymel/core/general.py", line 151, in select # raise TypeError, msg # MayaNodeError: Maya Node does not exist: u'ooxx' # </code></pre> <p>However, when I switch to use PyQt/PySide for widgets with the following code snippets, there is no any visible <em>error highlight to the right of Command Line</em>! Does anyone know how to make PyQt/PySide version have the same GUI behaviours?</p> <pre><code>import pymel.core as pm from PyQt4 import QtGui def raiseError(): pm.select("ooxx") # ooxx doesn't exist print "Something after the exception." class pyQtWindow(QtGui.QMainWindow): def __init__(self, parent = None): # init our ui using the MayaWindow as parent super(pyQtWindow, self).__init__(parent) self.centralWidget = QtGui.QWidget(self) self.setCentralWidget(self.centralWidget) self.centralLayout = QtGui.QVBoxLayout() self.centralWidget.setLayout(self.centralLayout) self.errorBtn = QtGui.QPushButton('show error') self.errorBtn.clicked.connect(raiseError) self.centralLayout.addWidget(self.errorBtn) win = pyQtWindow() win.show() </code></pre> <p><img src="https://i.stack.imgur.com/1YNKl.jpg" alt="Maya without error highlight to the right of Command Line!"></p> <pre><code># Traceback (most recent call last): # File "/usr/autodesk/maya2014-x64/lib/python2.7/site-packages/pymel/internal/factories.py", line 701, in __call__ # return self.func(*self.args, **self.kwargs) # File "/dept/rdworks/drake/Desktop/pyqt_issues/testPyQtSpitError.py", line 119, in raiseError # pm.select("ooxx") # File "/usr/autodesk/maya2014-x64/lib/python2.7/site-packages/pymel/core/general.py", line 151, in select # raise TypeError, msg # pymel.core.general.MayaNodeError: Maya Node does not exist: u'ooxx' </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload