MetaFusion/Reference/SuperRiggingEditor/scripts/SGRepairJointForLOD.mel

24 lines
792 B
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>: 2024/02/23
//
//******************************************************************************
global proc SGRepairJointForLOD(int $lod){
int $joints[] = `SGGetJoints -lod $lod "int"`;
for($i=0; $i<size($joints); $i++){
int $index = $joints[$i];
string $joint = `SGGetJoints -i $index`;
if(!`objExists $joint`){
joint -p 0 0 0 -n $joint;
string $parent = `SGGetJoints -p $index`;
catchQuiet (`parent $joint $parent`);
float $pos[] = `SGGetNeutralJointTranslations -i $index`;
setAttr -type float3 ($joint+".t") $pos[0] $pos[1] $pos[2];
setAttr -type float3 ($joint+".jo") $pos[3] $pos[4] $pos[5];
}
}
}