Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, do you know how this clickable vector diagram is made? Is it ps or Python?
Solved! Go to Solution.
Hi, do you know how this clickable vector diagram is made? Is it ps or Python?
Solved! Go to Solution.
cmds.window()
cmds.columnLayout()
cmds.iconTextButton(image1 = 'bowlCurveProfile.png')
cmds.showWindow()
Also here is the script I used to find the name of the icon maya uses.
try:
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PySide2 import __version__
from shiboken2 import wrapInstance
except ImportError:
from PySide.QtCore import *
from PySide.QtGui import *
from PySide import __version__
from shiboken import wrapInstance
import maya.cmds as cmds
import maya.mel as mel
import maya.OpenMayaUI as omui
class basic_ui(QWidget):# Create a class that inherits from the QWidget class
def __init__(self, *args, **kwargs):#initialize function
super(basic_ui, self).__init__(*args, **kwargs)
# Create the needed variables
# Get the main window as a widget
omui.MQtUtil.mainWindow()
ptr = omui.MQtUtil.mainWindow()
mainWindow_widget = wrapInstance(long(ptr), QWidget)
self.mainWindow_widget = mainWindow_widget
#Parent widget under Maya main window
self.setParent(mainWindow_widget)
self.setWindowFlags(Qt.Window)
self.setObjectName('iconPrinter')
#Delete the UI if an instance already exists
try:
child_windows = mainWindow_widget.findChildren(QWidget)
for widget in child_windows:
if widget is not self:
if widget.objectName() == self.objectName():
widget.close()
except:
pass
#Set the object name, window title, and window size
self.setWindowTitle('Icon Printer')
self.setGeometry(50, 50, 250, 150)
self.initUI()
def changeEvent(self,event):
pass
def closeEvent(self,event):
pass
def initUI(self):
# Create the main layout
self.window_layout = QVBoxLayout()
self.setLayout(self.window_layout)
self.iconList = QListWidget()
self.window_layout.addWidget(self.iconList)
self.populateIconList()
def populateIconList(self):
for icon in cmds.resourceManager(nameFilter='*') or []:
newItem = QListWidgetItem(icon)
self.iconList.addItem(newItem)
newItem.setIcon(QIcon(":/" + icon))
basic_ui().show()