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


Python cmds.textFieldGrp函数代码示例

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


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

示例1: storeWorldSpaceMesh

def storeWorldSpaceMesh():
	'''
	'''
	# Check SkinClusterData
	skinData = glTools.gl_global.glSkinClusterData
	if not skinData: return
	
	# Get Affected Geometry
	if not skinData._data.has_key('affectedGeometry'):
		raise Exception('No skin geometry data! Unable to rebuild worldSpace mesh...')
	skinGeo = skinData._data['affectedGeometry'][0]
	if not skinData._data.has_key(skinGeo):
		raise Exception('No skin geometry data for "'+skinGeo+'"! Unable to rebuild worldSpace mesh...')
	if skinData._data[skinGeo]['geometryType'] != 'mesh':
		raise Exception('Skin geometry "'+skinGeo+'" is not a mesh! Unable to rebuild worldSpace mesh...')
	
	# Initialize MeshData
	if not skinData._data[skinGeo].has_key('mesh'):
		skinData._data[skinGeo]['mesh'] = meshData.MeshData()
	
	# Store MeshData
	worldSpaceMesh = mc.textFieldGrp('skinCluster_wsMeshTFG',q=True,text=True)
	if not mc.objExists(worldSpaceMesh): raise Exception('World space mesh "'+worldSpaceMesh+'" doesn`t exist!')
	skinData._data[skinGeo]['mesh'].buildData(worldSpaceMesh)
	
	# Delete World Space Mesh
	mc.delete(worldSpaceMesh)
	
	# Update TextFieldGrp
	mc.textFieldGrp('skinCluster_wsMeshTFG',e=True,text='')
开发者ID:auqeyjf,项目名称:glTools,代码行数:30,代码来源:skinClusterData.py

示例2: strAttribute

def strAttribute(mainSetting, setting):
    cmds.textFieldGrp(str(setting.keys()[0])+'_attribute',
                    label=str(setting.keys()[0]).replace('_', ' '),
                    text=str(setting.values()[0]),
                    editable=True,
                    cc="import dmptools.setup.settingsWindow as settingsWindow;settingsWindow.updateStrAttr('"+mainSetting+"')"
                    )
开发者ID:jonntd,项目名称:dmptools,代码行数:7,代码来源:settingsWindow.py

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

示例4: attachToSurfaceFromUI

def attachToSurfaceFromUI(close=True):
    """
    Execute attachToSurface() from UI
    @param close:
    """
    # Window
    window = 'attachToSurfaceUI'
    if not cmds.window(window, q=True, ex=1): raise UIError('AttachToSurface UI does not exist!!')
    # Get UI data
    surf = cmds.textFieldGrp('attachToSurfaceTFB', q=True, text=True)
    # Check surface
    if not glTools.utils.surface.isSurface(surf):
        raise UserInputError('Object "' + surf + '" is not a valid nurbs surface!!')
    trans = cmds.textFieldGrp('attachToSurfaceTransformTFB', q=True, text=True)
    pre = cmds.textFieldGrp('attachToSurfacePrefixTFG', q=True, text=True)
    uParam = cmds.floatFieldGrp('attachToSurfaceParamTFB', q=True, v1=True)
    vParam = cmds.floatFieldGrp('attachToSurfaceParamTFB', q=True, v2=True)
    closePnt = cmds.checkBoxGrp('attachToSurfaceClosePntCBG', q=True, v1=True)
    uAttr = cmds.textFieldGrp('attachToSurfaceUAttrTFG', q=True, text=True)
    vAttr = cmds.textFieldGrp('attachToSurfaceVAttrTFG', q=True, text=True)
    # Orient
    orient = cmds.checkBoxGrp('attachToSurfaceOrientCBG', q=True, v1=True)
    # Orient Options
    tanU = str.lower(str(cmds.optionMenuGrp('attachToSurfaceUAxisOMG', q=True, v=True)))
    tanV = str.lower(str(cmds.optionMenuGrp('attachToSurfaceVAxisOMG', q=True, v=True)))
    align = str.lower(str(cmds.optionMenuGrp('attachToSurfaceAlignToOMG', q=True, v=True)))

    # Execute command
    result = glTools.utils.attach.attachToSurface(surface=surf, transform=trans, uValue=uParam, vValue=vParam,
                                                  useClosestPoint=closePnt, orient=orient, uAxis=tanU, vAxis=tanV,
                                                  uAttr=uAttr, vAttr=vAttr, alignTo=align, prefix=pre)

    # Cleanup
    if close: cmds.deleteUI(window)
