How to find all existing xpm/png icon names come with maya after 2011 ?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 03 March 2013   #1
How to find all existing xpm/png icon names come with maya after 2011 ?

Hi all, i want to find all the xpm icons bundled with maya. i know that after maya 2011, they decided to use .png icons. and i found parts of icons in maya2011/icons folder, but i can't find all the icons ( pre-2011, the xpm icons are in maya200*/bin/mayaRes.dll )

in 2011 2012 2013, i can't find where cube.xpm is . ( or sphere.xpm etc)
how do i find all the names of these icons ?
( i know that part of the icons previously found in mayaRes.dll now shows in maya201*/icons folder as xpms (linux) or pngs(windows) )

is there a cube.xpm somewhere in a folder or in a dll file ( windows) ? and on linux, where do i find all the names ?

Last edited by oglop : 03 March 2013 at 02:58 AM.
 
Old 03 March 2013   #2
answered my own question ...

cmds.resourceManager(nameFilter="*")

this will return all the available "system" icons.
found this usage in shelf editor, in this file
/maya2012/lib/python2.6/site-packages/maya/app/general/resourceBrowser.py
    


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


maybe the icons are in python resource file,need to investigate more

edit:
now the question is how do i use these icons in my pyqt gui ?
i tried

 		label=QLabel()
 		label.setPixmap(QPixmap('cube.xpm'))
 
 


but it's not working, pyqt wants an absolute path to an image file or a image in resource file.
then what shall i do?
save all the png folders to a folder then use these images ?
by using this?
cmds.resourceManager(saveAs=(resName, path))

Last edited by oglop : 03 March 2013 at 04:33 PM.
 
Old 04 April 2013   #3
This is a month old post, but I'll reply in case someone needs the info.
The trick is to use the prefix ":/" at the begining of an image path, to let Qt load the image file from Maya's Qt resource.

Sample to run from the script editor:

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)
 
Old 04 April 2013   #4
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:22 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.