Hi Justin,

Here is what I have came up with so far. The same problem has applied where 
it will only select the first object in the selection and add it tot he 
QListView. 
I'm not sure if I have came up with the best solution for the searchbox but 
it works just fine, If you have any comments on it that would be great,

import pymel.core as pm
from maya import OpenMayaUI as omui
import shiboken
from PysideCode.scroller.uiCode import scrollerUI
from PySide import QtGui, QtCore
from PySide.QtGui import QWidget

pointer = omui.MQtUtil.mainWindow()
mayaMainWindow = shiboken.wrapInstance(long(pointer), QWidget)

class mainWindow(PySide.QtGui.QMainWindow, scrollerUI.Ui_MainWindow):
    def __init__(self, parent=mayaMainWindow):
        super(mainWindow, self).__init__(parent)
        self.setupUi(self)

        #connections
        self.pushButton.clicked.connect(self.reList)
        self.listView.clicked.connect(self.selectionHandler)
        self.lineEdit.textChanged.connect(self.filterHandler)
        self.statusbar.showMessage('You selected it')

    def reList(self):
        for node in pm.selected():
            self.model.clear()
            item = QtGui.QStandardItem()
            item.setText(str(node))
            self.model.appendRow(item)

    def selectionHandler(self, index):
        index = self.proxy.mapToSource(index)
        item = self.model.itemFromIndex(index)

        pm.select(item.data())

    def filterHandler(self):
        regex = '.*{}.*'.format(self.lineEdit.text().replace(' ', '.*'))
        self.proxy.setFilterRegExp(regex)
        self.proxy.invalidateFilter()



if __name__ == "__main__":

    global win
    try:
        win.close()
        win.deleteLater()
    except:
        pass
    win = mainWindow()
    win.show()

Padraig

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/79edac09-c420-4c51-8505-ed660d885c04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to