开发者ID:bennymuller,项目名称:glTools,代码行数:34,代码来源:surface.py

示例5: pupMaya2mental

def pupMaya2mental(mentalVersion):
        destPath = os.getenv('DEST_PATH_WIN')
        rootPath, shadersPath = {	
                3.8:('c:/Program Files/Autodesk/mrstand3.8.1-adsk2011/bin', destPath + '/mental3.8.1'),
                3.11:('c:/Program Files/Autodesk/mrstand3.11.1-adsk2014/bin', destPath + '/mental3.11.1')
                }[mentalVersion]

        os.putenv('RAY_COMMAND', '"' + rootPath + '/ray.exe"')

        os.putenv('MR_VERSION', str( mentalVersion ) )

        miModulesPaths, binModulesPaths = modulesPath.getMiBinString()
        #os.putenv('MI_RAY_INCPATH', shadersPath + '/mi;' +  miModulesPaths)
        #os.putenv('MI_LIBRARY_PATH', shadersPath + '/bin;' +  binModulesPaths)
        #os.putenv('MI_ROOT', rootPath)
        mel.eval('pup_maya_2_mental(3);')

        mc.checkBoxGrp('pup_m2mrOverrideEnv', e=True, v1=1)
        mc.textFieldGrp('pup_m2mrMiRoot', e=True, tx= rootPath )
        mc.textFieldGrp('pup_m2mrMiInclude', e=True, tx= shadersPath + '/mi;' +  miModulesPaths )
        mc.textFieldGrp('pup_m2mrMiLib', e=True, tx= shadersPath + '/bin;' +  binModulesPaths )
        mc.textFieldGrp('pup_m2mrMiDir', e=True, tx= "C:/Temp/" )
        mc.optionMenuGrp('pup_m2mrVerboseM', e=True, sl=5)
        #mc.textFieldGrp('pup_m2mrCommandLine', e=True, tx= '-finalgather_passes 0 -memory 1000000' )
        mc.textFieldGrp('pup_m2mrCommandLine', e=True, tx= '-memory 1000000' )
        mc.checkBoxGrp('pup_m2mrUniqueMI', e=True, v1=1)
        mc.optionMenuGrp('pup_m2mrPriority', e=True, sl=3)
开发者ID:zclongpop123,项目名称:sag_utils,代码行数:27,代码来源:pupMaya2mental.py

示例6: refreshUI

def refreshUI():
    """
    """
    # Get UI input values
    blendShape = cmds.textFieldGrp('tdb_blendShapeTFG', q=True, text=True)
    target1 = cmds.textFieldGrp('tdb_target1TFG', q=True, text=True)
    target2 = cmds.textFieldGrp('tdb_target1TFG', q=True, text=True)

    # Update blendShape menu list
    blendShapeList = cmds.ls(type='blendShape')
    cmds.popupMenu('tdb_blendShapePUM', e=True, deleteAllItems=True)
    cmds.setParent('tdb_blendShapePUM', m=True)
    for item in blendShapeList:
        cmds.menuItem(label=item,
                    c='cmds.textFieldGrp("tdb_blendShapeTFG",e=True,text="' + item + '");glTools.ui.transformDrivenBlend.refreshUI()')

    # Check BlendShape
    if blendShape and cmds.objExists('blendShape') and (cmds.objectType(blendShape) == 'blendShape'):
        targetList = cmds.listAttr(blendShape + '.w', m=True)
        cmds.popupMenu('tdb_target1PUM', e=True, deleteAllItems=True)
        cmds.popupMenu('tdb_target2PUM', e=True, deleteAllItems=True)
        for target in targetList:
            targetCon = cmds.listConnections(blendShape + '.' + target, s=True, d=False)
            if target == target1: targetCon = True
            if target == target2: targetCon = True
            cmds.setParent('tdb_target1PUM', m=True)
            cmds.menuItem(label=target,
                        c='cmds.textFieldGrp("tdb_target1TFG",e=True,text="' + target + '");glTools.ui.transformDrivenBlend.refreshUI()',
                        en=not bool(targetCon))
            cmds.setParent('tdb_target2PUM', m=True)
            cmds.menuItem(label=target,
                        c='cmds.textFieldGrp("tdb_target1TFG",e=True,text="' + target + '");glTools.ui.transformDrivenBlend.refreshUI()',
                        en=not bool(targetCon))
