本文整理汇总了Python中maya.cmds.layout函数的典型用法代码示例。如果您正苦于以下问题:Python layout函数的具体用法?Python layout怎么用?Python layout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了layout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateLayoutEnabled
def updateLayoutEnabled(self):
'''
updates UI enabled/disabled flag based on layer data availability
'''
enabled = LayerDataModel.getInstance().layerDataAvailable==True
cmds.layout(self.cmdLayout.innerLayout,e=True,enable=enabled)
cmds.layout(self.cmdLayout.buttonForm,e=True,enable=enabled)
示例2: updateLayoutEnabled
def updateLayoutEnabled(self):
'''
updates UI enabled/disabled flag based on layer data availability
'''
enabled = self.dataModel.isEnabled()
cmds.layout(self.cmdLayout.innerLayout,e=True,enable=enabled)
cmds.layout(self.cmdLayout.buttonForm,e=True,enable=enabled)
示例3: changePrefix
def changePrefix(s, element, text):
text = text.strip().title()
if text and 2 < len(text) < 30 and "@" not in text:
cmds.layout(element, e=True, bgc=(0.3,1,0.3))
s.data["pref"] = text
s.save()
else:
cmds.control(element, e=True, bgc=(1,0.4,0.4))
示例4: closeTodo
def closeTodo(): # Animate todo closed. Fancy.
if cmds.layout(gui, ex=True):
height = cmds.layout(gui, q=True, h=True)
for i in range(20):
i = (100 - i*5) / 100.0
cmds.layout(gui, e=True, h=height * i)
cmds.refresh()
time.sleep(0.01)
s._buidTodoTasks()
示例5: __init__
def __init__(self):
if mc.layout(self.layoutname, query=True, exists=True) == True:
mc.deleteUI(self.layoutname, lay=True)
if mc.layout(self.layoutname, query=True, exists=True) != True:
self.windowName = mc.loadUI(f=self._UI_File)
mc.showWindow(self.windowName)
allowedAreas = ['right', 'left']
self.layout=mc.dockControl(area='right', content=self.windowName, l='SP_2012', w=390, h=490, allowedArea=allowedAreas)
self.layoutname=mc.dockControl(self.layout,q=1,fpn=1)
示例6: createUI
def createUI( self, win, index):
# min/max of the attr need to be set correcty, not yet
win.cRange.append( mc.floatSliderGrp( label=self.niceName, fieldStep=.1, precision=3, field=True, min=0, fieldMinValue=-1000000, max=5, fieldMaxValue=1000000, cc='bt_randomizer.updateChannel( ' + str(index) + ', 1)', dc='bt_randomizer.updateChannel( ' + str(index) + ', 0)' ))
# Offset - then modify the stepping of the float field
win.cOffset.append( mc.floatFieldGrp( label='Offset', precision=3, numberOfFields=1, value1=0, cc='bt_randomizer.updateChannel( ' + str(index) + ', 1)', dc='bt_randomizer.updateChannel( ' + str(index) + ', 0)' ))
mc.floatField( (win.cOffset[-1] + '|' + mc.layout( win.cOffset[-1], q=1, ca=1)[1]), e=1, step=.1)
# Step - then modify the stepping of the float field
win.cStep.append( mc.floatFieldGrp( label='Step', precision=3, numberOfFields=1, value1=0, cc='bt_randomizer.updateChannel( ' + str(index) + ', 1)', dc='bt_randomizer.updateChannel( ' + str(index) + ', 0)' ))
mc.floatField( (win.cStep[-1] + '|' + mc.layout( win.cStep[-1], q=1, ca=1)[1]), e=1, step=.1)
mc.separator( style="in", h=20)
示例7: filterListByType
def filterListByType(self, nodeType):
if len(self.itemList) > 0:
for item in self.itemList:
classification = []
classification.append(item.nodeType)
classification.extend(cmds.getClassification(item.nodeType))
clsStr = '|'.join(classification)
if nodeType in clsStr:
cmds.layout(item.listItemLayoutId, edit = 1, manage = 1)
else:
cmds.layout(item.listItemLayoutId, edit = 1, manage = 0)
示例8: _GUI_Delete
def _GUI_Delete(s):
"""
Overriding deletion for a fancy removal animation.
"""
if cmds.layout(s._root, ex=True):
height = cmds.layout(s._root, q=True, h=True)
for i in range(20):
i = (100 - i*5) / 100.0
cmds.layout(s._root, e=True, h=height * i)
cmds.refresh()
time.sleep(0.01)
element.MayaElement._GUI_Delete(s)
示例9: show
def show(cls, menu_type, menu_name, preferences, **kwargs):
"""create marking menu"""
cls.hide(kwargs["b"])
if not menu_name:
return
if menu_type == cls.MEL:
cls._mel(menu_name, p=cmds.layout(cmds.getPanel(up=True), q=True, p=True), aob=True, mm=True, **kwargs)
elif menu_type == cls.PYTHON:
cls._python(menu_name, p=cmds.layout(cmds.getPanel(up=True), q=True, p=True), aob=True, mm=True, **kwargs)
else:
cls._preset(menu_name, preferences, p=cmds.layout(cmds.getPanel(up=True), q=True, p=True), aob=True,
mm=True, **kwargs)
示例10: sample
def sample(strYaya,*agre):
cmds.deleteUI('layout_'+strYaya.split('saww')[1])
main_column_num = cmds.layout('main_layout',q=True,numberOfChildren=True)
for d in range(main_column_num):
rowlayoutNum = cmds.rowLayout('sadw'+str(d),q=True,numberOfChildren=True)
if rowlayoutNum<12 or rowlayoutNum>0:
for i in range(12 - int(rowlayoutNum)):
try:
layPos = cmds.layout('sadw'+str(int(d)+1),q=True,childArray=True)
cmds.columnLayout(layPos[0] ,e=True,parent='sadw'+str(d))
except:
pass
示例11: delete
def delete(s):
# Delete itself
with warn:
ans = cmds.confirmDialog(
t=s.i18n["clips.deleteClip"],
m=s.i18n["clips.deleteConfirm"],
button=[s.i18n["yes"], s.i18n["no"]],
defaultButton=s.i18n["yes"],
cancelButton=s.i18n["no"],
dismissString=s.i18n["no"]
)
if ans == s.i18n["yes"]: # Are we ok to delete??
s.char.removeClip(s.clip)
cmds.layout(s.wrapper, e=True, m=False)
示例12: updateToTool
def updateToTool(self):
'''
update controls to current tool
'''
isPainting = self.isPainting()
cmds.control(self.cmdLayout.innerLayout,e=True,enable=isPainting)
cmds.button(self.cmdLayout.buttons[1],e=True,label="Flood" if isPainting else "Paint")
if (isPainting):
self.controls.brushRadiusSlider.setValue(cmds.artUserPaintCtx(self.TOOL_PAINT,q=True,radius=True))
self.controls.brushRadiusSlider.setEnabled(isPainting)
layersAvailable = LayerDataModel.getInstance().layerDataAvailable
cmds.layout(self.cmdLayout.buttonForm,e=True,enable=layersAvailable)
示例13: updatePlaneMode
def updatePlaneMode(self, planeMode, unused):
if(self.currentPlaneMode == planeMode):
return
#hide advanced options UI
if(self.currentPlaneMode is not None and self.currentPlaneMode.advancedSettingsUI is not None):
cmds.layout(self.currentPlaneMode.advancedSettingsUI, edit=True, visible=False)
self.currentPlaneMode = planeMode
#show advanced options UI
if(self.currentPlaneMode.advancedSettingsUI is not None):
cmds.layout(self.currentPlaneMode.advancedSettingsUI, edit=True, visible=True)
self.updatePreviewPlane()
示例14: startUp
def startUp():
print( '########## mayaWrangler >>>>>>>>>>>>>>>>>>>>>>>>' )
# todo embedd in interface:
wantSecondsCurrentTimeField = 1
wantCurrentTimeFieldInt = 1
wantCurrentTimeToMinMaxPopup = 1
wantTweakGraphEditPopup = 1
wantShelfSwitcherMM = 1
if not m.layout( lyout, ex=1 ):
raise IOError, 'timeSlider layout: ' + lyout + ' does not exist (yet)! :/'
print ('check! layout: ' + str(lyout) + ' exists!')
if not m.control( currTimeField, ex=1 ):
raise IOError, 'currTimeField: ' + currTimeField + ' does not exist (yet)! :/'
print ('check! currTimeField: ' + str(currTimeField) + ' exists!')
if wantSecondsCurrentTimeField:
createSecondsCurrentTimeField()
if wantCurrentTimeFieldInt:
makeCurrentTimeFieldInt()
if wantCurrentTimeToMinMaxPopup:
addCurrentTimeToMinMaxPopup()
if wantTweakGraphEditPopup:
createTweakGraphEditPopup()
if wantShelfSwitcherMM:
import shelfSwitcher
shelfSwitcher.build()
print( '########## mayaWrangler <<<<<<<<<<<<<<<<<<<<<<<<<' )
示例15: __init__
def __init__(self):
MPx.MPxCommand.__init__( self )
#add env variable for maya scripts path
CSIDL_PERSONAL = 5 # My Documents
SHGFP_TYPE_CURRENT = 1 # Get current, not default value
docs = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
ctypes.windll.shell32.SHGetFolderPathW(None, CSIDL_PERSONAL, None, SHGFP_TYPE_CURRENT, docs)
mayaENVfile = docs.value + "/maya/2016/Maya.env"
os.chmod( mayaENVfile, 0o664 )
mayaEnv = open( mayaENVfile, 'a' )
mayaEnvR = open( mayaENVfile, 'r' )
readEnv = mayaEnvR.readlines()
lineSet = set(readEnv)
newline = "MAYA_MODULE_PATH= C:\Program Files\Autodesk\Maya2016\plugin-ins\CGassetManager"
newlineSpaces = "\n\nMAYA_MODULE_PATH= C:\Program Files\Autodesk\Maya2016\plugin-ins\CGassetManager"
if not newline in lineSet:
mayaEnv.writelines(newlineSpaces)
mayaEnv.close()
mayaEnvR.close()
#rehash the maya script cache
mel.eval( "rehash;" )
if cmds.layout( "PM_plugins", exists=True ):
pass
else:
mel.eval( "loadNewShelf \"shelf_PM_plugins\";" )