示例#1
0
def submitRenderUI():
    stf_window = qtBase.BaseWindow(qtBase.GetMayaWindow(),'submitToFarm.ui')
    stf_window._windowTitle = 'Submit to Farm'
    stf_window._windowName = 'SubmitToFarm'
    stf_window.pathModify = 'pipelime/'
    stf_window.BuildUI()
    stf_window.show(dockable=True)
    #hide config panel 
    stf_window.mainWidget.configPanel.setVisible(False)
    #connect buttons
    stf_window.mainWidget.submitButton.clicked.connect(submitButton)
    stf_window.mainWidget.pushButton_globals.clicked.connect(globalDict)
    stf_window.mainWidget.pushButton_project.clicked.connect(projectDict)
    stf_window.mainWidget.pushButton_user.clicked.connect(localDict)
    stf_window.mainWidget.pushButton_render.clicked.connect(selectRenderExe)
    stf_window.mainWidget.pushButton_submitExe.clicked.connect(selectSubmitExe)
    #icon on button
    try:
        buttonIcon = QtGui.QIcon("%s/icons/%s.png"%(qtBase.self_path(), "gear"))
        stf_window.mainWidget.pushButton_settings.setIcon(buttonIcon)
    except:
        pass
    #merge all dictionaries into one
    comboDict = {}
    comboDict = mergeDictionaries(comboDict,IO.loadDictionary('%s/config/globalPrefs.json'%qtBase.self_path()))
    comboDict = mergeDictionaries(comboDict,IO.loadDictionary('%s/data/projectPrefs.json'%getProj.getProject()))
    comboDict = mergeDictionaries(comboDict,IO.loadDictionary('%s/localPrefs.json'%qtBase.local_path()))
    rangeFromTimeline =  '%s-%s'%(sceneVar.getStartFrame(),sceneVar.getEndFrame())
    comboDict = mergeDictionaries(comboDict,{"lineEdit_range": {"value":rangeFromTimeline}})
    versionlessSceneName = ''.join([c for c in getProj.sceneName() if c not in "1234567890"])
    comboDict = mergeDictionaries(comboDict,IO.loadDictionary('%s/.data/%s.json'%(getProj.sceneFolder(),versionlessSceneName)))

    setOptions(comboDict,stf_window)
    return stf_window
示例#2
0
def assetManagerUI():
    window = qtBase.BaseWindow(qtBase.GetMayaWindow(), 'lm_assetManager.ui')
    window._windowTitle = 'Asset Manager'
    window._windowName = 'assetManager'
    window.pathModify = 'pipelime/'
    window.BuildUI()
    window.show(dockable=True)

    projectsDict = IO.loadDictionary('%s/projects.json' % qtBase.local_path())

    projectLines = []
    for key in projectsDict:
        try:
            projectLines.append(key)
        except:
            pass

    window.mainWidget.project_comboBox.addItems(projectLines)
    window.mainWidget.project_comboBox.currentTextChanged.connect(setProject)

    window.mainWidget.listWidget_assetType.currentTextChanged.connect(setType)

    #add project button
    window.mainWidget.pushButton_addProject.clicked.connect(selectFolder)
    #remove project button
    window.mainWidget.pushButton_removeProject.clicked.connect(removeProject)
    #change asset selection
    window.mainWidget.listWidget_assets.currentTextChanged.connect(setAsset)
    window.mainWidget.listWidget_assets.doubleClicked.connect(doubleClicked)
    #window.mainWidget.listWidget_assets.itemSelectionChanged.connect(listChanged)
    #reference button
    window.mainWidget.pushButton_reference.clicked.connect(
        lambda: referenceAsset(
            window.mainWidget.listWidget_assets.selectedItems(), 0))
    #import button
    window.mainWidget.pushButton_import.clicked.connect(lambda: referenceAsset(
        window.mainWidget.listWidget_assets.selectedItems(), 1))
    #new button
    window.mainWidget.pushButton_new.clicked.connect(newAsset)
    #edit button
    window.mainWidget.pushButton_edit.clicked.connect(lambda: editAsset(
        window.mainWidget.listWidget_assets.currentItem().text()))
    #thumbnail button
    window.mainWidget.pushButton_thumb.clicked.connect(lambda: takeScreenshot(
        window.mainWidget.listWidget_assets.currentItem().text()))
    #save button
    window.mainWidget.pushButton_save.clicked.connect(saveSceneFile)
    #increment button
    window.mainWidget.pushButton_increment.clicked.connect(incrementSceneFile)
    #publish button
    window.mainWidget.pushButton_publish.clicked.connect(publishModel)

    #set project in menu

    return window
