MetaFusion/Reference/SuperRiggingEditor/scripts/SGFastBindSkinCluster.mel
2025-02-03 22:58:41 +08:00

31 lines
867 B
Plaintext

//******************************************************************************
//
// 版权所有: 玉溪时光科技有限公司
// 联系邮箱: q.100@qq.com
// 开发日期: 2024/03/26
//
//******************************************************************************
global proc SGFastBindSkinCluster (){
for($i=0; $i<54; $i++){
string $mesh = `SGGetMeshes -m $i`;
if(`objExists $mesh`){
string $path = `SGDescriptor -p` + "/skin_buffer/";
if(`file -q -ex $path`){
string $skinFileList[] = `getFileList -fld $path -fs "*.skin"`;
for($skin in $skinFileList){
if(`gmatch $skin ("*"+$mesh+"*")`){
string $skinFile = $path + $skin;
string $skinCluster = `findRelatedSkinCluster $mesh`;
if(`objExists $skinCluster`){
skinCluster -e -ub $mesh;
}
catchQuiet (`SGSkinCluster -if $mesh $skinFile`);
}
}
}
}
}
}