• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python cmds.textField函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: browseDirectoryPath

 def browseDirectoryPath(self, *args):
     basicFilter = "*All(*.*);;tif(*.tif);;jpg(*.jpg);;exr(*.exr);;tx(*.tx)"
     self.returnPath = cmds.fileDialog2(
         fileFilter=basicFilter,
         ds=2,
         startingDirectory=self.homeDir)[0]
     cmds.textField(self.uvImagePath, e=True, text=self.returnPath)
开发者ID:minoue,项目名称:miUV,代码行数:7,代码来源:miUV.py


示例2: createAttribute

def createAttribute():
    if(not cmds.textField(tf01, text = True, query = True) == ''):
        niceName, longName = attrNameDefC()
        sel = selectListC()
        if(dataTypeC == 'float3'):
            for obj in sel:
                if(not cmds.attributeQuery(longName, node = obj, exists = True)):
                    cmds.addAttr(obj, niceName = niceName, longName = longName, usedAsColor = True, attributeType = dataTypeC)
                    cmds.addAttr(obj, longName = '%sR' % longName, attributeType = 'float', parent = longName)
                    cmds.addAttr(obj, longName = '%sG' % longName, attributeType = 'float', parent = longName)
                    cmds.addAttr(obj, longName = '%sB' % longName, attributeType = 'float', parent = longName)
        elif(dataTypeC == 'double3'):
            for obj in sel:
                if(not cmds.attributeQuery(longName, node = obj, exists = True)):
                    cmds.addAttr(obj, niceName = niceName, longName = longName, attributeType = dataTypeC)
                    cmds.addAttr(obj, longName = '%sX' % longName, attributeType = 'double', parent = longName)
                    cmds.addAttr(obj, longName = '%sY' % longName, attributeType = 'double', parent = longName)
                    cmds.addAttr(obj, longName = '%sZ' % longName, attributeType = 'double', parent = longName)
        elif(dataTypeC == 'string'):
            for obj in sel:
                if(not cmds.attributeQuery(longName, node = obj, exists = True)):
                    cmds.addAttr(obj, niceName = niceName, longName = longName, dataType = dataTypeC)
        else:
            for obj in sel:
                if(not cmds.attributeQuery(longName, node = obj, exists = True)):
                    cmds.addAttr(obj, niceName = niceName, longName = longName, attributeType = dataTypeC)
        cmds.textField(tf01, text = '', edit = True)
开发者ID:diegoinacio,项目名称:coding,代码行数:27,代码来源:mayaAiAttribManager.py


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


示例4: loadSurfaceGroup

 def loadSurfaceGroup(self, *args ):
     
     sels = cmds.ls( sl=1 )
     
     if not sels: cmds.error( "Select Surface Group" )
     
     children = cmds.listRelatives( sels[-1], c=1, ad=1 )
     
     if not children: cmds.error( "Select Surface Group" )
     
     
     surfaceGrp = ''
     
     for child in children:
         shapes = cmds.listRelatives( child, s=1 )
         if not shapes: continue
         for shape in shapes:
             if cmds.nodeType( shape ) == 'nurbsSurface':
                 surfaceGrp = sels[-1]
                 break
         if surfaceGrp: break
             
     if not surfaceGrp:
         cmds.error( "Select Surface Group" )
     
     cmds.textField( self._surfaceGroup, e=1, tx=surfaceGrp )
     
     if not cmds.attributeQuery( 'sets', node=surfaceGrp, ex=1 ):
         fnc.addArrayMessageAttribute( surfaceGrp, 'sets' )
         
     self.saveData()
开发者ID:jonntd,项目名称:mayadev-1,代码行数:31,代码来源:baseSetting.py


示例5: loadDirectoryPath

