MetaFusion/Reference/SuperRiggingEditor/scripts/SGSaveBlendShapeMappings.mel

42 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>: 2024/06/12
//
//******************************************************************************
global proc SGSaveBlendShapeMappings ( int $resetMappings ){
SGProgressBar -sp;
int $mapping = 0;
string $blendShapeNames[] = `SGGetBlendShapes`;
SGProgressBar -max (size($blendShapeNames));
SGProgressBar -t ("Update BlendShape Mappings...");
SGProgressBar -pr 0;
string $blendShapes[];
int $meshIndices[];
for($meshIndex=0; $meshIndex<50; $meshIndex++){
string $blendShape = `SGGetMeshes -i $meshIndex` + "_blendShapes";
if(`objExists $blendShape`){
$blendShapes[size($blendShapes)] = $blendShape;
$meshIndices[size($meshIndices)] = $meshIndex;
}
}
for($blendShapeName in $blendShapeNames){
SGProgressBar -apr 1;
for($i=0; $i<size($blendShapes); $i++) {
string $bsNode[] = `listAttr -m ($blendShapes[$i] + ".w")`;
if(stringArrayContains($blendShapeName, $bsNode)){
SGSaveBlendShapes -rm $resetMappings -ma $mapping $meshIndices[$i] $blendShapeName;
$mapping++;
}
}
}
SGProgressBar -ep;
}