当前位置: 首页>>代码示例>>Python>>正文


Python cmds.loadUI函数代码示例

本文整理汇总了Python中maya.cmds.loadUI函数的典型用法代码示例。如果您正苦于以下问题:Python loadUI函数的具体用法?Python loadUI怎么用?Python loadUI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了loadUI函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: SundayControllerToolUI

def SundayControllerToolUI():
    global sundayControllerToolUI
    SundayMayaGuiPath = mel.eval('getenv SundayGui;')
    
    try:
        if cmds.window(sundayControllerToolUI, exists = True):
            cmds.deleteUI(sundayControllerToolUI)
        
        sundayControllerToolUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayControllerTool.ui')
    except:
        sundayControllerToolUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayControllerTool.ui')

    cmds.setParent(sundayControllerToolUI)
    cmds.setParent(cmds.button('SundayControllerToolChooseColorDummyButtonToGrabParent', query = True, fullPathName = True, parent = True))
    cmds.iconTextRadioCollection('ltColorCollection')
    cmds.rowColumnLayout(numberOfColumns = 8)
    cmds.text(label = 'Color : ')
    cmds.iconTextRadioButton('DarkBlue_5', image1 = SundayImage + 'SundayColorDarkBlue.png', height = 20, width = 20, select = True)
    cmds.iconTextRadioButton('DarkRed_4', image1 = SundayImage + 'SundayColorDarkRed.png', height = 20, width = 20)
    cmds.iconTextRadioButton('Purple_9', image1 = SundayImage + 'SundayColorPurple.png', height = 20, width = 20)
    cmds.iconTextRadioButton('Red_13', image1 = SundayImage + 'SundayColorRed.png', height = 20, width = 20)
    cmds.iconTextRadioButton('Green_14', image1 = SundayImage + 'SundayColorGreen.png', height = 20, width = 20)
    cmds.iconTextRadioButton('LightBlue_18', image1 = SundayImage + 'SundayColorLightBlue.png', height = 20, width = 20)
    cmds.iconTextRadioButton('Yellow_17', image1 = SundayImage + 'SundayColorYellow.png', height = 20, width = 20)
    cmds.setParent(sundayControllerToolUI)
    cmds.setParent(cmds.button('SundayControllerToolDummyButtonToGrabParent', query = True, fullPathName = True, parent = True))
    cmds.scrollLayout(childResizable = True)
    cmds.rowColumnLayout(numberOfColumns = 8)
    SundayLocatorToolPy.SundayLocatorToolMakeLocatorButtonsInWidget('SundayControllerToolPy\nreload(SundayControllerToolPy)\nSundayControllerToolPy.SundayControllerToolApply')
    cmds.showWindow(sundayControllerToolUI)
    if platform.system() == 'Windows':
        cmds.window(sundayControllerToolUI, edit = True, topLeftCorner = [
            100,
            100])
开发者ID:elliottjames,项目名称:jeeves,代码行数:34,代码来源:SundayControllerToolPy.py

示例2: SundayGeometryCacheImportUI