def loadDirectoryPath(textField,caption='Load Directory',startDir=None):
	'''
	Select a file path to load into a specified textField.
	@param textField: TextField UI object to load file path to
	@type textField: str
	@param caption: File selection UI caption string
	@type caption: str
	@param startDir: Directory to start browsing from. In None, use the default or last selected directory.
	@type startDir: str
	'''
	# Get File Path
	dirPath = mc.fileDialog2(	dialogStyle=2,
								fileMode=3,
								caption=caption,
								okCaption='Load',
								startingDirectory=startDir )
	
	# Check File Path
	if not dirPath:
		print('Invalid directory path!')
		return
	
	# Load File Path to TextField
	if mc.textField(textField,q=True,ex=True):
		mc.textField(textField,e=True,text=dirPath[0])
	elif mc.textFieldGrp(textField,q=True,ex=True):
		mc.textFieldGrp(textField,e=True,text=dirPath[0])
	elif mc.textFieldButtonGrp(textField,q=True,ex=True):
		mc.textFieldButtonGrp(textField,e=True,text=dirPath[0])
	else:
		print('UI element "'+textField+'" is of type "'+mc.objectTypeUI(textField)+'"! Expected textField, textFieldGrp or textFieldButtonGrp.')
		return
	
	# Return Result
	return dirPath[0]
开发者ID:auqeyjf,项目名称:glTools,代码行数:35,代码来源:utils.py


示例6: seqGUI

def seqGUI(parent):
	frm = cmds.frameLayout( label="Sequence", cll=True, w=winWidth-5,
		collapseCommand=Callback(winExpand, -70),
		expandCommand=Callback(winExpand, 70))
	frmCol = cmds.columnLayout(rs=3)
	cmds.checkBox( "mecRenSeqCB", label="On\Off", v=1)
	rowCol = cmds.rowColumnLayout("mecRenSeqRC", nc=2, cw=[[1,winWidth/2],[2,winWidth/2]],
		co=[[1,"right",5]])
	'''
	Older version.  Used Callback instead with a function that will enable or disable any gui component.	
	cmds.checkBox( "mecRenSeqCB", e=True, onc='%s.cmds.rowColumnLayout("mecRenSeqRC", e=True, en=True)' %scriptName)
	cmds.checkBox( "mecRenSeqCB", e=True, ofc='%s.cmds.rowColumnLayout("mecRenSeqRC", e=True, en=False)' %scriptName)
	'''
	cmds.checkBox( "mecRenSeqCB", e=True, onc=Callback(enGUI,"rowColumnLayout", "mecRenSeqRC", 1 ) )
	cmds.checkBox( "mecRenSeqCB", e=True, ofc=Callback(enGUI,"rowColumnLayout", "mecRenSeqRC", 0 ))
	
	cmds.textScrollList( "mecRenSeqTSL", h=40, ams=True )
	cmds.setParent(rowCol)
	subCol = cmds.columnLayout()
	rowWidth = winWidth/2
	cmds.rowColumnLayout(nc=2, w=rowWidth,
		cw=[[1,(rowWidth-70)], [2,60]])
	cmds.textField("mecRenSeqName", w=rowWidth-70 )
	cmds.button(label="Add",
		c=Callback(addTSL, "mecRenSeqTSL"))
	cmds.setParent(subCol)
	cmds.rowColumnLayout(nc=2, w=rowWidth,
		cw=[[1,rowWidth/2],[2,rowWidth/2-10]])
	cmds.button(label="Rem All",
		c=Callback(remAllTSL, "mecRenSeqTSL"))
	cmds.button(label="Rem Sel",
		c=Callback(remSelTSL, "mecRenSeqTSL"))
	cmds.setParent(parent)
开发者ID:creuter23,项目名称:fs-tech-artist,代码行数:33,代码来源:mecRenameTools.py


示例7: saveRenameText

	def saveRenameText(self):
		prefix = cmds.textField( 'prefixTextField', query=True, tx=True )
		groupIndex = cmds.textField( 'groupIndexTextField', query=True, tx=True )
		body = cmds.textField( 'bodyTextField', query=True, tx=True )
		itemIndex = cmds.textField( 'itemIndexTextField', query=True, tx=True )
		suffix = cmds.textField( 'suffixTextField', query=True, tx=True )

		if prefix in __main__.rroPrefix:
			__main__.rroPrefix.remove(prefix)
		if groupIndex in __main__.rroGroupIndex:
			__main__.rroGroupIndex.remove(groupIndex)
		if body in __main__.rroBody:
			__main__.rroBody.remove(body)
		if itemIndex in __main__.rroItemIndex:
			__main__.rroItemIndex.remove(itemIndex)
		if suffix in __main__.rroSuffix:
			__main__.rroSuffix.remove(suffix)

		__main__.rroPrefix.append(prefix)
		__main__.rroGroupIndex.append(groupIndex)
		__main__.rroBody.append(body)
		__main__.rroItemIndex.append(itemIndex)
		__main__.rroSuffix.append(suffix)

		self.setupPopupMenus()
