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

35 lines
1.1 KiB
Plaintext

//******************************************************************************
//
// 版权所有: 玉溪时光科技有限公司
// 联系邮箱: q.100@qq.com
// 开发日期: 2023/08/08
//
//******************************************************************************
global proc SGRangeBlendShapeAll (float $range){
for($i=0; $i<50; $i++){
string $mesh = `SGGetMeshes -m $i`;
if(`objExists $mesh`){
string $blendShape = `SGGetBlendShape $mesh`;
if(`objExists $blendShape`){
string $bsNames[] = `listAttr -m ($blendShape + ".weight")`;
int $count = size($bsNames);
string $title = "Set Range Target";
progressWindow -t $title -min 0 -max $count -isInterruptable true;
for($j=0; $j<$count; $j++){
if(`progressWindow -query -isCancelled`) {
break;
}
string $bsName[] = `sculptTarget -e -regenerate true -target $j $blendShape`;
SGSetBlendShapes -r $range $bsName[0];
delete $bsName;
string $status ="[" + ($j+1) + "/" +$count + "]" + $blendShape;
progressWindow -edit -progress $j -st $status ;
}
progressWindow -endProgress;
}
}
}
}