开发者ID:bennymuller,项目名称:glTools,代码行数:33,代码来源:transformDrivenBlend.py

示例7: stretchyIkSplineFromUI

def stretchyIkSplineFromUI(close=False):
	'''
	'''
	# Window
	window = 'stretchyIkSplineUI'
	if not mc.window(window,q=True,ex=1): raise UIError('StretchyIkSpline UI does not exist!!')
	
	# Get UI data
	ik = mc.textFieldButtonGrp('stretchyIkSplineTFB',q=True,text=True)
	pre = mc.textFieldGrp('stretchyIkSplinePrefixTFG',q=True,text=True)
	scaleAxis = str.lower(str(mc.optionMenuGrp('stretchyIkSplineAxisOMG',q=True,v=True)))
	scaleAttr = mc.textFieldButtonGrp('stretchyIkSplineScaleAttrTFB',q=True,text=True)
	blendCtrl = mc.textFieldButtonGrp('stretchyIkSplineBlendCtrlTFB',q=True,text=True)
	blendAttr = mc.textFieldGrp('stretchyIkSplineBlendAttrTFG',q=True,text=True)
	method = mc.optionMenuGrp('stretchyIkSplineMethodOMG',q=True,sl=True)-1
	minPercent = mc.floatSliderGrp('stretchyIkSplineMinPFSG',q=True,v=True)
	maxPercent = mc.floatSliderGrp('stretchyIkSplineMaxPFSG',q=True,v=True)
	
	# Execute command
	if method: # Parametric
		glTools.builder.stretchyIkSpline_parametric.StretchyIkSpline_parametric().build(ikHandle=ik,scaleAttr=scaleAttr,blendControl=blendCtrl,blendAttr=blendAttr,scaleAxis=scaleAxis,minPercent=minPercent,maxPercent=maxPercent,prefix=pre)
	else: # Arc Length
		glTools.builder.stretchyIkSpline_arcLength.StretchyIkSpline_arcLength().build(ikHandle=ik,scaleAttr=scaleAttr,blendControl=blendCtrl,blendAttr=blendAttr,scaleAxis=scaleAxis,prefix=pre)
	
	# Cleanup
	if close: mc.deleteUI(window)
开发者ID:RiggingDojoAdmin,项目名称:glTools,代码行数:26,代码来源:ik.py

示例8: import2dTrackUI

def import2dTrackUI():
    """
    """
    # Build UI Window
    window = 'import2dTrackUI'
    if cmds.window(window, q=True, ex=True): cmds.deleteUI(window)
    window = cmds.window(window, title='Import 2D Track', wh=[500, 350])

    # Build UI Elements
    cmds.columnLayout(adjustableColumn=True)
    perspCamListTSL = cmds.textScrollList('importTrack_camListTSL', numberOfRows=8, ams=False)
    fileTFB = cmds.textFieldButtonGrp('importTrack_fileTFB', label='2D Track File', buttonLabel='Browse')
    cmds.textFieldButtonGrp(fileTFB, e=True, bc='glTools.ui.utils.loadFilePath("' + fileTFB + '",fileFilter="*.*")')
    cmds.textFieldGrp('importTrack_nameTFG', label="Point Name", text='trackPoint1')
    cmds.floatFieldGrp('importTrack_widthFFG', numberOfFields=1, label='Source Pixel Width', value1=2348)
    cmds.floatFieldGrp('importTrack_heightFFG', numberOfFields=1, label='Source Pixel Height', value1=1566)
    cmds.button(label='Import Track',
              c='import glTools.tools.import2dTrack;reload(glTools.tools.import2dTrack);glTools.tools.import2dTrack.import2dTrack()')
    cmds.button(label='Close', c='cmds.deleteUI("' + window + '")')

    # Build Camera List
    camList = cmds.listCameras(p=True)
    for cam in camList: cmds.textScrollList(perspCamListTSL, e=True, a=cam)

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

示例9: bdMainWindow

