FBX权重导入unity之前需要查询下权重点是否控制在四个点的范围内
用脚本检查下就可以了,简单整理了一下脚本
import maya.cmds as cmds
import sys
import maya.mel as mel
def checkFourVexMainWins():
winds = 'ssa'
if cmds.window(winds,ex = True):
cmds.deleteUI(winds)
cmds.window(winds , t = u'YQ_tools')
cmds.columnLayout( adjustableColumn=True,rowSpacing=10)
cmds.separator( style='out' )
cmds.button(u'checkFourVtx', label=u'选择的模型检查四个点', c='checkFourvtxs()')
cmds.showWindow(winds)
def checkFourvtxs():
sel = cmds.ls(sl=True)
if sel == []:
cmds.error(u' choose is None !!!')
else:
vtxList = []
for se in sel:
vtxs = cmds.ls('%s.vtx[*]'%se, fl=1)
skinCls = searchSkinCluster(se)
valueList = []
for ss in vtxs:
skinValue = cmds.skinPercent(skinCls, ss, query=True, value=True)
valueList = []
for value in skinValue:
if value != 0.0:
valueList.append(value)
if len(valueList) > 4:
vtxList.append(ss)
if vtxList != []:
cmds.select(vtxList)
cmds.warning(u' this vtx is greater than 4 ' )
else:
sys.stderr.write(u' model is ok!!!!! ')
def searchSkinCluster(mesh):
# get skincluster
skinNode = mel.eval("findRelatedSkinCluster" +"(\""+ mesh +"\")")
return skinNode
checkFourVexMainWins()
选中模型点一下就行
|