I am converting tools to PySide for Maya2015, and everything works fine in this specific tool, except for these two lines of code which make Maya implode with a fatal error, not printing anything to console.
self.view.listJoints.selectionModel().currentChanged.connect(self.syncSelection)
self.view.listInfluences.selectionModel().currentChanged.connect(self.syncSelection)
Removing them makes the tool work, but it won’t sync selections so I can’t leave it out. Any ideas why Maya hates these lines?
Here’s the function I’m connecting too:
def syncSelection(self, proxyIdx, proxyPrevId):
proxyModel = proxyIdx.model()
if proxyModel:
sourceIdx = proxyModel.mapToSource(proxyIdx)
sourcePrevIdx = proxyModel.mapToSource(proxyPrevId)
if proxyModel == self._filterInfluenceModel:
newIdx = self._filterJointsModel.mapFromSource(sourceIdx)
sel = QtGui.QItemSelection(newIdx, newIdx)
self.view.listJoints.selectionModel().select(sel, QtGui.QItemSelectionModel.ClearAndSelect)
elif proxyModel == self._filterJointsModel:
newIdx = self._filterInfluenceModel.mapFromSource(sourceIdx)
sel = QtGui.QItemSelection(newIdx, newIdx)
self.view.listInfluences.selectionModel().select(sel, QtGui.QItemSelectionModel.ClearAndSelect)
return