开发者ID:Ryanagogo,项目名称:renameOrganizeSelected,代码行数:25,代码来源:renameOrganizeSelected.py


示例8: renameSelected

	def renameSelected(self,*args):
		ui.saveRenameText()
		self.setInitialGroupIndex()
		self.setInitialItemIndex()

		itemIndex = self.initialItemIndex
		groupIndex = self.initialGroupIndex
		switchIndex = cmds.checkBox( 'switchIndexesCheckBox', query=True, v=True )

		prefix = cmds.textField( 'prefixTextField', query=True, tx=True )
		body = cmds.textField( 'bodyTextField', query=True, tx=True )
		suffix = cmds.textField( 'suffixTextField', query=True, tx=True )

		groupIndexString = self.getGroupIndex(groupIndex)

		#give items a temp name, to help lessen chance of new name already existing
		#won't prevent it with items that exist outside of the selection
		for index,item in enumerate(cmds.ls( sl=True )):
			splitName = item.split('|')[-1]
			cmds.rename( item, splitName+'XXX'+str(index) )

		for item in cmds.ls( sl=True ):
			itemIndexString = self.getItemIndex(itemIndex)

			newName = prefix+groupIndexString+body+itemIndexString+suffix
			if switchIndex is True:
				newName = prefix+itemIndexString+body+groupIndexString+suffix

			cmds.rename( item, newName )

			itemIndex = itemIndex+1
开发者ID:Ryanagogo,项目名称:renameOrganizeSelected,代码行数:31,代码来源:renameOrganizeSelected.py


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


示例10: __init__

 def __init__(self):
     self.name = "rsSubstituteAttribute"
     self.title = "rs Substitute Attribute"
     i_windowSize = (300, 110)
     if (cmds.window(self.name, q=1, exists=1)):
         cmds.deleteUI(self.name)
     self.window = cmds.window(self.name, title=self.title)
     s_winColPro2 = cmds.columnLayout(adjustableColumn=True, parent=self.window)
     i_colum3 = (i_windowSize[0] / 6, i_windowSize[0] * 4 / 6, i_windowSize[0] / 6)
     s_winRowField1 = cmds.rowLayout(numberOfColumns=3, adjustableColumn3=2, columnWidth3=(i_colum3), columnAlign=(1, 'center'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)], parent=s_winColPro2)
     cmds.text(label='Source', align='center', parent=s_winRowField1)
     self.sourceText = cmds.textField(cmds.textField(), edit=True, parent=s_winRowField1)
     cmds.button(label='Pick up', c=self.rsPickUpSource, parent=s_winRowField1)
     s_winRowField2 = cmds.rowLayout(numberOfColumns=3, adjustableColumn3=2, columnWidth3=(i_colum3), columnAlign=(1, 'center'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)], parent=s_winColPro2)
     cmds.text(label='Target', align='center', parent=s_winRowField2)
     self.targetText = cmds.textField(cmds.textField(), edit=True, parent=s_winRowField2)
     cmds.button(label='Pick up', c=self.rsPickUpTarget, parent=s_winRowField2)
     cmds.separator(height=5, style="none", hr=True, parent=s_winColPro2)
     i_colum = i_windowSize[0] / 3
     s_winRow1 = cmds.rowLayout(numberOfColumns=3, adjustableColumn3=2, columnWidth3=(5, i_colum, i_colum), columnAlign=(1, 'center'), columnAttach=[(1, 'both', 0), (2, 'both', 0), (3, 'both', 0)], parent=s_winColPro2)
     cmds.separator(height=5, style="none", hr=True, parent=s_winRow1)
     self.delAttr = cmds.checkBox("rsDelSourceAttr", label='Delete Source Attribute', align='right', v=True, parent=s_winRow1)
     cmds.separator(height=5, style="none", hr=True, parent=s_winColPro2)
     self.rsSubs = cmds.button(label='Substitute or Clone', w=100, c=self.rsSubs, parent=s_winColPro2)
     cmds.window(self.window, e=1, w=430, h=103)
     cmds.showWindow(self.window)
     cmds.window(self.window, edit=True, widthHeight=(i_windowSize))
