Maya cmds pymel scriptJob() 和 undoInfo() 在回调中撤销(undo) def myEventFun(): cmds.undoInfo(stateWithoutFlush = 0) # your code pass cmds.undoInfo(stateWithoutFlush = 1) cmds.scriptJob(event = ['SelectionChanged', myEventFun], killWithScene = 1) stateWithou…
maya cmds pymel undoInfo chunk 撤销束 cmds.undoInfo(openChunk = 1) # your code cmds.undoInfo(closeChunk = 1) 这样,在两行 chunk 之间的可撤销 cmds 命令都会被封装成一个undo…
maya cmds pymel 选择 uv area(uv 面积) 为0 的面 cmds.selectType( pf=True ) cmds.polySelectConstraint( m=3, t=8, ta=True, tab=(0, 0.000010) ) # to get face with texture area between 0-0.000010 cmds.polySelectConstraint( m = 0, ta = False)  # turn off the 2D a…
maya cmds pymel selectType() 选择类型切换 import maya.cmds as cmds cmds.selectType( polymeshFace = True ) # 网格面模式 cmds.selectType( vertex = True ) # 网格点模式 其它模式参考帮助文档…
maya cmds pymel 'ESC' 退出 while, for 循环 import maya.cmds as cmds cmds.progressWindow(isInterruptable=1) while 1 : print "kill me!" if cmds.progressWindow(query=1, isCancelled=1) : break cmds.progressWindow(endProgress=1)…
maya cmds pymel polyEvaluate 获取 bounding box cmds.polyEvaluate(bc = 1)   #模型 cmds.polyEvaluate(bc2 = 1) #UV…
Maya cmds pymel 获取安装选择顺序选择的物体 import maya.cmds as cmds 先设置选择顺序 cmds.selectPref(trackSelectionOrder = 1) 然后选择物体 然后运行 sels = cmds.ls(os = 1) 那么sels就是一个list,里面的物体是安装选择顺序来排列的 最后可以把选择顺序关闭 cmds.selectPref(trackSelectionOrder = 0)…
Maya cmds pymel 单位和轴向设置 import maya.cmds as cmds # 1. to make the Y-axis of the world to be the up axis: cmds.upAxis( ax='y' ) # 2. to make the Z-axis of the world to be the up axis, # and rotate the view: cmds.upAxis( ax='z', rv=True ) # 3. to query…
Maya cmds pymel 快速选择hard edges(硬边) import maya.cmds as cmds cmds.polySelectConstraint(m = 3, t = 0x8000, sm = 1)sels = cmds.ls(sl = 1) cmds.polySelectConstraint(sm = 0) #复原选择模式,不然在view中只能选择硬边cmds.select(sels)…
Maya cmds filterExpand 列出 选择的 uvs vertices faces edges 等 component 类型 cmds.ls() 的 flags 中没有指明 uvs 等这些 component 的选项,就算使用 type 来过滤,我们会发现 uv 的 objectType 是 u'mesh'. cmds.filterExpand(selectionMask = 35, expand = 1) expand 相当于 ls() 中的 flat 至于更多的 compone…