35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
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/09/16
|
|||
|
//
|
|||
|
//******************************************************************************
|
|||
|
|
|||
|
global proc SGAddBlendShape (string $targetName){
|
|||
|
string $sel[] = `ls -sl`;
|
|||
|
for ($i=0; $i<size($sel); $i++) {
|
|||
|
for ($j=0; $j<50; $j++) {
|
|||
|
string $meshe = `SGGetMeshes -m $j`;
|
|||
|
if($sel[$i] == $meshe){
|
|||
|
if($targetName != ""){
|
|||
|
string $blendShape = `SGGetBlendShape $meshe`;
|
|||
|
if(!`objExists $blendShape`){
|
|||
|
$blendShape = `SGGetMeshes -i $j` + "_blendShapes";
|
|||
|
blendShape -automatic -n $blendShape $meshe;
|
|||
|
}
|
|||
|
string $attrWeight = $blendShape + ".weight";
|
|||
|
string $currentBlendShapeList[] = `listAttr -m $attrWeight`;
|
|||
|
if(!stringArrayContains($targetName, $currentBlendShapeList)){
|
|||
|
duplicate -rr -n $targetName $meshe;
|
|||
|
int $targetIndex = `getAttr -size $attrWeight`;
|
|||
|
blendShape -e -tc on -t $meshe $targetIndex $targetName 1 -w $targetIndex 0 $blendShape;
|
|||
|
delete $targetName;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
select -r $sel;
|
|||
|
}
|