[Maya-Python] Finding icons under XBMLANGPATHs

886 views
Skip to first unread message

Risto Jankkila

unread,
May 16, 2014, 3:56:06 AM5/16/14
to python_in...@googlegroups.com
Hi,

I need to create Maya shelves under a Qt-window/layout. I chose QListWidget in icon mode, since it fits my needs quite nicely.

To display the icons, I need the pixmap files. The problem is that for some icons, the pixmap files can't be found under any of the paths in XBMLANGPATHs.

For example the first button on 'General'-shelf has a pixmap called 'LearningMovies.png', but I can't find this file anywhere on my hard drive. Is there something really obvious that I'm missing here?

Cheers,
Risto

sebastien...@gmail.com

unread,
Jan 27, 2016, 2:17:24 PM1/27/16
to Python Programming for Autodesk Maya
I found the solution with some googling :

basically some of maya icons are compiled in ressources files,
so you won't be able to find the source files directly,
but you can extract them / use them with those functions

Hope it helps,
S

from PySide import QtGui, QtCore
test = QtGui.QWidget()
layout = QtGui.QHBoxLayout()
test.setLayout(layout)
test.show()

icon = QtGui.QIcon(":/cube.png")
button = QtGui.QToolButton()
button.setFixedSize(24,24)
button.setIcon(icon)
button.setIconSize(QtCore.QSize(20,20))

layout.addWidget(button)

How to know which bitmaps are available in Maya? Launch the Resource Browser
with this code

import maya.app.general.resourceBrowser as resourceBrowser
resBrowser = resourceBrowser.resourceBrowser()
path = resBrowser.run()

Carlos Rico

unread,
Jan 27, 2016, 3:35:10 PM1/27/16
to python_in...@googlegroups.com
Hi, maybe this little script I made can be of some help. At least to know the file name of the icons available in Maya.

http://www.creativecrash.com/maya/script/maya-icons

Carlos Rico Adega
-------------------------------------
LinkedIn
carlos....@gmail.com

--
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/31317721-2c06-433a-8620-58e60c74a544%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages