Hi Marcus, Thanks for message !
I kind of got it working with just scanning just the main directory with this code below : It only scans on the 'matLibPath' folder for PNG icons. I am trying to make it scan for subfolders. Anyone have suggestions scanning subfolders with 'listdir' would be greatly appreciated ! Below is the result of the UI ------------------------------------------------- matLibPath = "D:\CCMatlib\Vray" customPathItems = listdir(matLibPath) def popUI(*args): for item in customPathItems: if item.endswith("_icon.png"): cmds.iconTextButton(l = item, p = 'gridLay', i = matLibPath + "/" + item, w = 64, h = 64) ------------------------------------------------------------------------ [image: matlib2.JPG] On Tuesday, 7 May 2019 15:22:55 UTC+9, Marcus Ottosson wrote: > > Hi Chris, and welcome to the mailing list! > > Would assigning the PNG directly to your QPushButton work for you? > > from Qt import QtWidgets, QtGui, QtCore > > button = QtWidgets.QPushButton() > pixmap = QtGui.QPixmap(r"c:\users\manima\Desktop\syrian.png") > button.setIcon(pixmap) > button.setIconSize(QtCore.QSize(100, 100)) > button.show() > > [image: image.png] > > - http://www.ecstudents.net/12springb4/erinvl/pics/syrian.png > > > On Tue, 7 May 2019 at 04:18, Chris C <kuriku...@gmail.com <javascript:>> > wrote: > >> Hi all, >> >> I have started a small project to learn more about python and >> programming. Total beginner but just thought i give it a shot and get help >> from this group. >> >> >> I have created a material library interface just using python within >> maya. Just like the image below. >> >> I am trying to find a way to search for PNG thumbnails specified by the >> material library path and add those PNG files in the Grid Layout separating >> them into categories as listed in the file explorer and also in the >> interface. >> >> >> I have used just a normal button as a test and placeholder for the PNG >> images. >> >> I had a look at many examples and tried but i cannot seem to get it to >> work. If anyone has ideas or can share their knowledge would be a great >> help. >> >> >> >> [image: matLibBrowser.jpg] >> >> >> >> >> -- >> 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 <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/04c2a800-9669-46e3-b7ec-fa575059c5b8%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/04c2a800-9669-46e3-b7ec-fa575059c5b8%40googlegroups.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 python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0d672d98-386e-4288-8d98-307767e92acf%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.