def SundayGeometryCacheImportUI():
    global sundayGeometryCacheImportUI
    print 'SundayGeometryCacheImport'
    exportDir = cmds.workspace(q = True, rootDirectory = True) + 'data'
    cacheDir = os.listdir(exportDir)
    SundayMayaGuiPath = mel.eval('getenv SundayGui;')
    
    try:
        if cmds.window(sundayGeometryCacheImportUI, exists = True):
            cmds.deleteUI(sundayGeometryCacheImportUI)
        
        sundayGeometryCacheImportUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayGeometryCacheImport.ui')
    except:
        sundayGeometryCacheImportUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayGeometryCacheImport.ui')

    cmds.text('SundayGeometryCachePath', edit = True, label = exportDir)
    cmds.setParent(sundayGeometryCacheImportUI)
    cmds.setParent(cmds.button('SundayGeometryImportDummyButtonToGrabParent', query = True, fullPathName = True, parent = True))
    scrollLayout = cmds.scrollLayout(childResizable = True)
    for curCacheDir in cacheDir:
        if curCacheDir.split('.')[0] != '':
            cmds.rowLayout(numberOfColumns = 2, adjustableColumn = 1)
            cmds.button(height = 26, label = curCacheDir, command = 'import SundayGeometryCachePy\nreload(SundayGeometryCachePy)\nSundayGeometryCachePy.SundayGeometryCacheImportFile("' + exportDir + os.sep + curCacheDir + '")')
            cmds.button(height = 26, label = 'Delete', command = 'import SundayGeometryCachePy\nreload(SundayGeometryCachePy)\nSundayGeometryCachePy.SundayGeometryCacheDelete("' + exportDir + os.sep + curCacheDir + '")')
            cmds.setParent('..')
            continue
    
    cmds.setParent(sundayGeometryCacheImportUI)
    cmds.setParent(cmds.button('SundayGeometryImportDummyButtonToGrabParent', query = True, fullPathName = True, parent = True))
    cmds.text('sundayGeoCacheNodeLabel', edit = True, label = len(cmds.ls(type = 'cacheFile', long = True)))
    cmds.showWindow(sundayGeometryCacheImportUI)
    if platform.system() == 'Windows':
        cmds.window(sundayGeometryCacheImportUI, edit = True, topLeftCorner = [
            100,
            100])
开发者ID:elliottjames,项目名称:jeeves,代码行数:35,代码来源:SundayGeometryCachePy.py

示例3: SundayPlusSaveOptionsUI

def SundayPlusSaveOptionsUI():
    global plusSaveDialogUI
    if len(os.path.splitext(cmds.file(query = True, sceneName = True, shortName = True))[0].split('_')) > 2:
        SundayMayaGuiPath = mel.eval('getenv SundayGui;')
        
        try:
            if cmds.window(plusSaveDialogUI, exists = True):
                cmds.deleteUI(plusSaveDialogUI)
            
            plusSaveDialogUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayPlusSaveOption.ui')
        except:
            plusSaveDialogUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayPlusSaveOption.ui')

        cmds.textField('plusSaveAuthorLineEdit', edit = True, text = cmds.optionVar(query = 'SundayUserName'))
        cmds.textField('plusSaveNewSceneLineEdit', edit = True, text = os.path.splitext(cmds.file(query = True, sceneName = True, shortName = True))[0].split('_')[0])
        cmds.textField('plusSaveFileVersionLineEdit', edit = True, text = int(os.path.splitext(cmds.file(query = True, sceneName = True, shortName = True))[0].split('_')[1]) + 1)
        curNameSplit = os.path.splitext(cmds.file(query = True, sceneName = True, shortName = True))[0].split('_')
        curCaption = ''
        for i in range(3, len(curNameSplit)):
            curCaption = curCaption + '_' + curNameSplit[i]
        
        cmds.textField('plusSaveNewCaptionLineEdit', edit = True, text = curCaption[1:])
        cmds.textField('plusSaveHistoryCaptionLineEdit', edit = True, text = curCaption[1:])
        cmds.optionMenu('plusSaveNewCaptionComboBox', edit = True, changeCommand = 'SundayPlusSavePy.SundayPlusSaveChangeNewCaption()')
        cmds.optionMenu('plusSaveHistoryCaptionComboBox', edit = True, changeCommand = 'SundayPlusSavePy.SundayPlusSaveChangeHistoryCaption()')
        cmds.showWindow(plusSaveDialogUI)
        if platform.system() == 'Windows':
            cmds.window(plusSaveDialogUI, edit = True, topLeftCorner = [
                100,
                100])
        
    else:
        SundayPlusSaveWrongFileConvention()