def bdMainWindow():
	bdWin = "CreateSkeleton"
	if cmds.window(bdWin,q=True,ex=True):
		cmds.deleteUI(bdWin)

	cmds.window(bdWin,title = "Create Skeleton")
	cmds.scrollLayout(horizontalScrollBarThickness=16)
	bdMainCL = cmds.columnLayout(columnAttach=("both",5),rowSpacing=10,columnWidth=320)
	#GUIDES CREATION
	bdFL1 = cmds.frameLayout(label="Template Guides",bs="etchedOut",w=300,mw=5,cll=1,p=bdMainCL)
	bdCL1= cmds.columnLayout(rs=5,adj=1,p=bdFL1)
	#Character Name
	cmds.textFieldGrp("bdChName",l="Character Name",tx="")
	#Number of Fingers/Toes
	#cmds.intSliderGrp("bdFingersNumber",label="Number of Fingers",field=True,minValue=1,maxValue=5,fieldMinValue=1,fieldMaxValue=5,value=4,cw3=(100,30,10),dc=bdSetFingersNumber)
	#cmds.checkBoxGrp("bdHasThumb",numberOfCheckBoxes=1, label='Thumb?')
	#cmds.intSliderGrp("bdToesNumber",label="Number of Toes",field=True,minValue=1,maxValue=5,fieldMinValue=1,fieldMaxValue=5,value=4,cw3=(100,30,10),dc=bdSetToesNumber)
	cmds.button(l="Import Template",c=bdImportTemplate)
	#Character Scale Slider
	cmds.floatSliderGrp("bdScaleSlider",en=0,label="Guide scale",field=True,minValue=1,maxValue=100,fieldMinValue=1,fieldMaxValue=100,value=1,cw3=(70,30,10),dc=bdScaleGuides)
	#Character Mirror
	cmds.rowColumnLayout(nc=2,cw=[(1,138),(2,138)],p=bdCL1);
	cmds.button(l="Mirror left << ",al="right",c = functools.partial(bdMirrorGuide,"left"))
	cmds.button(l=">> Mirror right",al="left",c = functools.partial(bdMirrorGuide,"right"));
	#END GUIDES CREATION
	
	#JOINTS CREATION
	bdFL2 = cmds.frameLayout(label="Create Joints",bs="etchedOut",w=300,mw=5,cll=1,p=bdMainCL)
	bdCL2 = cmds.columnLayout(rs=5,adj=1,p=bdFL2)
	cmds.button(l="Create Joints",c =bdCreateSkeleton)
	#floatSliderGrp -en 0 -label "THUMB Orient" -field true	-minValue 0 -maxValue 180 -fieldMinValue 1 -fieldMaxValue 100	-value 0 -cw3 80 40 10 -dc bdJointOrientX bdJointXSlider;
	#END JOINTS CREATION
	
	cmds.showWindow(bdWin)
开发者ID:Mortaciunea,项目名称:bdScripts,代码行数:34,代码来源:bdPyRig.py

示例10: mirrorClusterCmd

    def mirrorClusterCmd(self):
        """"""
        sels = cmds.ls(sl=1, ap=1)
        if not sels: cmds.error("Please select clusters or joints!")
        
        # Prepare parameters
        axisBtn = cmds.radioCollection(self.axisCol, q=1, sl=1)
        axisId = cmds.radioButton(axisBtn, q=1, l=1).lower()
        axises = scData.getAxisMap(axisId)
        mirrorPivot = cmds.textField(self.mirPivTxFld, q=1, tx=1)
        tol = float(cmds.textFieldGrp(self.tolTxFld, q=1, tx=1))
        search = cmds.textFieldGrp(self.searchTxFld, q=1, tx=1)
        replace = cmds.textFieldGrp(self.replaceTxFld, q=1, tx=1)

        # Deal with mirror pivot matrix
        if mirrorPivot: pivotMatrixList = cmds.xform(mirrorPivot, q=1, ws=1, m=1)
        else: pivotMatrixList = scData.getWorldMatrixList()
        
        start = clock()
        for sel in sels:
            if cmds.objectType( sel, isType='joint' ):
                scData.JointFn.mirrorJnt(sel, pivotMatrixList, axises, search, replace, tol)
            elif cmds.listRelatives(sel, s=1, typ='clusterHandle'):            
                scData.ClusterFn.mirrorCluster(sel, pivotMatrixList, axises, search, replace, tol)
            else: cmds.warning("%s is skipped!" % sel)
        
        finish = clock()
        om.MGlobal.displayInfo( "Mirror Time Cost: %fs" % (finish-start) )
开发者ID:griffinanimator,项目名称:ThirdParty,代码行数:28,代码来源:tabMirror.py

示例11: extendUI

