//****************************************************************************** // // 版权所有: 玉溪时光科技有限公司 // 联系邮箱: q.100@qq.com // 开发日期: 2024/09/16 // //****************************************************************************** global proc SGReorderBlendShapes (){ for($mesheIndex=0; $mesheIndex<50; $mesheIndex++){ string $meshe = `SGGetMeshes -m $mesheIndex`; if(`objExists $meshe`){ string $blendShape = `SGGetBlendShape $meshe`; if(`objExists $blendShape`){ string $attrWeight = $blendShape + ".weight"; int $nbInTgt = `getAttr -size $attrWeight`; int $existingIndices[] = `getAttr -multiIndices $attrWeight`; string $currentBlendShapeList[] = `listAttr -m $attrWeight`; string $blendShapeList[] = `SGGetBlendShapes`; int $assess = `areIndexesSorted $blendShapeList $currentBlendShapeList`; if($nbInTgt-1 != $existingIndices[$nbInTgt-1] || !$assess){ string $targetList[]; for($j=0; $j