开发者ID:elliottjames,项目名称:jeeves,代码行数:33,代码来源:SundayPlusSavePy.py

示例4: creat_cam

	def creat_cam():
		cmds.loadUI('') #创建UI 尝试pyQT?
		scenesCameras=cmds.ls(cameras=1) #获取场景摄像机 隐藏默认摄像机?
		# 修改UI列表 显示cam
		if cmds.objExists('bakeCAM')!=1:
			cameraName=cmds.camera()
			cameraShape=cameraName[1]
			cmds.rename('cameraShape', 'bakeCAM')
			pass
开发者ID:wildparky,项目名称:spielenPipeline,代码行数:9,代码来源:Render.py

示例5: build

 def build(self):
     if mc.window(self.ui, ex=1):
         mc.deleteUI(self.ui)
     self.ui = mc.loadUI(uiFile=self.uiFile)
     mc.button( 'pickFK', e=1, c=self.FKButton )
     mc.button( 'pickIK', e=1, c=self.IKButton )
     mc.button('switch_2', e=1, c='')
开发者ID:chuckbruno,项目名称:Python_scripts,代码行数:7,代码来源:IKFKSwich.py

示例6: loadUsingCmdsAndReturnInfoDict

    def loadUsingCmdsAndReturnInfoDict(self, uiFile):
        
        ## Remember where stuff was printing before
        seFile = 'c:/users/joe/mmmmScriptEditorHistory.txt'
        
        oldStatusOfHistoryFilename = cmds.scriptEditorInfo( query=True, historyFilename=True )
        oldStatusOfWriteHistory = cmds.scriptEditorInfo( query=True, writeHistory=True )

        ## Redirect printing        
        cmds.scriptEditorInfo( historyFilename=seFile )
        cmds.scriptEditorInfo( writeHistory=1 )
        
        cmds.scriptEditorInfo(clearHistoryFile=True)
        design = cmds.loadUI( uiFile=uiFile, v=True )
        
        ## Restore remembered old print location
        cmds.scriptEditorInfo( historyFilename=oldStatusOfHistoryFilename )
        cmds.scriptEditorInfo( writeHistory=oldStatusOfWriteHistory )
        
        fh = open(seFile,'r')
        printed = fh.read()
        fh.close()
        uiElements = self.splitUiPrintout( printed )

        result = { 'design':design, 'elements':uiElements }
            
        return result
开发者ID:joetainment,项目名称:mmmmtools,代码行数:27,代码来源:DesignFileLoader.py

示例7: create

 def create(self):
     if cmds.window(self.window, exists=True):
         cmds.deleteUI(self.window);
     self.window = cmds.loadUI(uiFile=self.uiFile, verbose=False)
     
     cmds.showWindow(self.window);
     try:
         initPos = cmds.windowPref( self.window, query=True, topLeftCorner=True )
         if initPos[0] < 0:
             initPos[0] = 0
         if initPos[1] < 0:
             initPos[1] = 0
         cmds.windowPref( self.window, edit=True, topLeftCorner=initPos )
     except :
         pass
     
     ctrlPath = '|'.join([self.window, 'radioButton']);
     cmds.radioButton(ctrlPath, edit=True, select=True);
     
     ctrlPath = '|'.join([self.window, 'groupBox_4']);
     cmds.control(ctrlPath, edit=True, enable=False);
     
     ctrlPath = '|'.join([self.window, 'groupBox_2', 'pushButton_7']);
     cmds.button(ctrlPath, edit=True, enable=False);
     
     ctrlPath = '|'.join([self.window, 'groupBox_2', 'lineEdit']);
     cmds.textField(ctrlPath, edit=True, text="-u --oiio");
开发者ID:Quazo,项目名称:breakingpoint,代码行数:27,代码来源:txManager.py

示例8: vrayReUI