示例#3
0
def prefConfigUI():
    window = qtBase.BaseWindow(qtBase.GetMayaWindow(), 'lm_projectConfig.ui')
    window._windowTitle = 'Configure Project'
    window._windowName = 'configureProject'
    window.pathModify = 'pipelime/'
    window.BuildUI()
    window.show(dockable=True)
    #connect buttons
    window.mainWidget.pushButton_accept.clicked.connect(submitButton)

    #merge all dictionaries into one
    comboDict = {
        "userName": {
            "value": ""
        },
        "userInitials": {
            "value": ""
        },
        "userSlackID": {
            "value": "@"
        }
    }
    #comboDict = mergeDictionaries(comboDict,IO.loadDictionary('C:/Users/Admin/Documents/Toolbox/config/globalPrefs.json'))
    comboDict = mergeDictionaries(
        comboDict,
        IO.loadDictionary('%s/localPrefs.json' % qtBase.local_path()))
    projectDict = IO.loadDictionary('%s/../.projectData/projectPrefs.json' %
                                    getProj.getProject())
    print projectDict

    projectLines = []
    for key in projectDict:
        try:
            projectLines.append([key, projectDict[key]["value"]])
        except:
            pass

    lines = []
    for key in comboDict:
        try:
            lines.append([key, comboDict[key]["value"]])
        except:
            pass
    #layers = sceneVar.getRenderLayers()
    global prefWidget
    prefWidget = LayerWidget(lines, window.mainWidget.verticalLayout_user)
    global projectPrefsWidget
    prefWidget = LayerWidget(projectLines,
                             window.mainWidget.verticalLayout_project)
    global globalPrefsWidget
    prefWidget = LayerWidget(lines, window.mainWidget.verticalLayout_global)
    return window
示例#4
0
def createCTRL_ui():
    window = qtBase.BaseWindow(qtBase.GetMayaWindow(),'createCtrl.ui')
    window._windowTitle = 'Create CTRL Window'
    window._windowName = 'createCtrlWindow'
    window.pathModify = 'ramenRig/'
    window.BuildUI()
    #layout for color slider
    qtLayout = window.mainWidget.ctrlColorLayout
    paneLayoutName = cmds.columnLayout()
    # Create slider widget
    csg = cmds.colorSliderGrp('ctrlColour',hsvValue=randomColor(),cc='ramenRig.createCtrlUi.setRampCol()')
    rgbColour = cmds.colorSliderGrp('ctrlColour',q=True,rgbValue=True)
    cmds.optionVar(stringValue=['falloffCurveOptionVar', '1,1,1'])
    cmds.optionVar(stringValueAppend=['falloffCurveOptionVar', '1,0,1'])
    cmds.gradientControlNoAttr( 'falloffCurve', h=70,w=250,rac=True)
    cmds.gradientControlNoAttr( 'falloffCurve', e=True, optionVar='falloffCurveOptionVar',clv=rgbColour )
    cmds.gradientControlNoAttr( 'falloffCurve', e=True,currentKey=1,clv=rgbColour,cc='ramenRig.createCtrlUi.setColour()' )

    # Find a pointer to the paneLayout that we just created using Maya API
    ptr = mui.MQtUtil.findControl(paneLayoutName)
    # Wrap the pointer into a python QObject. Note that with PyQt QObject is needed. In Shiboken we use QWidget.
    paneLayoutQt = shiboken2.wrapInstance(long(ptr), QtWidgets.QWidget)
    # Now that we have a QtWidget, we add it to our Qt layout
    qtLayout.addWidget(paneLayoutQt)

    window.show(dockable=False)

    #connect buttons
    window.mainWidget.btn_circle.clicked.connect(lambda: createBtn('circle'))
    window.mainWidget.btn_square.clicked.connect(lambda: createBtn('square'))
    window.mainWidget.btn_star.clicked.connect(lambda: createBtn('star'))
    window.mainWidget.btn_diamond.clicked.connect(lambda: createBtn('diamond'))
    window.mainWidget.btn_plus.clicked.connect(lambda: createBtn('plus'))
    window.mainWidget.btn_cross.clicked.connect(lambda: createBtn('cross'))
    window.mainWidget.btn_arch.clicked.connect(lambda: createBtn('arch'))
    window.mainWidget.btn_pin.clicked.connect(lambda: createBtn('pin'))
    window.mainWidget.btn_arrow.clicked.connect(lambda: createBtn('arrow'))
    window.mainWidget.btn_doubleArrow.clicked.connect(lambda: createBtn('doubleArrow'))
    window.mainWidget.horizontalSlider_2.sliderMoved.connect(sizeSlider)
    window.mainWidget.doubleSpinBox.valueChanged.connect(sizeSpinbox)

    return window
示例#5
0
def lm_projectWindow():
    window = qtBase.BaseWindow(qtBase.GetMayaWindow(),'lm_projectWindow.ui')
    window._windowTitle = 'Create New Project'
    window._windowName = 'createNewProject'
    #self.uiFilePath = 'C:/Users/Admin/Documents/Toolbox'
    window.pathModify = 'pipelime/'
    window.BuildUI()
    window.show(dockable=True)
    #connect buttons
    window.mainWidget.variant_pushButton.clicked.connect(addButton)
    window.mainWidget.create_pushButton.clicked.connect(createButton)

    folderStructureDict = loadSave.loadDictionary('%s/pipelime/lm_folderStructure.json'%qtBase.self_path())
    rootFolders = folderStructureDict["root"]
    window.mainWidget.comboBox_root.clear()
    window.mainWidget.comboBox_root.addItems(rootFolders)

    resolutions = folderStructureDict["settings"]["resolution"]
    window.mainWidget.comboBox_resolution.clear()
    window.mainWidget.comboBox_resolution.addItems(resolutions.keys())

    window.mainWidget.comboBox_resolution.currentTextChanged.connect(resolutionChange)

    return window