本文整理汇总了Python中maya.cmds.optionMenu函数的典型用法代码示例。如果您正苦于以下问题:Python optionMenu函数的具体用法?Python optionMenu怎么用?Python optionMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了optionMenu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: playBlast
def playBlast(self,*args):
"""
Create instance of BlastMaster, then
play blast based on user settings.
If play blast is successful, Write persistent data to TG_BM_NODE
"""
#Get the scene name and format it for display
sceneName = ' '
temp = cmds.file(query=True,sn=True)
if(temp): #Not empty
temp2 = os.path.split(temp)
sceneName = temp2[1]
#SequenceShot.Take from file name
info = sceneName[:-3]
#Pass GUI data as a dictionary
guiData = {
'info':info,
'name':cmds.textFieldGrp(self.nameField,query=True,text=True),
'comment':cmds.textFieldGrp(self.commentField,query=True,text=True),
'camera':cmds.optionMenu(self.camMenu,query=True,value=True),
'phase':cmds.optionMenu(self.phaseMenu,query=True,value=True),
'image':cmds.textFieldButtonGrp(self.imageField,query=True,text=True),
'slate':cmds.textFieldButtonGrp(self.slateField,query=True,text=True),
'maya_scene':sceneName,
'dir':cmds.textFieldGrp(self.dirField,query=True,text=True)}
blast = bm.BlastMaster()
blast.playBlast(guiData)
开发者ID:Mauricio3000,项目名称:MSH_Maya,代码行数:30,代码来源:BlastMaster_GUI.py
示例2: saveToNW
def saveToNW(self, *pArgs):
self.nameOfCurr = self.getNameOfFile()
self.filepathnew = os.path.dirname(self.nameOfCurr)
#print filepath, nameOfCurr
versionslocal = []
matchObj = re.match( r'.*\\(.+)\..+', self.nameOfCurr, re.M|re.I)
if matchObj:
substringForName=matchObj.group(1)[:-5]
for f in os.listdir(self.filepathnew):
if substringForName in f:
addThis = f[-6:-3]
versionslocal.append(addThis)
versionslocal = sorted(versionslocal)
theversionToOpen = versionslocal[len(versionslocal)-1]
temp = str((int(theversionToOpen)+1)).zfill(3)
subs = self.nameOfCurr.replace(self.nameOfCurr[-6:-3], temp)
print subs
print temp
print theversionToOpen
cmds.file(rename = subs)
cmds.file(save = True)
de=cmds.optionMenu( "deptList", query = True, value = True)
sc=cmds.optionMenu( "sceneList", query = True, value = True)
self.comboChBgLoad(de, sc)
#print "Saved to: %s" % subs
self.makeSaveVisible()
"""
开发者ID:sid2364,项目名称:Maya_Python,代码行数:28,代码来源:ShotManager_SidProj_FINAL_SHELF.py
示例3: ruMainWindow
def ruMainWindow():
ruWin = "riggUtils"
if mc.window(ruWin,q=True,ex=True):
mc.deleteUI(ruWin)
mc.window(ruWin,title = "Rigging Utilities")
mc.scrollLayout(horizontalScrollBarThickness=16)
ruMainColumn = mc.columnLayout(columnAttach=("both",5),rowSpacing=10,columnWidth=320)
mc.frameLayout(label="General",bs="etchedOut",w=300,mw=5,cll=1)
mc.button(label='Show Axis',command='mc.toggle(state=True, localAxis=True)')
mc.button(label='Hide Axis',command='mc.toggle(state=False, localAxis=True)')
mc.frameLayout(label="Non T-Pose joint placer",bs="etchedOut",w=300,mw=5,cll=1,p=ruMainColumn)
mc.columnLayout(rs=5,adj=1)
mc.button(l="Create Helper Locator",c =ruCreateLocator)
mc.button(l="Create Joint on Helper Locator",c =ruCreateJointLocator)
mc.floatSliderGrp("ruJointRadius",en=1,label="Joint Radius",field=True,minValue=0,maxValue=5,fieldMinValue=0,fieldMaxValue=5,value=0.5,cw3=(70,30,10),dc=ruJointRadius)
mc.frameLayout(label="Fingers Utils",bs="etchedOut",w=300,mw=5,cll=1,p=ruMainColumn)
mc.columnLayout(rs=5,adj=1)
mc.floatSliderGrp("ruJointOrientation",en=1,label="Finger Orient",field=True,minValue=0,maxValue=5,fieldMinValue=0,fieldMaxValue=5,value=0.5,cw3=(70,30,10),dc=ruOrientJoint)
mc.frameLayout(label="Finger Renaming",bs="etchedOut",w=300,mw=5,cll=1)
mc.optionMenu('ruFinger',l='Choose finger')
mc.menuItem(l='Thumb')
mc.menuItem(l='Index')
mc.menuItem(l='Middle')
mc.menuItem(l='Ring')
mc.menuItem(l='Pinky')
mc.textFieldButtonGrp( label='Template string', text='', buttonLabel='Rename', bc=ruRenameFinger, cw3=[120,70,70],ct3=['left','left','left'],co3=[2,2,2] )
mc.showWindow(ruWin)
开发者ID:Mortaciunea,项目名称:bdScripts,代码行数:31,代码来源:riggUtils.py
示例4: 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
示例5: switch_module
def switch_module(self,dishName,dishFile,*args):
archive = zipfile.ZipFile(dishFile, 'r')
jsonFile = archive.read('dish.ini')
jsondata = json.loads(jsonFile)
archive.close()
#Clear chld
chldrn = mc.layout( self.InfosTab, query=True, childArray=True )
for chld in chldrn:
mc.deleteUI(chld)
#-------------------------------------------------------------------
mc.columnLayout( adjustableColumn=True ,p=self.InfosTab ,rs=5)
header = """<html>
<body>
<h1>%s</h1></body>
</html>
"""%(dishName )
self.dishType = dishName
mc.text( self.module,e=True,l=header,font='boldLabelFont')
mc.scrollField( editable=False, wordWrap=True, text=jsondata['moduleInfos'] ,h=140)
mc.separator()
mc.text( l='name bank')
mc.columnLayout( adjustableColumn=True)
LimbMenu = mc.optionMenu( label='',w=224 )
mc.menuItem( label='NONE')
mc.setParent('..')
mc.button(l='Open name composer',h=28)
mc.optionMenu( LimbMenu ,e=True,changeCommand=partial(self.composePrfX,LimbMenu))
self.dishPrfx = mc.textField()
mc.button(l='Import', h=42,c=self.validate_dish_before_merge )
开发者ID:cedricB,项目名称:circeCharacterWorksTools,代码行数:32,代码来源:manager.py
示例6: read_windowInfo
def read_windowInfo():
import cPickle
import sgBFunction_fileAndPath
sgBFunction_fileAndPath.makeFile( WinA_Global.keyExportInfoFile, False )
sgBFunction_fileAndPath.makeFile( WinA_Global.cacheExportInfoFile, False )
sgBFunction_fileAndPath.makeFile( WinA_Global.infoPath, False )
import sgBModel_aniScene
upFolderNum, addPath = sgBModel_aniScene.exportCachePathFromAni
sceneName = cmds.file( q=1, sceneName=1 )
sceneFolder = '/'.join( sceneName.split( '/' )[:-1+upFolderNum] )
cacheExportPath = sceneFolder + addPath
upFolderNum, addPath = sgBModel_aniScene.exportKeyPathFromAni
sceneName = cmds.file( q=1, sceneName=1 )
sceneFolder = '/'.join( sceneName.split( '/' )[:-1+upFolderNum] )
keyExportPath = sceneFolder + addPath
cmds.textField( WinA_Global.exportKeyPath_txf, e=1, tx=keyExportPath )
cmds.textField( WinA_Global.exportCachePath_txf, e=1, tx=cacheExportPath )
try:
f = open( WinA_Global.infoPath, 'r' )
data = cPickle.load( f )
f.close()
cacheTypeIndex = data[0]
exportByMatrix = data[1]
cmds.optionMenu( WinA_Global.optionMenu, e=1, sl=cacheTypeIndex )
cmds.checkBox( WinA_Global.chk_exportByMatrix , e=1, v=exportByMatrix )
except: return None
开发者ID:jonntd,项目名称:mayadev-1,代码行数:35,代码来源:sgPWindow_file_keyAndCache_export.py
示例7: UI
def UI():
if cmds.window('FBXExport',ex=True):
cmds.deleteUI('FBXExport',wnd=True)
window = cmds.window('FBXExport',t='FBX Export Version 1.0.0',wh=(450,300),sizeable=False)
mainLayout = cmds.columnLayout(w=450, h=300)
cmds.menuBarLayout()
# cmds.menu(label ='About Me',helpMenu=True)
cmds.menu(label='File')
cmds.menuItem(label='About Me',c=AboutMe)
cmds.menuItem(label='Help',c=Help)
cmds.separator(st='in')
cmds.columnLayout(columnAlign='left', columnAttach=('both', 50), rowSpacing=30, columnWidth=420)
cmds.text(l='')
cmds.optionMenu(label ='ExportType:',changeCommand=printNewMenuItem)
cmds.menuItem( label='Export Selection' )
cmds.menuItem( label='Export All' )
cmds.rowColumnLayout(numberOfColumns=2)
cmds.textField("filepath",w=270,pht=configpath, bgc=(0.2,0.2,0.2))
cmds.button(l='path',w =50,h=20,c=browseFilePath)
cmds.setParent( '..' )
cmds.rowColumnLayout(numberOfColumns=2)
cmds.button(l='Name:',w =50,h=20,en=False)
cmds.textField('FileName',pht='Enter a filename',ed =True,w=270,bgc=(0.2,0.2,0.2))
cmds.setParent( '..' )
cmds.button(l='Export',bgc=(0.3,0.7,0.7),c=ExportFBX)
cmds.showWindow(window)
开发者ID:Jamesgary2015,项目名称:FBXExport,代码行数:30,代码来源:FBXExport.py
示例8: _find_att
def _find_att(self, getName):
getSel=cmds.ls(sl=1, fl=1)
if "," in getName:
getName=getName.split(", ")
else:
getName=[getName]
collectAttr=[]
for each in getSel:
print each
Attrs=[(attrItem) for attrItem in cmds.listAttr (each, w=1, a=1, s=1,u=1) for attrName in getName if attrName in attrItem]
if len(Attrs)>0:
for item in Attrs:
print item
newItem=each+"."+item
print newItem
collectAttr.append(newItem)
getChangeAttr=getAttr(collectAttr[0])
menuItems = cmds.optionMenu(self.attributeFirstSel, q=True, ill=True)
if menuItems:
cmds.deleteUI(menuItems)
getListAttr=sorted(collectAttr)
cmds.optionMenu(self.attributeFirstSel, e=1)
for each in getListAttr:
menuItem(label=each, parent=self.attributeFirstSel)
self.count_attr_output(getChangeAttr)
print getChangeAttr
开发者ID:edeglau,项目名称:storage,代码行数:26,代码来源:fetchattributelearn.py
示例9: _find_attV1
def _find_attV1(self, getFirstattr, attribute):
try:
getSel=ls(sl=1, fl=1)
getFirst=getSel[0]
except:
print "must select something"
return
if ", " in getFirstattr:
getFirstattr=getFirstattr.split(",")
else:
getFirstattr=[getFirstattr]
getSel=ls(sl=1, fl=1)
collectAttr=[]
for each in getFirstattr:
find=menuItem(each, q=1, label=1)
if each in find:
collectAttr.append(find)
optionMenu(self.attributeFirstSel, e=1, v=collectAttr[0])
newAttr=getattr(getSel[0],collectAttr[0])
select(newAttr, add=1)
getChangeAttr=getattr(getSel[0],collectAttr[0]).get()
menuItems = cmds.optionMenu(self.attributeFirstSel, q=True, ill=True)
if menuItems:
cmds.deleteUI(menuItems)
getListAttr=sorted(collectAttr)
cmds.optionMenu(self.attributeFirstSel, e=1)
for each in getListAttr:
menuItem(label=each, parent=self.attributeFirstSel)
self.count_attr_output(getChangeAttr)
print newAttr, getChangeAttr
开发者ID:edeglau,项目名称:storage,代码行数:30,代码来源:fetchattributelearn.py
示例10: modulesLayout
def modulesLayout():
moduleArm = moduleType('Arm')
moduleLeg = moduleType('Leg')
moduleSpine = moduleType('spine')
cmds.frameLayout(label='Prefix :',mw =1 ,mh =3,bs="etchedOut",cl= 0,cll=0,w=442)
cmds.rowColumnLayout (nc=4,cw=[(1,50),(2,90),(3,80),(4,100)])
cmds.text(l =" Name :",align="left" )
cmds.textField()
cmds.text(l =" Side : ",align="center" )
cmds.optionMenu (l='Method:')
cmds.menuItem(label ="l/r",c ="")
cmds.menuItem(label ="lt/rt",c ="")
cmds.menuItem(label= "left/right",c='')
cmds.menuItem(label= "custom",c='')
cmds.menuItem(label= "none",c='')
cmds.separator(height= 7,style ="none")
cmds.setParent('..')
cmds.rowColumnLayout (nc=3,cw=[(1,137),(2,137),(3,137)])
cmds.text(l ="Left :",align="center" )
cmds.text(l ="Center :",align="center" )
cmds.text(l ="Right : ",align="center" )
cmds.colorIndexSliderGrp('leftColorGrp',min =1 ,max= 31 ,value= 14 ,columnWidth=[(1,37),(2,100)])
cmds.colorIndexSliderGrp('centerColorGrp',min =1 ,max= 31 ,value= 23 ,columnWidth=[(1,37),(2,100)])
cmds.colorIndexSliderGrp('rightColorGrp',min =1 ,max= 31 ,value= 7 ,columnWidth=[(1,37),(2,100)])
cmds.setParent('..')
cmds.setParent('..')
cmds.separator(height =7 ,style= "none" )
cmds.scrollLayout(horizontalScrollBarThickness=16,verticalScrollBarThickness=16,h=285)
moduleArm.mainModule()
moduleLeg.mainModule()
moduleSpine.mainModule()
cmds.setParent('..')
cmds.button(l='Build Skeleton',h=50)
开发者ID:wangqinghuaTudou,项目名称:test,代码行数:35,代码来源:Ui.py
示例11: read_windowInfo
def read_windowInfo():
import cPickle
import sgBFunction_fileAndPath
if not os.path.exists( WinA_Global.infoPath ):
sgBFunction_fileAndPath.makeFile( WinA_Global.infoPath )
try:
f = open( WinA_Global.infoPath, 'r' )
data = cPickle.load( f )
f.close()
except: return None
if not data: return None
try:exportPath, exportType, searchFor, searchForType, splitStringAndSerchCheck, splitStringAndSearchString, cacheType, pointsSpace = data
except: return None
cmds.textField( WinA_Global.exportPath_txf, e=1, tx= exportPath )
items = cmds.radioCollection( WinA_Global.exportType_radio, q=1, cia=1 )
cmds.radioButton( items[ exportType ], e=1, sl=1 )
cmds.textField( WinA_Global.searchFor_txf, e=1, tx=searchFor )
items = cmds.radioCollection( WinA_Global.searchForType_radio, q=1, cia=1 )
cmds.radioButton( items[ searchForType ], e=1, sl=1 )
cmds.checkBox( WinA_Global.searchForType_check, e=1, v=splitStringAndSerchCheck )
cmds.textField( WinA_Global.searchForType_txf, e=1, tx=splitStringAndSearchString )
cmds.optionMenu( WinA_Global.om_cacheType, e=1, sl=cacheType )
cmds.optionMenu( WinA_Global.om_pointsSpace, e=1, sl=pointsSpace )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:29,代码来源:sgPWindow_data_cache_export.py
示例12: 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
示例13: _addEyeDialog
def _addEyeDialog(rbsNode):
form = cmds.setParent(q=True)
# used prefixes
idxPrfxList = _getEyeIdxPrfxList(rbsNode)
prfxList = [s[1] for s in idxPrfxList]
# available prefixes
availList = [s for s in _labelList if not s in prfxList]
# preferred prefix
selPrfx = None
for prfx in _orderedLabelList:
if prfx in availList:
selPrfx = prfx
break
menu = cmds.optionMenu(label='Please choose a name.\nUsually "L" or "R" ')
for l in availList:
cmds.menuItem(label=l)
if selPrfx:
cmds.optionMenu(menu, e=True, v=selPrfx)
sep = cmds.separator(style='none')
b = cmds.button(l='OK', c=lambda *x: cmds.layoutDialog(dismiss=cmds.optionMenu(menu, q=True, v=True)))
cmds.formLayout(form, e=True, attachForm=[(menu, 'top', 10), (menu, 'left', 10), (menu, 'right', 2), (b, 'bottom', 2), (b, 'left', 2), (b, 'right', 2)], attachControl=[(sep, 'top', 4, menu), (sep, 'bottom', 4, b)])
开发者ID:Bumpybox,项目名称:Tapp,代码行数:27,代码来源:ZvRadialBlendShape.py
示例14: loadShots
def loadShots(shot=None, showErr=False):
'''Load shots from the sheet for selected episod, and select shot after load if necessary.
If no sheet, read shots from episod directory.'''
episod = mc.optionMenu('optEpi', q=True, v=True).zfill(3)
shots = util.getShotsInSheet(episod)
#shots = None if ((episod == '002') or (episod == '003')) else util.getShotsInSheet(episod)
# Clear shots menuItems..
shotsOld = mc.optionMenu('optShot', q=True, ils=True)
if shotsOld:
for x in shotsOld:
mc.deleteUI(x, mi=1)
if not shots: # Find shots from episod directory and load
epiPath = '%s/%s/%s%s' % (util.path, util.deptDic['wkspcFldr'], util.epOrSeq, episod)
expr = '^sh[0-9]{3}[a-z]?'
if os.path.exists(epiPath):
shots = [ x[2:] for x in sorted(os.listdir(epiPath)) if re.search(expr, x) ]
if shots: # Add new list
for x in sorted(shots):
try:
mc.menuItem('shot'+x, l=x, p='optShot')
except:
pass
if shot:
try:
mc.optionMenu('optShot', e=True, v=shot)
except:
pass
displayLastVersion(showErr=showErr)
开发者ID:sid2364,项目名称:Maya_Python,代码行数:33,代码来源:shotManager_Toonz_Old.py
示例15: changeCharBgCombo
def changeCharBgCombo(self, *pArgs):
#helps load the models combobox from some locations
#gives the exact scene and dept presently selected
self.makeSaveInvisible()
deptCmb = cmds.optionMenu( "deptList", query = True, value = True)
sceneCmb = cmds.optionMenu( "sceneList", query = True, value = True)
self.comboChBgLoad(deptCmb, sceneCmb)
开发者ID:sid2364,项目名称:Maya_Python,代码行数:7,代码来源:ShotManager_PlugIn_Qt_Sid_v3.py
示例16: _find_value_obj
def _find_value_obj(self, getFirstattr, values):
# try:
# values=float(values)
# except:
# values=int(values)
# get_variable_type = type(values)
# if type == str:
# values = string(values)
# elif type == int:
# values = int(values)
# elif type == float:
# values = float(values)
print type(values)
getAll=cmds.ls("*")
collectAttr=[]
for each in getAll:
try:
Attrs=[(attrItem) for attrItem in cmds.listAttr (each, w=1, a=1, s=1,u=1) if cmds.getAttr(each+"."+attrItem)==values]
except:
pass
if len(Attrs)>0:
for item in Attrs:
newItem=each+"."+item
collectAttr.append(newItem)
menuItems = cmds.optionMenu(self.objAtt, q=True, ill=True)
if menuItems:
cmds.deleteUI(menuItems)
getListAttr=sorted(collectAttr)
cmds.optionMenu(self.objAtt, e=1)
for each in getListAttr:
menuItem(label=each, parent=self.objAtt)
开发者ID:edeglau,项目名称:storage,代码行数:31,代码来源:fetchattributelearn.py
示例17: loadSelectedObj
def loadSelectedObj():
cmds.file(new=True, pm=False, force=True)
selected = cmds.optionMenu(loadComponentsMenu, q=True, v=True)
global furniture
global furnitureFilePath
path = os.path.split(furnitureFilePath)[0] + "/meshes/furniture/"
menuItems = cmds.optionMenu(componentsMenu, q=True, itemListLong=True)
cmds.textField(objNameInput, tx=selected.split(".")[0].split("/")[1], e=True)
if menuItems:
cmds.deleteUI(menuItems)
for comp in furniture["components"] :
if comp["src"] == selected :
global currentComponent
componentDef = ""
with open(os.path.split(furnitureFilePath)[0]+"/"+comp["src"], "r") as componentFile:
componentDef = componentFile.read()
currentComponent = json.loads(componentDef)
cmds.file(path + currentComponent["src"], i=True)
for con in currentComponent["connectors"]: #for connectors in the current objects connectors
for types in con["componentTypes"]:
cmds.menuItem(p=componentsMenu, label=types)
for jnt in con["out"]:
loc = cmds.spaceLocator()
cmds.move(jnt["position"][0], jnt["position"][1], jnt["position"][2], loc)
cmds.scale(jnt["scale"][0], jnt["scale"][1], jnt["scale"][2], loc)
cmds.rotate(jnt["rotation"][0], jnt["rotation"][1], jnt["rotation"][2], loc)
updateJson()
selectLocators()
cmds.textField(typeInput, tx=currentComponent["type"], e=True)
开发者ID:SweetheartSquad,项目名称:Scripts,代码行数:31,代码来源:FurnitureComponentScript.py
示例18: _find_value
def _find_value(self, getFirstattr, values):
try:
values=float(values)
except:
values=int(values)
getSel=ls(sl=1, fl=1)
collectAttr=[]
for each in getFirstattr:
getSel=ls(getSel[0])
find=menuItem(each, q=1, label=1)
try:
foundAttr=getattr(getSel[0],find).get()
except:
pass
if foundAttr == values:
print foundAttr
collectAttr.append(find)
optionMenu(self.attributeFirstSel, e=1, v=collectAttr[0])
newAttr=getattr(getSel[0],collectAttr[0])
select(newAttr, add=1)
getChangeAttr=getattr(getSel[0],collectAttr[0]).get()
menuItems = cmds.optionMenu(self.attributeFirstSel, q=True, ill=True)
if menuItems:
cmds.deleteUI(menuItems)
getListAttr=sorted(collectAttr)
cmds.optionMenu(self.attributeFirstSel, e=1)
for each in getListAttr:
menuItem(label=each, parent=self.attributeFirstSel)
self.count_attr_output(getChangeAttr)
print newAttr, getChangeAttr
开发者ID:edeglau,项目名称:storage,代码行数:30,代码来源:fetchattributelearn.py
示例19: populate_render_layer_layout
def populate_render_layer_layout(self, attr):
if self.render_layer_layout is not None:
node = attr.split('.')[0]
# delete old ui
children = cmds.columnLayout(self.render_layer_layout, q=True, childArray=True)
if children is not None:
for name in children:
cmds.deleteUI(name)
for i in range(50):
i += 1
layer_name = 'render_layer_{0}_name'.format(i)
if cmds.attributeQuery(layer_name, exists=True, node=node):
cmds.setParent(self.render_layer_layout)
current_render_layer_layout = cmds.rowLayout(nc=5)
for n, width in enumerate(self.render_layer_layout_widths):
cmds.rowLayout(current_render_layer_layout, e=True, cw=[n + 1, width])
cmds.textField(cc=partial(self.set_render_layer_name, node, i), text=cmds.getAttr('{0}.render_layer_{1}_name'.format(node, i)))
entity_type_menu = cmds.optionMenu(cc=partial(self.set_render_layer_type, node, i))
for entity_type in ms_commands.RENDER_LAYER_ENTITY_TYPES:
cmds.menuItem(label=entity_type)
cmds.optionMenu(entity_type_menu, e=True, v=cmds.getAttr('{0}.render_layer_{1}_type'.format(node, i)))
pattern_text_field = cmds.textField(cc=partial(self.set_render_layer_pattern, node, i), text=cmds.getAttr('{0}.render_layer_{1}_pattern'.format(node, i)))
cmds.textField(cc=partial(self.set_render_layer_order, node, i), text=cmds.getAttr('{0}.render_layer_{1}_order'.format(node, i)))
cmds.button(' - ', height=20, command=partial(self.remove_render_layer, node, i))
cmds.setParent(self.render_layer_layout)
current_render_layer_layout = cmds.rowLayout(nc=2)
cmds.button(' + ', command=partial(self.add_render_layer, node))
开发者ID:jonathantopf,项目名称:mayaseed,代码行数:31,代码来源:AEms_renderSettingsTemplate.py
示例20: getRenderSettings
def getRenderSettings(self):
#get render settings
frCheck = cmds.menuItem(self._rs_mm_range, q=True, cb=True)
padCheck = cmds.menuItem(self._rs_mm_pad, q=True, cb=True)
resCheck = cmds.menuItem(self._rs_mm_res, q=True, cb=True)
fncCheck = cmds.menuItem(self._rs_mm_fnc, q=True, cb=True)
ofCheck = cmds.menuItem(self._rs_mm_of, q=True, cb=True)
rCheck = cmds.menuItem(self._rs_mm_r, q=True, cb=True)
pdCheck = cmds.menuItem(self._rs_mm_pd, q=True, cb=True)
rdCheck = cmds.menuItem(self._rs_mm_rd, q=True, cb=True)
fr, pad, res, fnc, of, r, pd, rd = None, None, None, None, None, None, None, None
renderers = ['default', 'rman', 'sw', 'mr']
if frCheck:
fr = [cmds.intField(self._rs_start, q=True, v=True), cmds.intField(self._rs_end, q=True, v=True)]
if padCheck:
pad = cmds.intField(self._rs_pad, q=True, v=True)
if resCheck:
res = [cmds.intField(self._rs_resW, q=True, v=True), cmds.intField(self._rs_resH, q=True, v=True)]
if fncCheck:
fnc = cmds.optionMenu(self._rs_fncOpt, q=True, v=True)
if ofCheck:
of = cmds.optionMenu(self._rs_ofOpt, q=True, v=True)
if rCheck:
r = renderers[cmds.optionMenu(self._rs_rOpt, q=True, sl=True)]
if pdCheck:
pd = cmds.textField(self._rs_pdField, q=True, tx=True)
if rdCheck:
rd = cmds.textField(self._rs_rdField, q=True, tx=True)
return {'range':fr, 'pad':pad, 'res':res, 'fnc':fnc, 'of':of, 'r':r, 'pd':pd, 'rd':rd}
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:30,代码来源:boBatchFileMaker.py
注:本文中的maya.cmds.optionMenu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论