资源简介
自己写的。哈哈哈哈。第一个python练手器,使用了python.
代码片段和文件信息
import maya.cmds as cmds
import maya.mel as mel
if cmds.window(“cq1516_superRename“exists=True) == True:
cmds.deleteUI (“cq1516_superRename“window=True)
cmds.window(“cq1516_superRename“title=“superRename v1.0 by renyg 08/13/2014“sizeable = 0)
cmds.rowColumnLayout(numberOfColumns=2 columnWidth=[(1 300) (2 150)])
leftColumn = cmds.columnLayout(adjustableColumn=1)
cmds.setParent(“..“)
rightColumn = cmds.columnLayout(adjustableColumn=1)
#---------leftColumn-----------------
cmds.setParent(leftColumn)
#tabs
cmds.text( label=(“““press Enter to previewpress OK to changeName
rename method:“““) align=‘center‘)
tabs = cmds.tabLayout()
#------prefix_
leftSubColumn1 = cmds.columnLayout(rowSpacing=10adjustableColumn=1)
cmds.rowColumnLayout( numberOfColumns=3 columnWidth=[(1 80) (2 60) (3 80)] )
cmds.text( label=‘prefix‘ align=‘center‘ )
cmds.text( label=‘ ‘ align=‘left‘ )
cmds.text( label=‘suffix‘ align=‘center‘ )
prfixtext_Control = cmds.textField(changeCommand=(“changeName1(prfixtext_Controlsufixtext_Control)“)enterCommand=(“changeName1(prfixtext_Controlsufixtext_Control)“))
cmds.text( label=‘oldName‘ align=‘center‘ )
sufixtext_Control = cmds.textField(changeCommand=(“changeName1(prfixtext_Controlsufixtext_Control)“)enterCommand=(“changeName1(prfixtext_Controlsufixtext_Control)“))
cmds.setParent(“..“)
cmds.columnLayout(adjustableColumn=1 )
cmds.button(label = “OK“command=(“doIt()“))
cmds.setParent(“..“)
cmds.setParent(“..“)
#----replace
leftSubColumn2 = cmds.columnLayout(adjustableColumn=1columnAlign=“left“rowSpacing=10)
find_Control = cmds.textFieldGrp(label=‘Find:‘ text=‘‘ columnWidth2=(50200) changeCommand=(“changeName2(find_Controlreplace_Control)“ ))
replace_Control = cmds.textFieldGrp( label=‘replace:‘ text=‘‘columnWidth2=(50200)changeCommand=(“changeName2(find_Controlreplace_Control)“))
cmds.button(label = “OK“command=(“doIt()“))
cmds.setParent(“..“)
#----number
leftSubColumn3 = cmds.columnLayout(adjustableColumn=1rowSpacing=10)
cmds.rowColumnLayout( numberOfColumns=3 columnWidth=[(1 120) (2 70)(380)] )
cmds.text( label=‘name‘ align=‘center‘)
cmds.text( label=‘hyphens ‘ align=‘center‘ )
cmds.text( label=‘startNumber‘ align=‘center‘ )
name_Control = cmds.textField(text=‘‘changeCommand=(“changeName3(name_Controlhypnes_Controlnumber_Control)“)enterCommand=(“changeName3(name_Controlhypnes_Controlnumber_Control)“))
hypnes_Control = cmds.textField(text=‘‘changeCommand=(“changeName3(name_Controlhypnes_Controlnumber_Control)“)enterCommand=(“changeName3(name_Controlhypnes_Controlnumber_Control)“))
number_Control
评论
共有 条评论