开发者ID:RigStudio,项目名称:rsSubstituteAttribute,代码行数:27,代码来源:rsSubstituteAttribute.py


示例11: positionReorderDoIt

def positionReorderDoIt(*args):
	meshes = []
	sourceMeshText = cmds.textField( 'sourceMeshTextField', query=True, text=True )

	if sourceMeshText == '':
		cmds.error('source mesh textfield is empty')

	if cmds.objExists(sourceMeshText) == False:
		cmds.error('the source mesh ( '+sourceMeshText+' ) does not exist')

	if cmds.nodeType(sourceMeshText) != 'mesh':
		shapes = cmds.listRelatives( sourceMeshText, shapes=True )

		if shapes is None or len(shapes) < 1 or cmds.nodeType(shapes[0]) != 'mesh':
			cmds.error('source ( '+sourceMeshText+' ) is not a mesh')

	meshes.append( sourceMeshText )

	destinationMeshText = cmds.textField( 'destinationMeshTextField', query=True, text=True )
	
	if destinationMeshText == '':
		cmds.error('destination mesh textfield is empty')

	if cmds.objExists(destinationMeshText) == False:
		cmds.error('the destination mesh ( '+destinationMeshText+' ) does not exist')

	if cmds.nodeType(destinationMeshText) != 'mesh':
		shapes = cmds.listRelatives( destinationMeshText, shapes=True )

		if shapes is None or len(shapes) < 1 or cmds.nodeType(shapes[0]) != 'mesh':
			cmds.error('destination ( '+destinationMeshText+' ) is not a mesh')

	meshes.append( destinationMeshText )

	positionReorder( meshes=meshes )
开发者ID:Ryanagogo,项目名称:reorderVertexIDs,代码行数:35,代码来源:reorderVertexIDs.py


示例12: loadInfo

 def loadInfo( *args ):
     import sgBFunction_fileAndPath
     
     sceneBakeInfoPath = sgBFunction_fileAndPath.getSceneBakeInfoPath()
     
     sgBFunction_fileAndPath.makeFile( WinA_Global.filePathInfo, False )
     cmds.textField( WinA_Global.exportPath_txf, e=1, tx= sceneBakeInfoPath )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:7,代码来源:sgPWindow_data_sceneBakeInfo_export.py


示例13: createUI

def createUI( pWindowTitle):
	
	windowID = 'myWindowID'
	
	if cmds.window(windowID , exists = True):
		cmds.deleteUI(windowID)
		
	cmds.window(windowID , title = pWindowTitle , sizeable = False , resizeToFitChildren = True)
	
	cmds.rowColumnLayout( numberOfColumns = 3 , columnWidth =[(1,200) , (2,200) , (3,200)])
	
	cmds.separator ( h = 30 , style = 'none')
	cmds.separator ( h = 30 , style = 'none')
	cmds.separator ( h = 30 , style = 'none')
	
	cmds.text(label = 'Enter the path of the code')
	cmds.textField('path')
	
	cmds.separator ( h = 30 , style = 'none')
	
	cmds.separator ( h = 30 , style = 'none')
	cmds.separator ( h = 30 , style = 'none')
	cmds.separator ( h = 30 , style = 'none')
	
	cmds.button(label = 'Generate' , command = generate)	
	cmds.separator ( h = 30 , style = 'none')
	cmds.button(label = 'Build' , command = build)
	
	cmds.separator ( h = 30 , style = 'none')
	cmds.separator ( h = 30 , style = 'none')
	cmds.separator ( h = 30 , style = 'none')	

	
	cmds.showWindow()