def extendUI(*args):
    """UI for the script"""
    #UI
    if cmds.window("curbWin", exists=True):
        cmds.deleteUI("curbWin")

    cmds.window("curbWin", t="zbw_polyExtender", w=200, h=200)
    cmds.columnLayout("colLO")
    cmds.frameLayout("topFrame", l="Covert Edge", cll=True, bgc=(.2,.2,.2))
    cmds.text("Select poly edge to convert")
    cmds.button("convertBut", l="Convert!", w=200, h=30, bgc=(.8, .8,.6), c=convertEdge)
    cmds.separator(h=5)

    cmds.setParent("colLO")

    cmds.frameLayout("midFrame", l="Create Poly", cll=True, bgc=(.2,.2,.2))
    cmds.text("Select curve")
    cmds.separator(h=5)
    cmds.textFieldGrp("name", l="Name", w=200, cw=[(1,30), (2,170)], tx="newPoly")
    cmds.checkBox("curbCB", l="Positive Direction", v=True)
    # cmds.checkBox("bumpCB", l="Add vertical hump?", v=True)
    cmds.floatFieldGrp("curbFFG", l="Curb Width", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=10)
    cmds.intFieldGrp("UDivIFG", l="Width Subdivisions", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=1)
    cmds.intFieldGrp("VDivIFG", l="Length Subdivisions", cal=((1, "left"),(2,"left")), cw=([1,75],[2,50]), v1=1)
    cmds.checkBox("polyHistory", l="Keep history on final poly?", v=False)
    cmds.checkBox("history", l="Keep history objects?", v=True, cc=enableHistory)

    cmds.separator(h=5)
    cmds.button("curbBut", l="Create Curb", h=40, w=200, bgc=(.6, .8, .6), c=extendPoly)

    cmds.showWindow("curbWin")
    cmds.window("curbWin", e=True, h=150, w=200)
开发者ID:zethwillie,项目名称:zbw_python_tools,代码行数:32,代码来源:zbw_polyExtend.py

示例12: editItem

def editItem(*args):
    """ first edit the item in the edit/remove UI
        then edit the item in the shelf and last edit the item in the settings file
    """
    # get edited item values
    itemName = cmds.textFieldGrp('edit_customname', q=True, text=True)
    itemCommand = cmds.textFieldGrp('edit_customCommand', q=True, text=True)
    value = cmds.radioButtonGrp('edit_customSourceRadioButton', q=True, select=True)
    if not itemName or not itemCommand or not value:
        raise UserWarning('You need to fill all the fields!')
    if value == 1:
        sourceType = 'python'
    else:
        sourceType = 'mel'
    itemFull = itemName+' - '+itemCommand+' - '+sourceType
    
    # delete the edit item window
    cmds.deleteUI('edit_customEditItem', window=True)
    
    # delete the old scrollList entry and insert the new one at the same place
    scrollItemSelected = cmds.textScrollList('item_list', q=True, si=True)[0]
    scrollItemIndex = cmds.textScrollList('item_list', q=True, sii=True)[0]
    cmds.textScrollList('item_list', e=True, ri=scrollItemSelected)
    cmds.textScrollList('item_list', e=True, appendPosition=[scrollItemIndex, itemFull], doubleClickCommand=editItemUI)

    # get the path of the shelf item to edit
    for item in SETTINGS.getAll():
        if item.values()[0][0] == scrollItemSelected.split(' - ')[0]:
            menuItemPath = item.keys()[0]
            cmds.menuItem(menuItemPath, e=True, label=itemName, command=itemCommand, sourceType=sourceType)
            SETTINGS.add(menuItemPath, [itemName, itemCommand, sourceType])
开发者ID:shrimo,项目名称:dmptools,代码行数:31,代码来源:customItems.py

示例13: create

 def create(self):
     
     if cmds.window( self.winName, ex=1 ):
         cmds.deleteUI( self.winName, wnd=1 )
     cmds.window( self.winName, title= self.title )
     
     cmds.columnLayout()
     columnWidth = self.width - 2
     firstWidth  = ( columnWidth -2 )* 0.23
     secondWidth = ( columnWidth -2 ) - firstWidth
     cmds.rowColumnLayout( nc=1, cw=[(1,columnWidth)] )
     cmds.text( l='', h=5 )
     fd_cutName = cmds.textFieldGrp( l='Cut Path : ', cw=[(1,firstWidth),(2,secondWidth)],
                                     cc=self.cmdChangeCutName )
     pu_cutName = cmds.popupMenu()
     cmds.text( l='', h=5 )
     cmds.separator()
     cmds.text( l='', h=5 )
     
     fd_sceneName = cmds.textFieldGrp( l='Scene Path : ', cw=[(1,firstWidth),(2,secondWidth)],
                                     cc=self.cmdChangeSceneName )
     pu_sceneName = cmds.popupMenu()
     
     cmds.window( self.winName, e=1,
                  w = self.width, h = self.height )
     cmds.showWindow( self.winName )
     
     self.fd_cutName = fd_cutName
     self.pu_cutName = pu_cutName
