本文整理汇总了Python中maya.cmds.paneLayout函数的典型用法代码示例。如果您正苦于以下问题:Python paneLayout函数的具体用法?Python paneLayout怎么用?Python paneLayout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了paneLayout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: view_outliner
def view_outliner(floating=False):
"""
Toggle the outliner on as a dock window to the right side of the viewport,
if floating is ture then toggle outliner to a floating window.
makes sure to delete the dockControl UI when visibility is lost to
ensure the name is available for maya.
.. old::
panel_window = 'outlinerPanel1Window'
if cmds.window(panel_window, q=True, exists=True):
cmds.deleteUI(panel_window, window=True)
else:
panel = cmds.getPanel(withLabel='Outliner')
cmds.outlinerPanel(panel, e=True, tearOff=True)
"""
# Constants
TABLAYOUT = "MAM_TAB_LAYOUT"
DOCK_CONTROL_OUTLINER = "MAM_DOCK_CONTROL_OUTLINER"
if not cmds.paneLayout(TABLAYOUT, q=True, ex=True):
cmds.paneLayout(TABLAYOUT, p="viewPanes") # mel.eval('$tmp = $gMainWindow'))
# Creat or show outliner.
if not cmds.dockControl(DOCK_CONTROL_OUTLINER, q=True, ex=True):
cmds.dockControl(
DOCK_CONTROL_OUTLINER,
label="Outliner",
width=280,
content=TABLAYOUT,
allowedArea=["left", "right"],
area="right",
)
# Tear it off or dock it depending on floating arg.
vis_state = cmds.dockControl(DOCK_CONTROL_OUTLINER, q=True, vis=True)
fl_state = cmds.dockControl(DOCK_CONTROL_OUTLINER, q=True, fl=True)
cmds.dockControl(DOCK_CONTROL_OUTLINER, e=True, fl=floating)
if vis_state and not fl_state == floating:
pass
else:
cmds.dockControl(
DOCK_CONTROL_OUTLINER, e=True, vis=not (cmds.dockControl(DOCK_CONTROL_OUTLINER, q=True, vis=True))
)
if not cmds.dockControl(DOCK_CONTROL_OUTLINER, q=True, vis=True):
try:
cmds.deleteUI(DOCK_CONTROL_OUTLINER)
except RuntimeError:
pass
else:
# Create outliner pane under tablayout if it's not there.
outliner_window = "outlinerPanel1Window"
if not cmds.control(outliner_window, q=True, ex=True):
panel = cmds.getPanel(withLabel="Outliner")
cmds.outlinerPanel(panel, e=True, p=TABLAYOUT)
# cmds.control(outliner_window, e=True, p=TABLAYOUT)
if floating:
cmds.dockControl(DOCK_CONTROL_OUTLINER, e=True, height=600)
示例2: userGuide
def userGuide(*argv):
if cmds.window("UserGuideWindow", exists = True):
cmds.deleteUI("UserGuideWindow")
window = cmds.window("UserGuideWindow",title = "User Guide for Galaxy Modifier v0.2", w = 600,
minimizeButton = True, maximizeButton = False, sizeable = True)
cmds.paneLayout()
cmds.textScrollList( "guideInfo", allowMultiSelection = False,
append=[ "// 作者:李宏杰",
"// 星系编辑脚本,版本V0.1,20150415",
"// 脚本主页:http://lhj.nkco.org/?p=1173",
"",
"*使用步骤:",
" 1、使用Maya打开随脚本一起下载的MyGalaxy.mb,同时把脚本放到Maya的脚本目录下,",
" 例如 C:\Users\Lee\Documents\maya\2015-x64\zh_CN\scripts;",
" 2、在Maya的Python命令框输入以下语句,并拖动到工具栏:",
" import MyGalaxy",
" reload(MyGalaxy)",
" MyGalaxy.createUI()",
" 3、自由调节各参数至获得满意效果即可。",
"",
"*参数说明:(模型中的星系由两层粒子组成,一层代表星星,一层代表星云)",
" Scale Factor: 按比例放大/缩小;",
" Galaxy Color:星系的主体颜色。星系的颜色会以该颜色为基色随机。",
" Star Count:星星的数量;",
" Star Radius:星星的密度(多点半径);",
" Cloud Radius:星云的粒子半径;",
" Star Opacity, Cloud Opacity:星星/星云的透明度;"]
)
cmds.showWindow(window)
示例3: gui
def gui():
global txt_list
if (cmds.window(win, q=True, ex=True)):
cmds.deleteUI(win)
cmds.window(win, w=170)
main_layout= cmds.columnLayout(adj=True)
cmds.paneLayout(cn='vertical2', w=width)
txt_list = cmds.textScrollList(w=width, a=test_list)
cmds.columnLayout(adj=True, w=width/2)
cmds.button(l='Move Up', w=width/1.5, c=scriptname + '.move_up()')
cmds.button(l='Move Down', w=width/1.5, c=scriptname + '.move_down()')
cmds.button(l='Delete', w=width/1.5, c=scriptname + '.remove_item()')
cmds.text(l='Sort')
cmds.button(l='ABC', w=width/1.5, c=scriptname + '.sort_abc()')
cmds.button(l='Type', w=width/1.5)
cmds.button(l='Default', w=width/1.5, c=scriptname + '.sort_default()')
cmds.setParent(main_layout)
cmds.separator(w=width, h=5)
cmds.text(l='Create')
cmds.rowColumnLayout(nc=2)
cmds.button(l='pmAvg', w=width/4)
cmds.button(l='multDiv', w=width/4)
cmds.showWindow(win)
示例4: displayUI
def displayUI(self):
windowName = 'LCMTUIWindow'
if cmds.window(windowName, exists=True):
cmds.deleteUI(windowName)
window = cmds.window(windowName, menuBar = True,t="LCMT v3.1.1")
fileMenu = cmds.menu( label='Manage Light Types')
cmds.menuItem( label='Add More Light Types',command=lambda *args:self.addLightTypes())
cmds.menuItem( label='See Current Light Types', command=lambda *args:self.displayLightTypes())
cmds.menuItem( label='Reset Light Types to Default Values', command=lambda *args:self.resetLightTypesToDefault())
cmds.paneLayout( configuration='vertical2' )
lightStageColumn = cmds.columnLayout(adjustableColumn=True)
cmds.text('Lights in the SCENE')
lights = cmds.ls(dag =True,visible=True,lights=True, type='mentalrayIblShape')
lightList = cmds.iconTextScrollList(allowMultiSelection=True, append=lights)
cmds.rowLayout(numberOfColumns = 2)
useGroupLights = cmds.checkBox( label='Group Lights', onCommand = lambda *args: self.updateScollList(True, lightList), offCommand = lambda *args: self.updateScollList(False, lightList))
cmds.checkBox( label='Save Images?', cc = lambda *args: self.toggleSaveImages())
cmds.setParent('..')
cmds.iconTextScrollList(lightList,edit=True,selectCommand=lambda *args: cmds.select(self.getElementsFromLightScrollList(lightList,useGroupLights),vis=True))
cmds.button(label='Render Lights!', command = lambda *args: self.renderAllLights(self.getElementsFromLightScrollList(lightList,useGroupLights),cmds.checkBox(useGroupLights, query=True, value=True)))
cmds.setParent('..')
renderLayersColumn = cmds.columnLayout(adjustableColumn=True)
#new column
cmds.text('Geometry in the SCENE')
geometry = cmds.ls(geometry=True)
#take out the ibl shapes from the geo selection
geometry = list(set(geometry) - set(lights))
geoList = cmds.iconTextScrollList(allowMultiSelection=True, append=geometry,selectCommand=lambda *args: cmds.select(cmds.iconTextScrollList(geoList, query=True, si=True )) )
cmds.text('Create Render Layers from selected geometry and lights')
cmds.button(label='Create Render Layers!', command = lambda *args: self.createLayersFromLights(cmds.iconTextScrollList(geoList, query=True, si=True ),self.getElementsFromLightScrollList(lightList,useGroupLights)))
cmds.setParent('..')
cmds.showWindow()
示例5: SelectionError
def SelectionError(*args):
WindowCheck = cmds.window(title = 'ERROR', widthHeight = (400, 100))
CHECK = cmds.ls( selection=True )
if len(CHECK) == 0:
#cmds.error( "### Please Select CHAR_HULL_BASE ###" )
cmds.paneLayout()
cmds.scrollField(wordWrap=True, text=' ### Please Select CHAR_HULL_GEO ###')
cmds.showWindow(WindowCheck)
cmds.showSelectionInTitle(WindowCheck)
示例6: takePicture
def takePicture(self,*args):
global screenShotPanelVar
cmds.formLayout()
cmas=cmds.columnLayout(adj=True)
cmds.paneLayout(w=150,h=150)
screenShotPanelVar=cmds.modelPanel(cam='persp',mbv=False)
cmds.modelEditor(screenShotPanelVar,e=True,da='smoothShaded',hud=False,jx=False,dtx=True,grid=False)
cmds.separator(p=cmas)
cmds.button(l='SET AS PREVIEW',p=cmas, c=self.takePictureProcess)
return
示例7: FBXExporter_AnimationHelpWindow
def FBXExporter_AnimationHelpWindow():
ui_animHelpWindow = "ui_FBXExporter_AnimationHelpWindow"
if cmds.window(ui_animHelpWindow, exists=True):
cmds.deleteUI(ui_animHelpWindow)
cmds.window(ui_animHelpWindow, s=True, width=500, height=500, menuBar=True, title="Help on Animation Export")
cmds.paneLayout(configuration='horizontal4')
cmds.scrollField(editable=False, wordWrap=True, text="Animation Export: \nAnimation export assumes single-level referencing with proper namesapce.\n\nActors: \nAll referenced characters with a origin joint tagged with the origin attribute will be listed in the Actor's field by their namespace. Please see the modeling help window for how to tage a character's origin with the origin attribute.\n\nExport Nodes:\nThe Export Nodes panel will fill in with export nodes connected to the origin of the selected actor from the Actor's field. Clicking on the New Export Node will create a new node. Each export node represents a seperate animation.\n\nExport:\nThe Export flag means the current export ndoe will be available for export. All nodes wihtout this checked will not be exported.\n\nMove to origin:\nNot yet supported\n\nSub Range:\nTurn this on to enable the sub-range option for the selected node. This will enable the Start Frame and End Frame fields where you can set the range for the specified animation. Otherwise, the animation will use the frame range of the file.\n\nExport File Name:\nClick on the Browse button to browse to where you want the file to go. The path will be project relative.\n\nExport Selected Animation:\nClick this button to export the animation selected in Export Nodes\n\nExport All Animations For Selected Character:\nClick this button to export all animations for the selected actor in the Actors filed. This flag will ignore what is selected in Export Nodes and export from all found nodes for the character\n\nExport All Animations:\nClick this button to export all animations for all characters. All selections will be ignored" )
cmds.showWindow(ui_animHelpWindow)
示例8: FBXExporter_ModelHelpWindow
def FBXExporter_ModelHelpWindow():
ui_modelHelpWindow = "ui_FBXExporter_ModelHelpWindow"
if cmds.window(ui_modelHelpWindow, exists=True):
cmds.deleteUI(ui_modelHelpWindow)
cmds.window(ui_modelHelpWindow, s=True, width=500, height=500, menuBar=True, title="Help on Model Export")
cmds.paneLayout(configuration='horizontal4')
cmds.scrollField(editable=False, wordWrap=True, text="Model Export: \nModel exporter assumes one skeleton for export. Referencing for model export is not supported\n\nRoot Joints: \nPanel will list all the joints tagged with the \"origin\" attribute. If no joint is tagged with the attribute, it will list all joints in the scene and turn red. Select the root joint and click the Tag as Origin button.\n\nExport Nodes:\nThe Export Nodes panel will fill in with export nodes connected to the origin of the selected actor from the Actor's field. Clicking on the New Export Node will create a new node. Each export node represents a seperate character export (for example, seperate LOD's).\n\nMeshes:\nThe Meshes panel shows all the geometry associated with the selected export node. This can be used if you have mesh variations skinned to the same rig or LOD's.\n\nExport File Name:\nClick on the Browse button to browse to where you want the file to go. The path will be project relative.\n\nExport Selected Character:\nClick this button to export the character selected in Export Nodes\n\nExport All Characters:\nClick this button to export all character definitions for the skeleton. All selections will be ignored" )
cmds.showWindow(ui_modelHelpWindow)
示例9: getParentPanel
def getParentPanel():
"""return the parent panel """
upPanel = cmds.getPanel(up=True)
if cmds.panel(upPanel, q=True, ex=True):
upPanelLayout = cmds.layout(upPanel, q=True, p=True)
while not cmds.paneLayout(upPanelLayout, q=True, ex=True):
upPanelLayout = cmds.control(upPanelLayout, q=True, p=True)
if cmds.paneLayout(upPanelLayout, q=True, ex=True):
return upPanelLayout
else:
return "viewPanes"
示例10: sjKillGUI
def sjKillGUI():
'''
GUI guts
'''
global mainCol
global tsl
# mainCol = cmds.columnLayout( adjustableColumn=True )
cmds.paneLayout()
tsl = cmds.textScrollList( w=1200, h=180, ams=True,
append=cmds.scriptJob(listJobs=True))
'''
示例11: win
def win(self):
if cmds.window(self.intWinName, exists=True):
cmds.deleteUI(self.intWinName, window=True)
cmds.window(self.intWinName, menuBar=True, title=self.visWinName, width=400, height=650)
self.buildMenuBar()
cmds.paneLayout(configuration="horizontal2", h=100, ps=[1, 100, 25])
self.buildNameContents()
self.addControls()
self.parseSceneNameAndPopulate()
self.buildName()
cmds.showWindow(self.intWinName)
示例12: imageViewer
def imageViewer(self):
"""
Click thumbnail to see enlarged image
"""
selectedImage=os.path.join(cmds.textField('location',q=True,tx=True),cmds.textScrollList('fileLister',q=True,
si=True)[0]).split(" > ")[0]
for each in ["jpg","png",'tif',"iff"]:
if selectedImage.endswith(each):
window = cmds.window(t="Image Viewer")
cmds.paneLayout()
cmds.image( image=selectedImage)
cmds.showWindow( window )
示例13: UI
def UI(self, meshes=[]):
if cmds.window('CheckColorVertex', exists=True):
cmds.deleteUI('CheckColorVertex', window=True)
win = cmds.window('CheckColorVertex', t='Check Color Vertex')
cmds.paneLayout()
cmds.textScrollList('textScroll',
numberOfRows=8,
allowMultiSelection=True,
selectCommand=self.selectNode,
append=[str(mesh) for mesh in meshes])
cmds.showWindow()
示例14: ui
def ui(self):
'''
Launch a UI to display the marks that were recorded.
'''
with utl.MlUi('ml_stopwatchReport', 'Stopwatch Report', width=400, height=400, info='''This is the report from the stopwatch you just ran.
Adjust the start frame, and then press the frame buttons to jump to that frame.
The fields on the right can be used for notes.''', menu=False) as win:
self.uiSlider = mc.intSliderGrp(field=True, label='Start Frame', value=self.startFrame,
minValue=((-0.5*self.frameMarks[-1])+self.startFrame), maxValue=(self.frameMarks[-1]/2)+self.startFrame,
fieldMinValue=-1000, fieldMaxValue=1000,
changeCommand=self.uiUpdateStartFrame)
self.frameRateField = mc.intFieldGrp(label='Frame Rate', value1=self.frameRate, enable1=False, extraLabel='fps', annotation='')
mc.scrollLayout()
mc.rowColumnLayout(numberOfColumns=3, columnWidth=[(1, 50), (2, 80), (3, 340)])
mc.text('Frame')
mc.text('Duration')
mc.text('Notes')
for i in range(3):
mc.separator(style='single', height=15)
self.uiButton = list()
for i in range(len(self.frameMarks)):
#frame button
frame = self.frameMarks[i]+self.startFrame
self.uiButton.append(mc.button(label=str(frame), annotation='Go to frame %i' % frame,command='import maya.cmds;maya.cmds.currentTime(%i,edit=True)' % frame))
#duration text
if i:
mc.text(label=str(self.frameMarks[i]-self.frameMarks[i-1]))
else:
mc.text(label='Start')
#notes field
mc.textField()
#add the stop
mc.text(label='')
mc.text(label='Stop')
mc.setParent('..')
mc.setParent('..')
#next and prev buttons!
mc.paneLayout(configuration='vertical2',separatorThickness=1)
mc.button(label='<< Previous', command=self.previousFrame, annotation='Go to the previous frame in the list.')
mc.button(label='Next >>', command=self.nextFrame, annotation='Go to the next frame in the list.')
示例15: get_parent_panel
def get_parent_panel():
"""
Return current panels parent.
"""
panel = cmds.getPanel(up=True)
if cmds.panel(panel, q=True, ex=True):
panel_layout = cmds.layout(panel, q=True, p=True)
while not cmds.paneLayout(panel_layout, q=True, ex=True):
panel_layout = cmds.control(panel_layout, q=True, p=True)
if cmds.paneLayout(panel_layout, q=True, ex=True):
return panel_layout
else:
return 'viewPanes'