def vrayReUI():
	if cmds.dockControl('vrayRendElem', exists=True):
		cmds.deleteUI('vrayRendElem', ctl=True)
	awVrayRETools = cmds.loadUI (f = 'Q:/Tools/maya/2012/scripts/python/UI/awRenderElem.ui')
	awVrayREPane = cmds.paneLayout (cn = 'single', parent = awVrayRETools)
	awVrayDock = cmds.dockControl ( 'vrayRendElem',allowedArea = ("right","left"), area = "right", floating = False ,con = awVrayRETools, label = 'Render Element tools')
	vrayUpdateUI()
开发者ID:ghost3d,项目名称:MayaTools,代码行数:7,代码来源:awVrayRenderElementHelper.py

示例9: loadUI

    def loadUI(self, ui_file):
        """
        Loads the UI and does an post-load commands
        """

        # monkey patch the cmds module for use when the UI gets loaded
        cmds.submit_callb = partial(self.get_initial_value, self)
        cmds.do_submit_callb = partial(self.submit, self)

        if cmds.window('SubmitDialog', q=True, ex=True):
            cmds.deleteUI('SubmitDialog')
        name = cmds.loadUI(f=ui_file)

        cmds.textScrollList('layers', e=True, append=self.layers)

        # check for existing projects to determine how project selection should
        # be displayed
        num_existing_projs = cmds.optionMenu('existing_project_name', q=True, ni=True)
        if num_existing_projs == 0:
            cmds.radioButton('existing_project', e=True, en=False)
        else:
            cmds.radioButton('existing_project', e=True, en=True)

        # callbacks
        cmds.checkBox('upload_only', e=True, changeCommand=self.upload_only_toggle)
        cmds.checkBox('distributed', e=True, changeCommand=self.distributed_toggle)
        cmds.optionMenu('renderer', e=True, changeCommand=self.change_renderer)
        cmds.radioButton('new_project', e=True, onCommand=self.select_new_project)
        cmds.radioButton('existing_project', e=True, onCommand=self.select_existing_project)
        self.change_renderer( self.renderer )
        self.select_new_project( True )

        return name
开发者ID:justin-wood,项目名称:zync-maya,代码行数:33,代码来源:zync_maya.py

示例10: load_ui

def load_ui():

    current_script_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    if cmds.window("jt_copy_ae_positions", exists=True):
        cmds.deleteUI("jt_copy_ae_positions")
    window = cmds.loadUI(uiFile=os.path.join(current_script_path, "jt_copy_ae_positions.ui"))
    cmds.showWindow(window)
开发者ID:jonathantopf,项目名称:jt_tools,代码行数:7,代码来源:jt_copy_ae_positions.py

示例11: load_ui

def load_ui():

    current_script_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    if (cmds.window('jt_autorig', exists=True)):
        cmds.deleteUI('jt_autorig')
    window = cmds.loadUI(uiFile=os.path.join(current_script_path, 'jt_autorig.ui'))
    cmds.showWindow(window)
开发者ID:MaxIsJames,项目名称:jt_tools,代码行数:7,代码来源:jt_autorig.py

示例12: SundayWarehouseBrowserUI

def SundayWarehouseBrowserUI():
    global warehouseBrowserUI
    if cmds.optionVar(query = 'SundayWarehousePath') == 'WarehousePathNotSet':
        SundayDialogPy.SundayDialogConfirm('Error                                        ', 'Warehouse path not set.\nOpen settings and set the path.', 'OK')
        return None
    SundayMayaGuiPath = mel.eval('getenv SundayGui;')
    
    try:
        if cmds.window(warehouseBrowserUI, query = True, exists = True):
            cmds.deleteUI(warehouseBrowserUI)
        
        warehouseBrowserUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayWarehouseBrowser.ui')
    except:
        cmds.optionVar(query = 'SundayWarehousePath') == 'WarehousePathNotSet'
        warehouseBrowserUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayWarehouseBrowser.ui')

    if cmds.dockControl('sundayWarehouseBrowserDock', query = True, exists = True):
        cmds.deleteUI('sundayWarehouseBrowserDock')
    
    
    try:
        cmds.optionMenu('whIconViewComboBox', edit = True, value = cmds.optionVar(query = 'whIconViewComboBox'))
    except:
        cmds.optionVar(query = 'SundayWarehousePath') == 'WarehousePathNotSet'

    cmds.setParent(cmds.button('whIconCaptionDummy', query = True, fullPathName = True, parent = True))
    cmds.deleteUI('whIconCaptionDummy')
    cmds.iconTextCheckBox('whIconCaption', image1 = SundayImage + 'SundayImageCaption.png', changeCommand = 'SundayWarehousePy.SundayWarehouseBrowserUpdateAssets()')
    cmds.setParent(warehouseBrowserUI)
    if cmds.optionVar(query = 'whIconCaption') == 'True':
        cmds.iconTextCheckBox('whIconCaption', edit = True, value = True)
    
    cmds.showWindow(warehouseBrowserUI)
    if platform.system() == 'Windows':
        cmds.window(warehouseBrowserUI, edit = True, topLeftCorner = [
            100,
            100])
    
    cmds.optionMenu('whIconViewComboBox', edit = True, changeCommand = 'SundayWarehousePy.SundayWarehouseBrowserUpdateAssets()')
    cmds.optionMenu('whCategoryComboBox', edit = True, changeCommand = 'SundayWarehousePy.SundayWarehouseBrowserUpdateType()')
    cmds.optionMenu('whTypeComboBox', edit = True, changeCommand = 'SundayWarehousePy.SundayWarehouseBrowserUpdateAssets()')
    SundayWarehouseBrowserUpdate()
    
    try:
        cmds.deleteUI('sundayWarehouseBrowserDock')
    except:
        cmds.optionVar(query = 'SundayWarehousePath') == 'WarehousePathNotSet'
开发者ID:elliottjames,项目名称:jeeves,代码行数:47,代码来源:SundayWarehousePy.py

示例13: SundayBetweenToolUI

def SundayBetweenToolUI():
    global sundayControllerToolBetweenUI
    SundayMayaGuiPath = mel.eval('getenv SundayGui;')
    
    try:
        if cmds.window(sundayControllerToolBetweenUI, exists = True):
            cmds.deleteUI(sundayControllerToolBetweenUI)
        
        sundayControllerToolBetweenUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayBetweenTools.ui')
    except:
        sundayControllerToolBetweenUI = cmds.loadUI(uiFile = SundayMayaGuiPath + 'SundayBetweenTools.ui')

    cmds.showWindow(sundayControllerToolBetweenUI)
    if platform.system() == 'Windows':
        cmds.window(sundayControllerToolBetweenUI, edit = True, topLeftCorner = [
            100,
            100])
开发者ID:elliottjames,项目名称:jeeves,代码行数:17,代码来源:SundayBetweenToolPy.py

示例14: create

	def create(self, verbose=False):
		if cmds.window(self.window, exists=True):
			cmds.deleteUI(self.window);
		self.window=cmds.loadUI(
			uiFile=self.uiFile,
			verbose=verbose
		);
		cmds.showWindow(self.window);
开发者ID:karenstritz,项目名称:theRusterizer,代码行数:8,代码来源:rusterizerGui.py

示例15: build

 def build(self):
     uiFile = self.uiFile
     if mc.window(self.ui, ex=1):
         mc.deleteUI(self.ui)
     self.ui = mc.loadUI(uiFile=self.uiFile)
     mc.button('enter',e=1,c=self.doIt)
     mc.optionMenu('flowerBox',e=1,changeCommand=self.newMenuItem)
     mc.showWindow(self.ui)
开发者ID:chuckbruno,项目名称:Python_scripts,代码行数:8,代码来源:poseMachine.py


注:本文中的maya.cmds.loadUI函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。