开发者ID:jonntd,项目名称:mayadev-1,代码行数:29,代码来源:view.py

示例14: ui

def ui():
	'''
	'''
	# Window
	window = 'transformDrivenBlendUI'
	if mc.window(window,q=True,ex=1): mc.deleteUI(window)
	window = mc.window(window,t='Transform Driven Blend')
	
	# Layout
	cl = mc.columnLayout()
	
	# UI Elements
	driveAttrTFG = mc.textFieldGrp('tdb_driveAttrTFG',label='Drive Attr', text='')
	blendShapeTFG = mc.textFieldGrp('tdb_blendShapeTFG',label='BlendShape', text='')
	target1TFG = mc.textFieldGrp('tdb_target1TFG',label='Target 1', text='',cc='glTools.ui.transformDrivenBlend.refreshUI()')
	target2TFG = mc.textFieldGrp('tdb_target2TFG',label='Target 2', text='',cc='glTools.ui.transformDrivenBlend.refreshUI()')
	weight1FFG = mc.floatFieldGrp('tdb_weight1FFG',numberOfFields=1,label='Weight 1',v1=1.0)
	weight2FFG = mc.floatFieldGrp('tdb_weight2FFG',numberOfFields=1,label='Weight 2',v1=-1.0)
	overlapFFG = mc.floatFieldGrp('tdb_overlapFFG',numberOfFields=1,label='Overlap',v1=0.0)
	prefixTFG = mc.textFieldGrp('tdb_prefixTFG',label='Prefix', text='')
	createB = mc.button('tdb_createB',label='Create',c='glTools.ui.transformDrivenBlend.executeFromUI()')
	refreshB = mc.button('tdb_refreshB',label='Refresh',c='glTools.ui.transformDrivenBlend.refreshUI()')
	cancelB = mc.button('tdb_cancelB',label='Cancel',c='mc.deleteUI('+window+')')
	
	# Popup Menus
	mc.popupMenu('tdb_blendShapePUM',p=blendShapeTFG)
	mc.popupMenu('tdb_target1PUM',p=target1TFG)
	mc.popupMenu('tdb_target2PUM',p=target2TFG)
	mc.popupMenu('tdb_driveAttrPUM',p=driveAttrTFG)
	mc.menuItem(label='Set from selected',c='glTools.ui.utils.loadChannelBoxSel("'+driveAttrTFG+'")')
	
	# Show Window
	refreshUI()
	mc.showWindow(window)
开发者ID:auqeyjf,项目名称:glTools,代码行数:34,代码来源:transformDrivenBlend.py

示例15: attachToMeshFromUI

def attachToMeshFromUI(close=False):
	'''
	Execute attachToMesh() from UI
	'''
	# Window
	window = 'attachToMeshUI'
	if not mc.window(window,q=True,ex=1): raise UIError('SnapToSurface UI does not exist!!')
	# Get UI data
	mesh = mc.textFieldGrp('attachToMeshTFB',q=True,text=True)
	# Check surface
	if not glTools.utils.mesh.isMesh(mesh):
		raise Exception('Object "'+surface+'" is not a valid nurbs surface!!')
	# Transform
	obj = mc.textFieldGrp('attachToMeshTransformTFB',q=True,text=True)
	# Prefix
	pre = mc.textFieldGrp('attachToMeshPrefixTFG',q=True,text=True)
	# Orient
	orient = mc.checkBoxGrp('attachToMeshOrientCBG',q=True,v1=True)
	# Orient Options
	normAx = str.lower(str(mc.optionMenuGrp('attachToMeshNormOMG',q=True,v=True)))
	tanAx = str.lower(str(mc.optionMenuGrp('attachToMeshTanOMG',q=True,v=True)))
	
	# Execute command
	glTools.utils.attach.attachToMesh(mesh=mesh,transform=obj,useClosestPoint=True,orient=orient,normAxis=normAx,tangentAxis=tanAx,prefix=pre)
	
	# Cleanup
	if close: mc.deleteUI(window)
开发者ID:auqeyjf,项目名称:glTools,代码行数:27,代码来源:mesh.py


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