40 lines
1005 B
Plaintext
40 lines
1005 B
Plaintext
|
//******************************************************************************
|
|||
|
//
|
|||
|
// <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/03/20
|
|||
|
//
|
|||
|
//******************************************************************************
|
|||
|
|
|||
|
global proc SGAutomaticGrouping ()
|
|||
|
{
|
|||
|
for($i=0; $i<8; $i++){
|
|||
|
int $lodMesh[] = `SGGetMeshes -lod $i`;
|
|||
|
string $group = "head_lod" + $i + "_grp";
|
|||
|
if(!`objExists $group`){
|
|||
|
group -em -n $group;
|
|||
|
}
|
|||
|
for($j=0; $j<size($lodMesh); $j++){
|
|||
|
if($lodMesh[$j] >= 50){
|
|||
|
continue;
|
|||
|
}
|
|||
|
string $mesh = `SGGetMeshes -m $lodMesh[$j]`;
|
|||
|
if(`objExists $mesh`){
|
|||
|
catchQuiet (`parent $mesh $group`);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
string $bodyGrps[] = {"body_lod0_grp","body_lod1_grp","body_lod2_grp","body_lod3_grp"};
|
|||
|
for($i=0; $i<4; $i++){
|
|||
|
int $bodyIndex = 50 + $i;
|
|||
|
string $mesh = `SGGetMeshes -m $bodyIndex`;
|
|||
|
if(!`objExists $bodyGrps[$i]`){
|
|||
|
group -em -n $bodyGrps[$i];
|
|||
|
}
|
|||
|
if(`objExists $mesh`){
|
|||
|
catchQuiet (`parent $mesh $bodyGrps[$i]`);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|