MetaFusion/Reference/SuperRiggingEditor/scripts/SGCreateBlendShape.mel

36 lines
1.2 KiB
Plaintext
Raw Permalink 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 SGCreateBlendShape (){
SGProgressBar -sp;
for($mesheIndex=0; $mesheIndex<50; $mesheIndex++){
string $mesh = `SGGetMeshes -m $mesheIndex`;
if(`objExists $mesh`){
string $blendShape = `SGGetBlendShape $mesh`;
int $count = `SGGetBlendShapes -dr "r" -tc $mesheIndex`;
if(!`objExists $blendShape` && $count > 0){
string $blendShapeName = `SGGetMeshes -i $mesheIndex` + "_blendShapes";
SGProgressBar -max $count;
SGProgressBar -t ("[" + $blendShapeName + "] Creating Target Mesh...");
blendShape -n $blendShapeName $mesh;
for($index=0; $index<$count; $index++){
SGProgressBar -apr 1;
string $bsName = `SGGetBlendShapes -dr "r" -bsn $mesheIndex $index`;
duplicate -rr -n $bsName $mesh;
SGSetBlendShapes -ct $mesheIndex $index $bsName;
blendShape -e -tc on -t $mesh $index $bsName 1 -w $index 0 $blendShapeName;
delete $bsName;
}
}
}
}
SGProgressBar -ep;
}