MetaFusion/Reference/SuperRiggingEditor/scripts/SGRangeBlendShapeAll.mel

35 lines
1.1 KiB
Plaintext
Raw Normal View History

2025-02-03 22:58:41 +08:00
//******************************************************************************
//
// <20><>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>: <20><>Ϫʱ<CFAA><CAB1><EFBFBD>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD>޹<EFBFBD>˾
// <20><>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>: q.100@qq.com
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: 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;
}
}
}
}