MetaFusion/Reference/SuperRiggingEditor/scripts/SGCreateRL4Node.mel

50 lines
1.1 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 SGCreateRL4Node (string $dna, string $n){
SGDeleteRL4Node;
string $joints[] = `SGGetJoints`;
for($i=0; $i<size($joints); $i++){
SGSetColor $joints[$i] 0 0 0 0 0 0;
}
int $lod;
for($i=0; $i<8; $i++){
string $joint_lod[] = `SGGetJoints -lod $i "string"`;
int $exists = 1;
for($joint in $joint_lod){
if(!`objExists $joint`){
$exists = 0;
break;
}
}
if($exists){
$lod = $i;
break;
}
}
SGRepairJointForLOD 0;
string $jn;
if(`namespace -ex "DHIhead"`){
$jn = "DHIhead:<objName>.<attrName>";
}
else{
$jn = "<objName>.<attrName>";
}
string $amn = "FRM_WMmultipliers.<objName>_<attrName>";
string $bsn = "<objName>_blendShapes.<attrName>";
string $cn = "<objName>.<attrName>" ;
createEmbeddedNodeRL4 -dfp $dna -amn $amn -bsn $bsn -cn $cn -jn $jn -n $n;
SGDeleteJointForLOD $lod;
}