本文整理汇总了Python中pymel.core.menu函数的典型用法代码示例。如果您正苦于以下问题:Python menu函数的具体用法?Python menu怎么用?Python menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了menu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: show
def show():
if pm.menu('alfredTools2', exists=True): pm.deleteUI('alfredTools2')
gMainWindow = pm.melGlobals['gMainWindow']
# 마야 상단에 메뉴 생성
alfredToolsMenu = pm.menu('alfredTools2',
label = "Alfred Tools 2",
parent = gMainWindow,
tearOff = True,
allowOptionBoxes = True,
#familyImage = familyImage,
#mnemonic = 'alfred', # 뭔지 모르겠음.
#helpMenu = True, # help메뉴 뒤로감
)
pm.menuItem( dl='Asset', divider=True, p=alfredToolsMenu )
pm.menuItem( l='Modeling', p=alfredToolsMenu, en=False )
pm.menuItem( l='Surfacing', p=alfredToolsMenu, c=pm.Callback( menuCmd_surfacing ) )
pm.menuItem( l='Rigging', p=alfredToolsMenu, c=pm.Callback( menuCmd_rig ) )
pm.menuItem( dl='Layout', divider=True, p=alfredToolsMenu )
pm.menuItem( l='Shot', p=alfredToolsMenu, c=pm.Callback(menuCmd_layout) )
pm.menuItem( dl='Animation', divider=True, p=alfredToolsMenu )
pm.menuItem( l='Animation', p=alfredToolsMenu, en=False )
pm.menuItem( l='Motion Capture', p=alfredToolsMenu, c=pm.Callback( menuCmd_motionCapture ) )
pm.menuItem( dl='FX', divider=True, p=alfredToolsMenu )
pm.menuItem( l='FX', p=alfredToolsMenu, en=False )
pm.menuItem( dl='Render', divider=True, p=alfredToolsMenu )
pm.menuItem( l='Scene Assembly', p=alfredToolsMenu, c=pm.Callback(menuCmd_sceneAssembly) )
pm.menuItem( l='Surfacing', p=alfredToolsMenu, c=pm.Callback( menuCmd_surfacing ) )
pm.menuItem( l='Lighting', p=alfredToolsMenu, en=False )
pm.menuItem( l='Render', p=alfredToolsMenu, c=pm.Callback(menuCmd_render) )
开发者ID:kyuhoChoi,项目名称:mayaTools,代码行数:31,代码来源:alfredMenu.py
示例2: show
def show( reset=False ):
if pm.about(batch=True):
print 'menu not available in batch mode.'
return
else:
# -- get things ready for building the menu
menu_name = "Impress Example"
pm.setParent( MAYA_WINDOW )
if pm.menu( menu_name, exists=True ):
if reset:
pm.deleteUI( menu_name )
else:
main_menu = pm.menu( menu_name, edit=True )
return main_menu
if not pm.menu( menu_name, exists=True ):
main_menu = pm.menu( menu_name, tearOff=True )
# -- build the menu
with main_menu:
with pm.subMenuItem( 'Display', aob=True, tearOff=True ):
ui.commandMenuItem( performExample )
开发者ID:kinetifex,项目名称:maya-impress,代码行数:25,代码来源:menu_example.py
示例3: mantraMainMenu
def mantraMainMenu():
log.debug("Creating mantra main menu")
menuName = "Mantra"
if pm.menu(menuName, query=True, exists=True):
pm.deleteUI(menuName)
gMainWindow = pm.mel.eval('$tmpVar=$gMainWindow')
mantraMenu = pm.menu(menuName, label=menuName, parent=gMainWindow, tearOff=True)
pm.menuItem(label='Create Geo Standin', command=pm.Callback(menuCallback, "GeoStandin"))
pm.setParent("..", menu=True)
开发者ID:MassW,项目名称:OpenMaya,代码行数:9,代码来源:mtm_initialize.py
示例4: create_tank_disabled_menu
def create_tank_disabled_menu(menu_name):
"""
Render a special "shotgun is disabled menu"
"""
if pm.menu("ShotgunMenu", exists=True):
pm.deleteUI("ShotgunMenu")
sg_menu = pm.menu("ShotgunMenuDisabled", label=menu_name, parent=pm.melGlobals["gMainWindow"])
pm.menuItem(label="Sgtk is disabled.", parent=sg_menu,
command=lambda arg: tank_disabled_message())
开发者ID:framestore,项目名称:tk-maya,代码行数:10,代码来源:engine.py
示例5: ui
def ui():
if pm.window("Depth tool", q=True, exists=True):
pm.deleteUI("Depth tool")
with pm.window("Depth tool", menuBar=True, s=False):
pm.menu(l="help")
pm.menuItem(l="document", c=pm.Callback(os.system, "D:/Users/blood/Desktop/eyeTest_01.mov"))
pm.menuItem(l="tutorial", c=pm.Callback(pm.launch, web="https://www.youtube.com/watch?v=-JwXfnrX1wM"))
with pm.columnLayout(adj=True):
with pm.rowLayout(nc=2):
pm.button(l="Create" + "\n" + "Depth", w=64, h=64, bgc=(0.2, 0.2, 0.2), c=creatAll)
pm.button(l="Adjust" + "\n" + "Min&&Max", w=64, h=64, bgc=(0.8, 0.8, 0.8), c=adjustAll)
开发者ID:kyuhoChoi,项目名称:mayaTools,代码行数:11,代码来源:aiDepth.py
示例6: __init__
def __init__(self):
if pm.window(self.uiID, exists=True):
pm.deleteUI(self.uiID)
win = pm.window(self.uiID, title=self.title, menuBar=True)
with win:
pm.menu( label='Create', tearOff=True )
for type in deformerTypes:
pm.menuItem( label=type, c=pm.Callback( self.initPlugin, type) )
self._parentLayout = pm.columnLayout( adj=True )
with self._parentLayout:
self.createUISet()
开发者ID:saggita,项目名称:ProbeDeformerMaya,代码行数:11,代码来源:ui_probeDeformer.py
示例7: lcCameraToolsUI
def lcCameraToolsUI(dockable=False, *args, **kwargs):
''' '''
ci = 0 #color index iterator
windowName = 'lcCameraTools'
shelfCommand = 'import lct.src.lcCameraTools.lcCameraTools as lcCam\nreload(lcCam)\nlcCam.lcCameraToolsUI()'
icon = basePath+'lcCameraTools.png'
winWidth = 204
winHeight = 209
mainWindow = lcWindow(windowName=windowName, width=winWidth, height=winHeight, icon=icon, shelfCommand=shelfCommand, annotation=annotation, dockable=dockable, menuBar=True)
mainWindow.create()
pm.menu(l='Options', helpMenu=True)
pm.menuItem(l='Reset Gradient Colors', command=lambda *args: cam_set_default_colors() )
#
pm.columnLayout(prefix+'_columLayout_main')
#
pm.rowColumnLayout(nc=2, cw=([1,50], [2,150]) )
pm.text(l='Edit:', al='right')
cameraListDropdown = pm.optionMenu(prefix+'_optionMenu_camera_list', bgc=colorWheel.getColorRGB(ci), w=150, h=25 )
ci+=1
cameraListDropdown.changeCommand(lambda *args: cam_get_cam_attrs(cameraListDropdown) )
pm.setParent(prefix+'_columLayout_main')
#
pm.rowColumnLayout(nc=2, cw=([1,125], [2,75]) )
pm.text(l='Focal Length:', al='right')
pm.floatField(prefix+'_floatField_focal_length', min=0.0, v=0.0, pre=1, w=75, changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown), receiveFocusCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) )
pm.text(l='Near Clip Plane:', al='right')
pm.floatField(prefix+'_floatField_near_clip_plane', min=0.0, v=0.0, pre=4, w=75, changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown), receiveFocusCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) )
pm.text(l='Far Clip Plane:', al='right')
pm.floatField(prefix+'_floatField_far_clip_plane', min=0.0, v=0.0, pre=0, w=75, changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown), receiveFocusCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) )
pm.text(l='Overscan:', al='right')
pm.floatField(prefix+'_floatField_overscan', min=0.0, v=0.0, pre=3, w=75, changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown), receiveFocusCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) )
pm.text(l='Background Color:', al='right')
pm.colorSliderGrp(prefix+'_colorSliderGrp_background_color', cw1=50, rgb=(0.0,0.0,0.0), changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) )
pm.text(l='Gradient Top:', al='right')
pm.colorSliderGrp(prefix+'_colorSliderGrp_gradient_top', cw1=50, rgb=(0.54,0.62,0.70), changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) )
pm.text(l='Gradient Bottom:', al='right')
pm.colorSliderGrp(prefix+'_colorSliderGrp_gradient_bottom', cw1=50, rgb=(0.1,0.1,0.1), changeCommand=lambda *args: cam_set_cam_attrs(cameraListDropdown) )
pm.setParent(prefix+'_columLayout_main')
#
pm.rowColumnLayout(nc=2, cw=([1,175], [2,25]) )
pm.button(prefix+'_button_toggle_bkgd', l='Toggle Background', bgc=colorWheel.getColorRGB(ci), w=200, h=25, annotation='Toggle between flat color and gradient background', command=lambda *args: camera.toggleBackground() )
ci+=1
pm.iconTextButton(w=25, h=25, style='iconOnly', image=iconBasePath+'addToShelf.png', highlightImage=iconBasePath+'addToShelf_over.png', annotation='Add to Shelf', command=lambda *args: shelf.makeShelfButton('Toggle Camera Background', 'from lct.src.core.lcUtility import Camera as camera\ncamera.toggleBackground()', iconBasePath+'toggleBackground.png', "Toggle Camera's Viewport Background") )
#
mainWindow.show()
cam_populate_camera_list(cameraListDropdown)
cam_get_cam_attrs(cameraListDropdown)
开发者ID:kotchin,项目名称:mayaSettings,代码行数:54,代码来源:lcCameraTools.py
示例8: __init__
def __init__(self):
if pm.window(self.uiID, exists=True):
pm.deleteUI(self.uiID)
win = pm.window(self.uiID, title=self.title, menuBar=True)
with win:
pm.menu( label='CageDeformer', tearOff=True )
pm.menuItem( label="CageDeformer", c=pm.Callback( self.initPlugin, "cage") )
pm.menuItem( label="CageDeformerARAP", c=pm.Callback( self.initPlugin, "cageARAP") )
self._parentLayout = pm.columnLayout( adj=True )
with self._parentLayout:
self.createUISet()
开发者ID:Leopardob,项目名称:CageDeformerMaya,代码行数:11,代码来源:ui_cageDeformer.py
示例9: mantraMainMenu
def mantraMainMenu():
log.debug("Creating mantra main menu")
menuName = "Mantra"
if pm.menu(menuName, query=True, exists=True):
pm.deleteUI(menuName)
gMainWindow = pm.mel.eval('$tmpVar=$gMainWindow')
mantraMenu = pm.menu(menuName, label = menuName, parent = gMainWindow, tearOff = True )
pm.menuItem( label = 'AttributeManager', command = Callback(menuCallback, "AttributeManager") )
pm.menuItem( label = 'DummyMenu' , command = Callback(menuCallback, "Dummy") )
pm.menuItem( label = '', divider = True )
pm.menuItem( label = 'DummyMenuA' , command = Callback(menuCallback, "DummyA") )
pm.setParent("..", menu = True)
开发者ID:MassW,项目名称:OpenMaya,代码行数:12,代码来源:mtm_initialize.py
示例10: mvgCreateMenu
def mvgCreateMenu():
gMainWindow = pm.mel.eval('$tmpVar=$gMainWindow')
menuName = "mvgMenu"
menuLabel = "MayaMVG"
if(pm.menu(menuName, exists=True)):
pm.deleteUI(menuName)
if(gMainWindow != ""):
pm.setParent(gMainWindow)
menu = pm.menu(menuName, label=menuLabel, tearOff=True)
pm.menuItem(parent=menu, label='Open...', command=pm.Callback(openMVGWindow_CB))
pm.menuItem(parent=menu, label='Export selection as ABC', command=pm.Callback(exportSelectionAsABC_CB))
pm.menuItem(parent=menu, label='Create locator from vertex', command=pm.Callback(createLocatorFromVertex_CB))
pm.menuItem(parent=menu, divider=True)
开发者ID:jonntd,项目名称:mayaMVG,代码行数:13,代码来源:menu.py
示例11: create_sgtk_disabled_menu
def create_sgtk_disabled_menu(menu_name):
"""
Render a special "shotgun is disabled" menu
"""
if cmds.about(batch=True):
# don't create menu in batch mode
return
if pm.menu("ShotgunMenu", exists=True):
pm.deleteUI("ShotgunMenu")
sg_menu = pm.menu("ShotgunMenuDisabled", label=menu_name, parent=pm.melGlobals["gMainWindow"])
pm.menuItem(label="Sgtk is disabled.", parent=sg_menu,
command=lambda arg: sgtk_disabled_message())
开发者ID:thirstydevil,项目名称:tk-maya,代码行数:14,代码来源:engine.py
示例12: UI_Build
def UI_Build(self):
"""Build the static UI and define the main layouts.
Keyword arguments:
none
"""
# Delete windows if already existing
if pc.window("lookdevAssistant", exists=True):
pc.deleteUI("lookdevAssistant")
# Main window
self.globalWidgets['window'] = pc.window("lookdevAssistant", menuBar=True, title="Arnold Lookdev assistant", sizeable=False, h=430, w=500)
# Menu bar
# |-- Creation Menu
self.globalWidgets['windowMenuCreate'] = pc.menu(label="Create")
pc.menuItem(label='new aiStandard', parent=self.globalWidgets['windowMenuCreate'], c=partial(self.Maya_createNode, 'aiStandard'))
pc.menuItem(label='new File', parent=self.globalWidgets['windowMenuCreate'], c=partial(self.Maya_createNode, 'file'))
pc.menuItem(label='new ygColorCorrect', parent=self.globalWidgets['windowMenuCreate'], c=partial(self.Maya_createNode, 'ygColorCorrect'))
pc.menuItem(divider=True)
# --|-- Create complete network Menu
self.globalWidgets['completeNetworkMenu'] = pc.menuItem(label='Complete network', parent=self.globalWidgets['windowMenuCreate'], subMenu=True, pmc=self.UI_refreshMenu)
self.globalWidgets['fromFile'] = pc.menuItem(l="from existing File...", subMenu=True, p=self.globalWidgets['completeNetworkMenu'])
pc.menuItem(l="from new File", c=partial(self.Maya_createFullNetwork, False, ''), p=self.globalWidgets['completeNetworkMenu'])
# |-- See on flat Menu
self.globalWidgets['windowMenuSeeOnFlat'] = pc.menu(label="See on flat")
pc.menuItem(label='Diffuse Color', parent=self.globalWidgets['windowMenuSeeOnFlat'], c=partial(self.Maya_focusOn, 'color'))
pc.menuItem(label='Specular Color', parent=self.globalWidgets['windowMenuSeeOnFlat'], c=partial(self.Maya_focusOn, 'KsColor'))
pc.menuItem(label='Specular Roughness', parent=self.globalWidgets['windowMenuSeeOnFlat'], c=partial(self.Maya_focusOn, 'specularRoughness'))
pc.menuItem(label='Bump', parent=self.globalWidgets['windowMenuSeeOnFlat'], c=partial(self.Maya_focusOn, 'normalCamera'))
pc.menuItem(divider=True, parent=self.globalWidgets['windowMenuSeeOnFlat'])
pc.menuItem(label='Revert to aiStandard', parent=self.globalWidgets['windowMenuSeeOnFlat'], c=self.Maya_revertToAiStd)
# Main layout : 2 columns / 1 for the list of the ai* shaders / 1 to access selected shader attributes
self.globalWidgets['mainLayout'] = pc.rowColumnLayout(nc=2, cw=[(1, 150), (2, 240)])
# Shaders list layout
self.globalWidgets['sListLayout'] = pc.frameLayout(label='Shaders list', borderStyle='etchedIn', cll=True, h=430 , parent=self.globalWidgets['mainLayout'])
self.sListWidgets['layout'] = pc.columnLayout(parent=self.globalWidgets['sListLayout'])
self.sListWidgets['list'] = pc.textScrollList(h=340, parent=self.sListWidgets['layout'])
self.sListWidgets['listRefreshButton'] = pc.button(l='Refresh', w=95, c=self.UI_refreshShaders)
# Shaders attributes layout
self.globalWidgets['sAttrLayout'] = pc.frameLayout(label='Shaders attributes', borderStyle='etchedIn', cll=True, h=430, parent=self.globalWidgets['mainLayout'])
# Setup all callbacks
self.UI_Callbacks()
开发者ID:ma55acre,项目名称:MayaDev,代码行数:50,代码来源:arnold_lookdevassist.py
示例13: ui
def ui():
#masking이란 윈도우가 있는지를 확인한다. q는 확인하다. exists는 존재여부를 체크한다.
if pm.window('masking', q=True, exists=True) :
pm.deleteUI('masking')
with pm.window('masking',menuBar=True, s=True):
pm.menu(l='help')
pm.menuItem(l='document', c=pm.Callback( os.system, "D:/Users/blood/Desktop/eyeTest_01.mov" ))
pm.menuItem(l='tutorial', c=pm.Callback( pm.launch, web="https://www.youtube.com/watch?v=-JwXfnrX1wM") )
with pm.columnLayout( adj=True ):
with pm.rowLayout(nc=4):
pm.button(l='', w=64, h=64, bgc=(1,0,0), c=redCmd )
pm.button(l='', w=64, h=64, bgc=(0,1,0), c=greenCmd )
pm.button(l='', w=64, h=64, bgc=(0,0,1), c=blueCmd)
pm.button(l='matte', w=64, h=64, bgc=(0.2,0.2,0.2), c=alphaCmd)
开发者ID:kyuhoChoi,项目名称:mayaTools,代码行数:15,代码来源:aiMatte.py
示例14: removeKrakenMenu
def removeKrakenMenu():
mainWindow = maya.mel.eval('$tmpVar=$gMainWindow')
menus = pm.window(mainWindow, q=True, ma=True)
if 'Kraken' in menus:
menuParent = pm.menu('Kraken', query=True, parent=True)
pm.deleteUI('|'.join([menuParent, 'Kraken']))
开发者ID:AbedSHP,项目名称:Kraken,代码行数:7,代码来源:kraken_maya.py
示例15: MakeMenu
def MakeMenu(menuTitle):
"""
Creates & returns a new menu instance.
:param menuTitle: string, title for the menu.
"""
return pm.menu(menuTitle)
开发者ID:joemuers,项目名称:pyswarm,代码行数:7,代码来源:uiBuilder.py
示例16: _delete_login_menu
def _delete_login_menu():
"""
Deletes the displayed Shotgun user login menu.
"""
if pm.menu(MENU_LOGIN, exists=True):
pm.deleteUI(MENU_LOGIN)
开发者ID:shotgunsoftware,项目名称:tk-maya,代码行数:7,代码来源:plugin_logic.py
示例17: addmenu
def addmenu():
global _menu
global _menuItems
with mayautils.undo_on_error():
_menu = pmc.menu('HDR Interpolation', parent=mayautils.get_main_window_name())
item = pmc.menuItem(parent=_menu, label='Show Menu', command=show)
_menuItems.append(item)
开发者ID:cfvalente,项目名称:rad_osx,代码行数:7,代码来源:interpolation.py
示例18: build_options_menu
def build_options_menu( self ):
pmc.setParent( menu = True )
menu = pmc.menu( label = 'Options', allowOptionBoxes = True )
pmc.menuItem( label = 'Set xNormal Location',
command = self.set_xn_location )
pmc.menuItem( divider = True )
enable = utils.get_bake_normals( )
if enable == None:
utils.set_bake_normals( True )
enable = True
pmc.menuItem( label = 'Bake Normal Map',
cb = enable,
command = pmc.CallbackWithArgs( self.map_cbx_callback,
'normal' ) )
enable = utils.get_bake_ao( )
if enable == None:
utils.set_bake_ao( False )
enable = False
pmc.menuItem( optionBox = True )
pmc.menuItem( label = 'Bake Ambient Occlusion Map',
cb = enable,
command = pmc.CallbackWithArgs( self.map_cbx_callback,
'ao' ) )
pmc.menuItem( optionBox = True )
开发者ID:hunnybear,项目名称:xnormal_maya_plugin,代码行数:28,代码来源:bake_layer_window.py
示例19: refresh_engine
def refresh_engine(engine_name, prev_context, menu_name):
"""
refresh the current engine
"""
current_engine = tank.platform.current_engine()
# first make sure that the disabled menu is reset, if it exists...
if pm.menu("ShotgunMenuDisabled", exists=True):
pm.deleteUI("ShotgunMenuDisabled")
# if the scene opened is actually a file->new, then maintain the current
# context/engine.
if pm.sceneName() == "":
return current_engine
new_path = pm.sceneName().abspath()
# this file could be in another project altogether, so create a new Tank
# API instance.
try:
tk = tank.tank_from_path(new_path)
except tank.TankError, e:
OpenMaya.MGlobal.displayInfo("Shotgun: Engine cannot be started: %s" % e)
# render menu
create_tank_disabled_menu(menu_name)
# (AD) - this leaves the engine running - is this correct?
return current_engine
开发者ID:framestore,项目名称:tk-maya,代码行数:28,代码来源:engine.py
示例20: _create_login_menu
def _create_login_menu():
"""
Creates and displays a Shotgun user login menu.
"""
# Creates the menu entry in the application menu bar.
menu = pm.menu(MENU_LOGIN, label=MENU_LABEL, parent=pm.melGlobals["gMainWindow"])
# Add the login menu item.
pm.menuItem(
parent=menu,
label="Log In to Shotgun...",
command=pm.Callback(_login_user)
)
pm.menuItem(parent=menu, divider=True)
# Add the website menu items.
pm.menuItem(
parent=menu,
label="Learn about Shotgun...",
command=pm.Callback(_jump_to_website)
)
pm.menuItem(
parent=menu,
label="Try Shotgun for Free...",
command=pm.Callback(_jump_to_signup)
)
开发者ID:shotgunsoftware,项目名称:tk-maya,代码行数:28,代码来源:plugin_logic.py
注:本文中的pymel.core.menu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论