def __init__(self, dock=True): if dock: parent = getDock() else: deleteDock() try: cmds.deleteUI('LightingManager') except: logger.debug('No previous UI exists') parent = QtWidgets.QDialog(parent=getMayaMainWindow()) parent.setObjectName('LightingManager') parent.setWindowTitle('Lighting Manager') dlgLayout = QtWidgets.QVBoxLayout(parent) super(toolBoxIII, self).__init__(parent=parent) self.setWindowTitle('Lighting Manager') self.buildUI() self.populate() self.parent().layout().addWidget(self) if not dock: parent.show() self.userAppDir = cmds.internalVar(userAppDir=True) self.userLibaryDir = self.userAppDir + 'userLibrary' if not os.path.exists(self.userLibaryDir): os.mkdir(self.userLibaryDir)
def __init__(self, dock=True): if dock: parent = getDock() else: deleteDock() try: cmds.deleteUI('Pipeline Tool') except: logger.debug('No previous UI exists') parent = QtWidgets.QDialog(parent=getMayaMainWindow()) parent.setObjectName('Pipeline Tool') parent.setWindowTitle('Pipeline Tool') dialogLayout = QtWidgets.QVBoxLayout(parent) super ( MayaMainUI, self ).__init__( parent=parent ) self.curMode = self.getMode() logger.info('get mode: %s' % self.curMode.upper()) self.buildUI() if not dock: parent.show()
def buildUI(self): layout = QtWidgets.QGridLayout(self) layout.setContentsMargins(5,5,5,5) # Create a label to note for Maya light mayaLightLabel = QtWidgets.QLabel('Maya Lights') mayaLightLabel.setAlignment(QtCore.Qt.AlignCenter) layout.addWidget(mayaLightLabel, 0,0,1,6) # Create a label to note for Vray light vrayLightLabel = QtWidgets.QLabel('Vray Lights') vrayLightLabel.setAlignment(QtCore.Qt.AlignCenter) layout.addWidget(vrayLightLabel, 0,6,1,8) # Create a combo box that has the list of Maya light type self.mayaLightTypeCB = QtWidgets.QComboBox() # Put lightType into combo Box (Maya lights) for lightType in sorted(self.mayaLightTypes): self.mayaLightTypeCB.addItem(lightType) layout.addWidget(self.mayaLightTypeCB, 1,0,1,4) # Create a button to create the light base on the selection of the combo box createMayaLightBtn = QtWidgets.QPushButton('Create') createMayaLightBtn.clicked.connect(partial(self.createLight, 'Maya Light')) layout.addWidget(createMayaLightBtn, 1,4,1,2) # Create a combo box that has the list of Vray light type self.vrayLightTypeCB = QtWidgets.QComboBox() # Put lightType into combo Box (Maya lights) for lightType in sorted(self.vrayLightTypes): self.vrayLightTypeCB.addItem(lightType) layout.addWidget(self.vrayLightTypeCB, 1,6,1,6) # Create a button to create the light base on the selection of the combo box createVrayLightBtn = QtWidgets.QPushButton('Create') createVrayLightBtn.clicked.connect(partial(self.createLight, 'Vray Light')) layout.addWidget(createVrayLightBtn, 1,12,1,2) # Create Scroll layout to add the light created from buttons above into main layout via LightWidget class scrollWidget = QtWidgets.QWidget() scrollWidget.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) self.scrollLayout = QtWidgets.QVBoxLayout(scrollWidget) scrollArea = QtWidgets.QScrollArea() scrollArea.setWidgetResizable(True) scrollArea.setWidget(scrollWidget) layout.addWidget(scrollArea, 2,0,1,14)
def __init__(self, dock=True): if dock: parent = getDock(name='Channel Box', label='Channel Box') else: deleteDock() try: cmds.deleteUI('Channel Box') except: logger.debug('No previous UI exists') parent = QtWidgets.QDialog(parent=getMayaMainWindow()) parent.setObjectName('Channel Box') parent.setWindowTItle('Channel Box') dialogLayout = QtWidgets.QVBoxLayout(parent) super(ChannelBox, self).__init__(parent=parent) self.buildUI() if not dock: parent.show()
def buildUI(self): self.layout = QtWidgets.QGridLayout(self) pluginLights = typeMgr.pluginLights() self.mayaLights = sorted(typeMgr.mayaLights()) self.vrayLights = sorted( [f for f in pluginLights if f.startswith("VRay")]) self.renderManLights = sorted( [f for f in pluginLights if f.startswith("Pxr")]) self.arnoldLights = sorted( [f for f in pluginLights if f.startswith("ai")]) iconBtnWidget = QtWidgets.QWidget() self.iconBtnLayout = QtWidgets.QHBoxLayout(iconBtnWidget) self.layout.addWidget(iconBtnWidget, 0, 0) self.iconBtnLayout.addWidget(QtWidgets.QLabel("Maya_tk: ")) # self.mayaLightTB = QtWidgets.QToolBar('Maya_tk Light') self.getMayaLight() self.getVrayLight() self.getRenderManLight() #self.getArnoldLight() self.lightLibraryUI() scrollWidget = QtWidgets.QWidget() scrollWidget.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) self.scrollLayout = QtWidgets.QVBoxLayout(scrollWidget) scrollArea = QtWidgets.QScrollArea() scrollArea.setWidgetResizable(True) scrollArea.setWidget(scrollWidget) self.layout.addWidget(scrollArea, 1, 0, 1, 5)