from PySide2 import QtCore, QtGui, QtWidgets
class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") Form.resize(299, 457) self.verticalLayout = QtWidgets.QVBoxLayout(Form) self.verticalLayout.setObjectName("verticalLayout") self.searchLine = QtWidgets.QLineEdit(Form) self.searchLine.setText("") self.searchLine.setObjectName("searchLine") self.verticalLayout.addWidget(self.searchLine) self.scrollArea = QtWidgets.QScrollArea(Form) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtWidgets.QWidget() self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 273, 366)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents) self.verticalLayout_2.setObjectName("verticalLayout_2") self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout.addWidget(self.scrollArea) self.createModuleButton = QtWidgets.QPushButton(Form) self.createModuleButton.setObjectName("createModuleButton") self.verticalLayout.addWidget(self.createModuleButton)
self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form): Form.setWindowTitle(QtWidgets.QApplication.translate("Form", "Create Module", None, -1)) self.createModuleButton.setText(QtWidgets.QApplication.translate("Form", "Create Module", None, -1))
class createModule(createModuleUI.Ui_Form, QtWidgets.QDialog):
def __init__(self, parentWin=getMayaWindow()): super(createModule, self).__init__(parentWin) self.setupUi(self) self.setProperty("saveWindowPref", True) self.populateCreateModuleButtons() def populateCreateModuleButtons(self): iconPath = cmds.internalVar(usd=True).rsplit("/", 3)[0] + "/scripts/spDev/rigging/sp_modularRig/sp_UI/icons" icons = [] # to removeWarning. try: icons = sorted(listdir(iconPath)) except: cmds.error("Icons path not found.") for icon in icons: objectName = icon.split("__")[1].split(".")[0] + " Module Button" self.ModuleButton = QtWidgets.QPushButton() self.ModuleButton.setObjectName(objectName) self.verticalLayout_2.addWidget(self.ModuleButton) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem)--
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/fd805401-dfeb-46dc-a4ce-5f119dd95d8d%40googlegroups.com.
if cmds.window(self, exists=True): self.close() cmds.deleteUI(self)To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Thanks a lot for help.That did worked and managed to to apply icons also.i have multiple questions if you can help.1. I want icons left aligned and Text centre aligned. is it possible? (i have attache image for thet)
2. How to check window exists if exist delete it coz every time i run its opening new window.I tried both thing close() and deleteUI both is not working.if cmds.window(self, exists=True):self.close()cmds.deleteUI(self)but if i run whole code through maya script editor it's working fine but if i source this code in maya reload it and run its not working.i am running this in my __init__
3. one situation is i am creating dialog window also.when dialog is open i and i am closing main window dialog is not getting closed.i want when i close main window every sub windows should close too.
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/fd805401-dfeb-46dc-a4ce-5f119dd95d8d%40googlegroups.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/25dfda90-7bfb-4212-a392-2a22241fc32d%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/fd805401-dfeb-46dc-a4ce-5f119dd95d8d%40googlegroups.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_maya+unsub...@googlegroups.com.