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.

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()

--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/04c2a800-9669-46e3-b7ec-fa575059c5b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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()
On Tue, 7 May 2019 at 04:18, Chris C <kuriku...@gmail.com> 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.
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+unsub...@googlegroups.com.