开发者ID:soumitrasaxena,项目名称:RigToolsBeta,代码行数:34,代码来源:AutoRigger.py


示例14: openSelectedCallback

        def openSelectedCallback(self,*args):
                """
                This method is called on double click selected item in textscrollList
                """
                #try block also saves from error caused by directories that we do not have rights to access.
                cMsg="Selected scene file is already open. Do you want to reload it?\n If you reload all changes you made since last save will be lost."
                try:
                        cmds.button('upBtn',edit=True,enable=True)
                        self.selectedItem=str(os.path.join(cmds.textField('location',q=True,tx=True),str(cmds.textScrollList('fileLister',q=True,si=True)[0]).split(" > ")[0])).replace("/","\\")

                        if (self.selectedItem.endswith("ma")) or (self.selectedItem.endswith("mb")):
                                print "selected Item: %s\n scene Open: %s"%(self.selectedItem , cmds.file(q=True,sn=True))
                                if self.selectedItem==cmds.file(q=True,sn=True).replace("/","\\"):
                                        print "Same Scene"
                                        result=cmds.confirmDialog(t='Warning',m=cMsg,button=['Yes','No'], defaultButton='Yes', cancelButton='No', dismissString='No' )
                                        if result== "Yes":
                                                state= cmds.file(self.selectedItem,open=True, f=True)
                                else:
                                        print"Saved scene file %s"%os.path.basename(cmds.file(q=True,sn=True))
##                      if not cmds.file(q=True,save=True):
##                         cmds.file(save=True)
                                        state= cmds.file(self.selectedItem,open=True, f=True)
                        else:
                                if os.path.isdir(self.selectedItem):
                                        cmds.textField('location',edit=True,tx=self.selectedItem)
                                        self.populatescrollList(self.selectedItem.replace("/","\\"))

                except Exception as e:
                        print e
开发者ID:sanfx,项目名称:pythonScripts,代码行数:29,代码来源:minime.py


示例15: searchReplaceSelectedChains

	def searchReplaceSelectedChains(self,*args):
		ui.saveSearchReplaceText()
		self.search = cmds.textField( 'searchTextField', query=True, tx=True )
		self.replace = cmds.textField( 'replaceTextField', query=True, tx=True )

		for index,parentJoint in enumerate( cmds.ls( sl=True ) ):
			self.searchReplaceChain( parentJoint )
开发者ID:Ryanagogo,项目名称:renameOrganizeSelected,代码行数:7,代码来源:renameOrganizeSelected.py


示例16: populatescrollList

        def populatescrollList(self,newLocation=None):
                """Edit textScrollList and update with selected location"""

                hideTheseFolders=["thumb", ".thumb",".mayaSwatches","RECYCLER","$AVG",
                                  "$Recycle.Bin","$RECYCLE.BIN","INCINERATE","Config.Msi",".dropbox.cache"
                                  "System Volume Information","Recovery","ProgramData","PROGRAMDATA",
                                  "PerfLogs"]


                if newLocation==None: locationTxt=cmds.textField('location',q=True,tx=True)
                else: locationTxt=newLocation

                cmds.textScrollList('fileLister', edit=True,removeAll=True)
                try:
                        [cmds.textScrollList('fileLister', edit=True,append=each) for each in os.listdir(locationTxt)  if os.path.isdir(os.path.join(locationTxt,each)) and each not in hideTheseFolders]
                        [cmds.textScrollList('fileLister', edit=True,ams=False, append=self.sizeof(os.path.join(locationTxt,each))) for nfile in self.fileFilters for each in os.listdir(locationTxt) if each.endswith(nfile)]
                except:
                        insel= cmds.textField('location',q=True,tx=True)
                        if not os.path.exists(insel):
                                msg="You either moved or renamed %s project folder\n Or the Drive that contained this folder is not connected."%os.path.basename(insel)
                                api.MGlobal.displayWarning(msg)
                                reply=cmds.confirmDialog(t='Warning',msg="Selected favrite item not found on disk.\nDo you want to delete it?",button=['Yes','No'], defaultButton='Yes', cancelButton='No', dismissString='No' )
                                if reply =="Yes":
                                        accAction=Actions()
                                        accAction.removeSel()
                                else:
                                        pass
