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


Python cmds.showWindow函数代码示例

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


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

示例1: evenEdgeSpacingUI

def evenEdgeSpacingUI():
    """
    Even Edge Spacing UI
    """
    # Window
    window = 'evenEdgeSpacingUI'
    if cmds.window(window, q=True, ex=1): cmds.deleteUI(window)
    window = cmds.window(window, t='Even Edge Spacing', s=True)

    # Layout
    CL = cmds.columnLayout()

    # UI Elements
    cmds.intSliderGrp('evenEdgeSpacing_smoothISG', label='Smooth', field=True, minValue=0, maxValue=20, fieldMinValue=0,
                    fieldMaxValue=100, value=4)
    cmds.floatSliderGrp('evenEdgeSpacing_influenceFSG', label='Influence', field=True, minValue=0.0, maxValue=1.0,
                      fieldMinValue=0.0, fieldMaxValue=1.0, value=1.0)
    cmds.checkBoxGrp('evenEdgeSpacing_snapToOrigCBG', label='Maintain Shape', numberOfCheckBoxes=1,
                   v1=False)  # columnWidth2=[100,165]
    cmds.checkBoxGrp('evenEdgeSpacing_deleteHistoryCBG', label='Delete History', numberOfCheckBoxes=1, v1=False)
    cmds.button('evenEdgeSpacingB', l='Even Edge Spacing', w=390,
              c='glTools.model.straightenVerts.evenEdgeSpacingFromUI()')

    # Show Window
    cmds.window(window, e=True, wh=[392, 99])
    cmds.showWindow(window)
开发者ID:bennymuller,项目名称:glTools,代码行数:26,代码来源:straightenVerts.py

示例2: create

 def create(self):
     """
     Draw the window
     """
     # delete the window if its handle exists
     if cmds.window(self.window, exists=True):
         # deletes window. 'window' flag makes sure that deleted object is a window
         cmds.deleteUI(self.window, window=True)
     # initialize the window
     self.window = cmds.window(title=self.title, widthHeight=self.size, menuBar=True) 
     # main form for the window
     self.mainForm = cmds.formLayout(numberOfDivisions=100)
     # create common menu items items and buttons
     self.commonMenu()
     self.commonButtons()
     # create a tabLayout
     self.optionsBorder = cmds.tabLayout(scrollable=True, tabsVisible=False, height=1)
     # Attach tabLayout to parent formLayout, and to control button
     cmds.formLayout(self.mainForm, edit=True, attachForm=
                     ([self.optionsBorder, 'top', 0],
                     [self.optionsBorder, 'left', 2],
                     [self.optionsBorder, 'right', 2]),
                     attachControl=
                     ([self.optionsBorder, 'bottom', 5, self.applyBtn]))
     # new form to attach controls in displayOptions()
     self.optionForm = cmds.formLayout(numberOfDivisions=100)
     self.displayOptions()
     # Show the window
     cmds.showWindow(self.window)
开发者ID:animformed,项目名称:maya-py-book-exercises,代码行数:29,代码来源:P_maya_c7_OptionWin.py

示例3: zbw_offsetAnim

def zbw_offsetAnim(*args):
    """creates offset from first obj sel to last based on the entered offset value"""
    def zbw_runOffsetAnim(*args):
        #get frame range!!!!!!
        #get selection, check that they are tranforms
        sel = cmds.ls(sl=True,type="transform")
        selSize = int(len(sel))
        #for each selection mult the index by the offset value
        for i in range(0,selSize):
            obj = sel[i]
            offsetRaw = cmds.intFieldGrp('zbw_offsetValue', q=True, v=True)
            offset = offsetRaw[0]
            multFactor = i * offset
            #shift the entire anim curve by the offset mult value
            cmds.keyframe(obj, edit=True,relative=True,timeChange=multFactor,time=(1,24))

    #create UI, get offset value, frame range or all anim
    if (cmds.window('zbw_offsetAnimUI', exists=True)):
        cmds.deleteUI('zbw_offsetAnimUI', window=True)
        cmds.windowPref('zbw_offsetAnimUI', remove=True)
    window=cmds.window('zbw_offsetAnimUI', widthHeight=(350,200), title='zbw_offsetAnim')
    cmds.columnLayout(cal='center')
    cmds.intFieldGrp('zbw_offsetValue', cal=(1,'left'), label='frequency(frames)', value1=5)
    #CREATE FRAME RANGE AREA (WHICH FRAMES ARE WE DOING?)
    #WHEN THAT HAPPENS, WHAT DO WE DO WITH THE FRAMES AFTER THAT? (PROBABLY NOTHING. . . LET USER WORRY ABOUT IT)
    #checkbox for random freq (to give a random amount to offset each object)
    #cmds.checkBoxGrp('zbw_animNoiseRandom', cal=(1,'left'), cw=(1, 175),label='random frequency on', value1=0, cc=zbw_animNoiseRandom)
    cmds.button('zbw_offsetAnimGo', label='offset!', width=75, command=zbw_runOffsetAnim)

    cmds.showWindow(window)
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:30,代码来源:zbw_animTools.py

示例4: __init__

    def __init__(s):
        with report.Report():
            tracker = JointTracker()
            winName = "Orient_Joints"
            if cmds.window(winName, ex=True):
                cmds.deleteUI(winName)
            s.win = cmds.window(rtf=True, w=300, t="Orient Joints")
            cmds.columnLayout(adj=True)
            cmds.button(
                l="Attach Marker",
                h=50,
                c=Callback(tracker.addMarker),
                ann="""
Attach a Marker to the selected Joint.
Rotate the marker into the desired joint rotation.
"""
            )
            cmds.button(
                l="Update Joints",
                h=50,
                c=Callback(tracker.orientJoints),
                ann="""
Rotate all joints that have markers to their respective rotations.
"""
            )
            cmds.showWindow(s.win)
            cmds.scriptJob(uid=[s.win, tracker.removeMarkers])
开发者ID:internetimagery,项目名称:twinSkeleton,代码行数:27,代码来源:fixorient.py

示例5: particleLocatorsUI

def particleLocatorsUI():
    """
    """
    # Get current frame range
    start = cmds.playbackOptions(q=True, min=True)
    end = cmds.playbackOptions(q=True, max=True)

    # Define window
    particleLocatorsUI = 'particleLocatorsWindow'
    if cmds.window(particleLocatorsUI, q=True, ex=True): cmds.deleteUI(particleLocatorsUI)
    particleLocatorsUI = cmds.window(particleLocatorsUI, t='Generate Locators')

    # UI Layout
    cmds.columnLayout(adj=False, cal='left')
    partiTFG = cmds.textFieldGrp('partiLoc_particleTFG', label='Particle', text='', cw=[(1, 120)])
    prefixTFG = cmds.textFieldGrp('partiLoc_prefixTFG', label='Prefix', text='', cw=[(1, 120)])
    bakeAnicmdsBG = cmds.checkBoxGrp('partiLoc_bakeAnicmdsBG', label='Bake Animation', ncb=1, v1=0, cw=[(1, 120)])
    startEndIFG = cmds.intFieldGrp('partiLoc_startEndISG', nf=2, label='Frame Range', v1=start, v2=end, cw=[(1, 120)])

    rotateLocCBG = cmds.checkBoxGrp('partiLoc_rotateCBG', label='Rotate (rotatePP)', ncb=1, v1=0, cw=[(1, 120)])
    scaleLocCBG = cmds.checkBoxGrp('partiLoc_scaleCBG', label='Scale (scalePP)', ncb=1, v1=0, cw=[(1, 120)])

    cmds.button(l='Create Locators', c='glTools.tools.generateParticles.particleLocatorsFromUI()')

    # Popup menu
    cmds.popupMenu(parent=partiTFG)
    for p in cmds.ls(type=['particle', 'nParticle']):
        cmds.menuItem(p, c='cmds.textFieldGrp("' + partiTFG + '",e=True,text="' + p + '")')

    # Show Window
    cmds.showWindow(particleLocatorsUI)
开发者ID:bennymuller,项目名称:glTools,代码行数:31,代码来源:generateParticles.py

示例6: addMultiAttr

def addMultiAttr():
    #Create a variable for the window name
    winName = 'blend'
    winTitle = 'rh_addMultiAttr'
    #Delete the window if it exists
    if cmds.window(winName, exists=True):
        cmds.deleteUI(winName, window=True)
    #Build the main window
    cmds.window(winName, title=winTitle, sizeable=True)
    cmds.textFieldButtonGrp('Obj',label='Object :', text='', ed = False,buttonLabel='Load Sel',bc = 'sel()')
    cmds.columnLayout(adjustableColumn=True)    
    cmds.textFieldGrp('Attr',l='Attribute:',text='')   

    cmds.columnLayout(adjustableColumn=True)  
    cmds.floatFieldGrp('minAttr', numberOfFields=1, label='Min Value', value1=0) 
       
    cmds.columnLayout(adjustableColumn=True) 
    cmds.floatFieldGrp('maxAttr', numberOfFields=1, label='Max Value', value1=0)
    
    cmds.columnLayout(adjustableColumn=True)        
    cmds.button(label='Contact', command='Connect()')
    cmds.columnLayout(adjustableColumn=True)
    #Show the window
    cmds.showWindow(winName)
    cmds.window(winName, edit=True, width=300, height=120)
开发者ID:RyugasakiHu,项目名称:Maya-tools,代码行数:25,代码来源:rh_addMultiAttr.py

示例7: 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

示例8: windowSHM

def windowSHM(*args):
    
    if cmds.window("shdrmnWin", exists = 1):
        cmds.deleteUI("shdrmnWin")
    win = cmds.window("shdrmnWin", title = "Shader manager", w = 500, sizeable = 0)
    
    mainLayout = cmds.columnLayout (w = 500)
    
    cmds.rowColumnLayout(w = 500, nc = 4, parent = mainLayout )
    cmds.textFieldGrp( 'getAiAttrField', text = 'mColor')
    cmds.button(label = "GET TX", w= 83, h = 50, c = getTextureFromShader )
    cmds.button(label = "SHOW TX", w= 83, h = 50, c = assignPREVShader)
    cmds.button(label = "TILE UV", w= 83, h = 50, c = setTileUV)

    
    cmds.rowColumnLayout(w = 500, nc = 1, parent = mainLayout )
    cmds.button(label = "DELETE PREVIEW", w= 500, h = 50, c = deleteShaders, parent = mainLayout )
    cmds.separator(height=10, parent = mainLayout)
    
    cmds.rowColumnLayout(w = 500, nc = 2, parent = mainLayout )
    cmds.button(label = "GET MATERIALS", w= 250, h = 50, c =  getMaterial )
    cmds.button(label = "ASSIGN MATERIALS", w= 250, h = 50, c =  asignMaterial )
       
    
    cmds.showWindow(win)
开发者ID:Quazo,项目名称:breakingpoint,代码行数:25,代码来源:aiShaderManager.py

示例9: create_comment

 def create_comment(self, *args):
     cmds.window('comment_win')
     cmds.columnLayout()
     cmds.text(l='Enter in new comment')
     self.new_comment_field = cmds.scrollField()
     add = cmds.button(l='Add', c=self.add_comment)
     cmds.showWindow('comment_win')
开发者ID:creuter23,项目名称:fs-tech-artist,代码行数:7,代码来源:threeDF_rig_check_v011.py

示例10: create

 def create( self, *args ):
     
     if cmds.window( self.winName, ex=1 ):
         cmds.deleteUI( self.winName, wnd=1 )
     cmds.window( self.winName, title= self.title, titleBarMenu=0 )
     
     cmds.columnLayout()
     cmds.rowColumnLayout( nc=1, cw=[( 1,self.width-2)] )
     cmds.text( l='Register ID', h=30 )
     idField = cmds.textField( h=25 )
     helpField = cmds.textField( en=0 )
     cmds.setParent( '..' )
     
     firstWidth = (self.width-2)*0.5
     secondWidth = (self.width-2)-firstWidth
     cmds.rowColumnLayout( nc=2, cw=[(1,firstWidth),(2,secondWidth)])
     cmds.button( l='Create', h=25, c=self.cmdCreate )
     cmds.button( l='Cancel', h=25, c=self.cmdCancel )
     cmds.setParent( '..' )
     
     cmds.window( self.winName, e=1,
                  width = self.width,
                  height = self.height )
     cmds.showWindow( self.winName )
     
     self.idField = idField
     self.helpField = helpField
开发者ID:jonntd,项目名称:mayadev-1,代码行数:27,代码来源:view.py

示例11: __init__

	def __init__(self) :
		# get the currently selected objects and make sure we have only one object
		selected = OM.MSelectionList()
		OM.MGlobal.getActiveSelectionList(selected)
		self.selectedObjects = []
		selected.getSelectionStrings(self.selectedObjects)
		if len(self.selectedObjects) == 0 :
			cmds.confirmDialog( title='No objects Selected', message='Select a Mesh Object', button=['Ok'], defaultButton='Ok', cancelButton='Ok', dismissString='Ok' )
		elif len(self.selectedObjects) > 1 :
			cmds.confirmDialog( title='Select One Object', message='Only One Mesh mat be exported at a time', button=['Ok'], defaultButton='Ok', cancelButton='Ok', dismissString='Ok' )
		# now we have the correct criteria we can proceed with the export
		else :
			# get the start and end values for our UI sliders
			anim=OMA.MAnimControl()
			minTime=anim.minTime()
			maxTime=anim.maxTime()
			self.m_start=int(minTime.value())
			self.m_end=int(maxTime.value())
			# now we create a window ready to populate the components
			self.m_window = cmds.window( title='NCCA Pointbake Export' )
			# create a layout
			cmds.columnLayout()
			# create two sliders for start and end we also attach methods to be called when the slider
			# changes
			self.m_startSlider=cmds.intSliderGrp( changeCommand=self.startChanged,field=True, label='Start Frame', minValue=self.m_start, maxValue=self.m_end, fieldMinValue=self.m_start, fieldMaxValue=self.m_end, value=self.m_start )
			self.m_endSlider=cmds.intSliderGrp( changeCommand=self.endChanged ,field=True, label='End Frame', minValue=self.m_start, maxValue=self.m_end, fieldMinValue=self.m_end, fieldMaxValue=self.m_end, value=self.m_end )
			# create a button and add the method called when pressed
			cmds.button( label='Export', command=self.export )
			# finally show the window
			cmds.showWindow( self.m_window )
开发者ID:NCCA,项目名称:NGL6Demos,代码行数:30,代码来源:NCCAPointBakeMayaExport.py

示例12: setupRLUI

def setupRLUI():
    if cmds.window("RLWin", exists=True):
        cmds.deleteUI("RLWin")
    
    widgets["win"] = cmds.window("RLWin", t="zbw_setupRL", w=200, h=400)
    widgets["mainCL"] = cmds.columnLayout(w=200)
    widgets["mainFrame"] = cmds.frameLayout(l="Create Render Layers", w=200, cll=True, bgc=(.2,.2,.2))
    
    widgets["CarKey"] = cmds.checkBox(l="Car_Env", v=True)
    widgets["CarEnv"] = cmds.checkBox(l="Car_Key", v=True)
    widgets["BGKey"] = cmds.checkBox(l="BG_Env", v=True)
    widgets["BGEnv"] = cmds.checkBox(l="BG_Key", v=True)
    widgets["AO"] = cmds.checkBox(l="All_AO", v=True)
    widgets["MatteA"] = cmds.checkBox(l="All_MatteA", v=True)
    widgets["MatteB"] = cmds.checkBox(l="All_MatteB", v=True)
    widgets["MoVec"] = cmds.checkBox(l="All_MoVec", v=True)
    widgets["Shadow"] = cmds.checkBox(l="All_Shadow", v=True)
    
    widgets["createBut"] = cmds.button(l="Create Layers", w=200, h=40, bgc=(.6,.8,.6), c=createRL)
    cmds.text("NOTE: this is setting the overrides for \nthe moVec layer RG's and materials \n(if you have them in scene\n for the AO and Movec layers but \n NO passes are set up")
    cmds.separator(h=20, style = "double")
    #widgets["copyBut"] = cmds.button(l="Copy Selected Layer", w=200, h=40, bgc=(.8,.8,.6), c=copyRL)
    #cmds.separator(h=20, style = "double")
    widgets["importBut"] = cmds.button(l="Import RL Shaders File", w=200, h=40, bgc=(.8,.6,.6), c=importRL)
   
    cmds.showWindow(widgets["win"])
    cmds.window(widgets["win"], e=True, w=200, h=400)
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:27,代码来源:zbw_setupRL.py

示例13: secondaryUI

def secondaryUI():
    sec_UIname = 'secondary'
    if cmds.window(sec_UIname,exists = True):
        cmds.deleteUI(sec_UIname)
    cmds.window(sec_UIname,title = 'rosa_secondary')
    clmLot = cmds.columnLayout( adjustableColumn=True)
    cmds.textField('ctrl_name',text = 'ctrl_name')
    cmds.button('createctrl',label = 'create ctrl',h = 30,c = 'ctrl()')
    cmds.button('load_model',label = 'load "org" model',c = 'load_org()')
    cmds.textField('org_model',text = '"org" model')
    cmds.button('load_property_obj',label = 'loading property add object',c = 'load_vis()')
    cmds.textField('vis',text = 'Visibility')
    #
    flLot = cmds.flowLayout(columnSpacing = 6)
    cmds.text(label = 'ctrl axial:')
    cmds.radioCollection()
    cmds.radioButton('follic',label = 'follic',select = 0)
    cmds.radioButton('Custom',label = 'Custom',select = 1)
    #
    cmds.setParent( clmLot)
    cmds.button(label = 'Generate',c = 'secondary_add()')
    cmds.button('add_ctrl',label = 'add controller',c = 'add_controller()')
    cmds.button('Add_modelSec',label = 'Add_modelSec',c = 'Add_modelSec()')
    cmds.button(label = 'inverse_connect',c =  'inverse_connect01()')
    #
    cmds.frameLayout( label='modify ctrl:',borderStyle='etchedOut')
    cmds.setParent( clmLot)
    cmds.button(label = 'loding want to modify the controller',c = 'load_ctrl()')
    cmds.textField('sec_ctrl',text = 'secondary_ctrl')
    cmds.button(label = 'modify the controller position',c = 'ctrl_modify()')
    cmds.button(label = 'complete controller modifies',c = 'modify_complete()')
    cmds.showWindow()
开发者ID:wangqinghuaTudou,项目名称:test,代码行数:32,代码来源:rosa_SecCtrl.py

示例14: smoothEdgeLineUI

def smoothEdgeLineUI():
    """
    Smooth Edge Line UI
    """
    # Window
    window = 'smoothEdgesUI'
    if cmds.window(window, q=True, ex=1): cmds.deleteUI(window)
    window = cmds.window(window, t='Smooth Edge Line', s=True)

    # Layout
    CL = cmds.columnLayout()

    # UI Elements
    cmds.intSliderGrp('smoothEdges_smoothISG', label='Smooth', field=True, minValue=1, maxValue=20, fieldMinValue=1,
                    fieldMaxValue=100, value=4)
    cmds.floatSliderGrp('smoothEdges_falloffFSG', label='Falloff Distance', field=True, precision=3, minValue=0.0,
                      maxValue=10.0, fieldMinValue=0.0, fieldMaxValue=100.0, value=0.01)
    cmds.checkBoxGrp('smoothEdges_edgeSpacingCBG', label='Maintain Edge Spacing', numberOfCheckBoxes=1, v1=False)
    cmds.checkBoxGrp('smoothEdges_snapToOrigCBG', label='Maintain Shape', numberOfCheckBoxes=1,
                   v1=False)  # columnWidth2=[100,165]
    cmds.checkBoxGrp('smoothEdges_deleteHistoryCBG', label='Delete History', numberOfCheckBoxes=1, v1=False)
    cmds.button('smoothEdgesB', l='Smooth', w=390, c='glTools.model.straightenVerts.smoothEdgeLineFromUI()')

    # Show Window
    cmds.window(window, e=True, wh=[392, 115])
    cmds.showWindow(window)
开发者ID:bennymuller,项目名称:glTools,代码行数:26,代码来源:straightenVerts.py

示例15: create

 def create(self):
     
     if cmds.window( self.winName, ex=1 ):
         cmds.deleteUI( self.winName, wnd=1 )
     cmds.window( self.winName, title= self.title )
     
     form = cmds.formLayout()
     field_meshForm = self.field_mesh.create()
     field_uvForm   = self.field_uv.create()
     checkForm      = self.check.create()
     buttons_form   = self.buttons.create()
     cmds.setParent( '..' )
     
     cmds.formLayout( form, e=1,
                      af=[(field_meshForm, 'top', 0 ), ( field_meshForm, 'left', 0 ), ( field_meshForm, 'right', 0 ),
                          (field_uvForm, 'left', 0 ), ( field_uvForm, 'right', 0 ),
                          (checkForm, 'left', 0 ), (checkForm, 'right', 0 ),
                          (buttons_form, 'left', 0 ), ( buttons_form, 'right', 0 ) ],
                      ac=[(field_uvForm, 'top', 0, field_meshForm ),
                          (checkForm, 'top', 0, field_uvForm),
                          (buttons_form, 'top', 0, checkForm )])
     
     cmds.window( self.winName, e=1, w=self.width, h=self.height )
     cmds.showWindow( self.winName ) 
 
     self.setTextInfomation()
     self.popupSetting()
     self.buttonCommandSetting()
开发者ID:jonntd,项目名称:mayadev-1,代码行数:28,代码来源:sgPWindow_data_mesh_import.py


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