开发者ID:sanfx,项目名称:pythonScripts,代码行数:27,代码来源:minime.py


示例17: cmdLoadSelected

 def cmdLoadSelected(self):
     
     if self._olnyAddCommand:
         if type( self._addCommand ) in [ type(()), type([]) ]:
             for command in self._addCommand: command()
         else:
             self._addCommand()
         return None
     
     sels = cmds.ls( sl=1, sn=1 )
     if not sels: return None
     
     if self._type == 'single':
         cmds.textField( self._field, e=1, tx=sels[-1] )
     else:
         popupTxt = ''
         for sel in sels:
             popupTxt += sel + ' '
         cmds.textField( self._field, e=1, tx=popupTxt[:-1] )
     
     if self._addCommand:
         if type( self._addCommand ) in [ type(()), type([]) ]:
             for command in self._addCommand: command()
         else:
             self._addCommand()
开发者ID:jonntd,项目名称:mayadev-1,代码行数:25,代码来源:makeCloneObject.py


示例18: uiNameLoadedAutoNameObject

def uiNameLoadedAutoNameObject(self):
	autoNameObject = mc.textField(self.AutoNameObjectField,q=True,text = True)
	if autoNameObject:
		newName = NameFactoryOld.doNameObject(autoNameObject,True)
		mc.textField(self.AutoNameObjectField,e = True,text = newName)
	else:
		guiFactory.warning('No current autoname object loaded!')
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:7,代码来源:namingToolsLib.py


示例19: createGeometryButtonAction

def createGeometryButtonAction(*pArgs):
    """ Queries all the fields related to the geometry interpretation and calls the procedure. """
    pAngle = cmds.floatSliderGrp( "angle", q=True, v=True )
    pStep = cmds.floatSliderGrp( "length", q=True, v=True )
    pRad = cmds.floatSliderGrp( "radius", q=True, v=True )
    subDivs = cmds.intSliderGrp( "cylSubdivs", q=True, v=True )
    length_atenuation = cmds.intSliderGrp( "length_atenuation", q=True, v=True )
    radius_atenuation = cmds.intSliderGrp( "radius_atenuation", q=True, v=True )
    turtleSpeed = cmds.floatSliderGrp( "turtleSpeed", q=True, v=True)
    rgb_blossom = cmds.colorSliderGrp( "rgb_blossomField", q=True, rgb=True )
    rgb_leaf = cmds.colorSliderGrp( "rgb_leafField", q=True, rgb=True )
    rgb_branch = cmds.colorSliderGrp( "rgb_branchField", q=True, rgb=True )

    if pAngle == 0 or pStep == 0 or pRad == 0 or subDivs == 0 or LStringVar == '':
        cmds.textField('warningsTextField', edit=True, tx='Please, revise all the fields again')  
    else:
        import globalVar
        reload(globalVar)
        globalVar.plantNumber += 1
        cmds.textField('warningsTextField', edit=True, tx='None.')
        createBranchShader(rgb_branch)
        createLeafShader(rgb_leaf)
        createBlossomShader(rgb_blossom)
        createGeometry(LStringVar, pRad, pStep, pAngle, subDivs, length_atenuation/100.0, radius_atenuation/100.0,
            turtleSpeed, rgb_branch, rgb_leaf, rgb_blossom)
开发者ID:docwhite,项目名称:LSystemsMaya,代码行数:25,代码来源:gui.py


示例20: openFile

 def openFile(self, *args):
     """
     This opens the file browser and takes the path and puts it in the text field. This is run when the Browse button is
     pressed.
     """
     self.fileName = cmds.fileDialog2( fileMode=2, caption="Import Image" ) # Open the file browser
     cmds.textField( self.loadDirPath, edit=True, text=str(self.fileName[0]) ) # Put path in text field
开发者ID:docwhite,项目名称:TowersOfHanoi,代码行数:7,代码来源:startup.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cmds.textFieldButtonGrp函数代码示例发布时间:2022-05-27
下一篇:
Python cmds.text函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap