111 lines
3.4 KiB
Plaintext
111 lines
3.4 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/11/18
|
|||
|
//
|
|||
|
//******************************************************************************
|
|||
|
|
|||
|
global proc SGRBFDeformerWindow(){
|
|||
|
|
|||
|
if (!`window -ex SuperRiggingEditor`){
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
if (`window -ex RBFDeformerWin`){
|
|||
|
deleteUI -window RBFDeformerWin;
|
|||
|
}
|
|||
|
|
|||
|
string $Load = "Load...";
|
|||
|
string $Original = "Original<61><6C>";
|
|||
|
string $Deformed = "Deformed<65><64>";
|
|||
|
string $Radius = "Radius<75><73>";
|
|||
|
string $Points = "Points<74><73>";
|
|||
|
string $Execute = "Execute";
|
|||
|
|
|||
|
if(`SGDescriptor -l` == "ZH"){
|
|||
|
$Load = "<22><><EFBFBD><EFBFBD>...";
|
|||
|
$Original = "ԭʼģ<CABC>ͣ<EFBFBD>";
|
|||
|
$Deformed = "<22><><EFBFBD><EFBFBD>ģ<EFBFBD>ͣ<EFBFBD>";
|
|||
|
$Radius = "<22><><EFBFBD><EFBFBD><EFBFBD>뾶<EFBFBD><EBBEB6>";
|
|||
|
$Points = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
$Execute = "<22><>ʼִ<CABC><D6B4>";
|
|||
|
}
|
|||
|
|
|||
|
window -p SuperRiggingEditor -w 310 -h 100 -t "RBF Deformer" -s true -tb true RBFDeformerWin;
|
|||
|
columnLayout -adj 1 -columnAttach "both" 5 -rowSpacing 2 -columnWidth 150 ;
|
|||
|
separator -height 10 -style "in";
|
|||
|
|
|||
|
textFieldButtonGrp -adj 2 -cw3 70 1 30 -l $Original -bl $Load -bc "SGRBFDeformerLoadOriginal;" RBFDeformer_Original;
|
|||
|
textFieldButtonGrp -adj 2 -cw3 70 1 30 -l $Deformed -bl $Load -bc "SGRBFDeformerLoadDeformed;" RBFDeformer_Deformed;
|
|||
|
|
|||
|
separator -height 10 -style "in";
|
|||
|
rowLayout -adj 3 -nc 3 -cw3 70 70 1 -ct3 "right" "left" "left";
|
|||
|
text -l $Radius;
|
|||
|
floatField -w 70 -max 2 -min 0.001 -v 0.1 -cc "SGSetRadiusSlider;" RBFDeformer_RadiusField;
|
|||
|
floatSlider -max 2 -min 0.001 -v 0.1 -dc "SGSetRadiusField;" RBFDeformer_RadiusSlider;
|
|||
|
setParent..;
|
|||
|
|
|||
|
rowLayout -adj 3 -nc 3 -cw3 70 70 1 -ct3 "right" "left" "left";
|
|||
|
text -l $Points;
|
|||
|
intField -w 70 -max 10000 -min 100 -v 2000 -cc "SGSetPointsSlider;" RBFDeformer_PointsField;
|
|||
|
intSlider -max 10000 -min 100 -v 2000 -dc "SGSetPointsField;" RBFDeformer_PointsSlider;
|
|||
|
setParent..;
|
|||
|
|
|||
|
separator -height 10 -style "in";
|
|||
|
|
|||
|
button -l $Execute -al "center" -c "SGRBFDeformerExecute;" RBFDeformer_Execute;
|
|||
|
|
|||
|
separator -height 10 -style "in";
|
|||
|
|
|||
|
showWindow RBFDeformerWin;
|
|||
|
}
|
|||
|
|
|||
|
global proc SGRBFDeformerExecute(){
|
|||
|
|
|||
|
string $Original = `textFieldButtonGrp -q -tx RBFDeformer_Original`;
|
|||
|
string $Deformed = `textFieldButtonGrp -q -tx RBFDeformer_Deformed`;
|
|||
|
float $Radius = `floatField -q -v RBFDeformer_RadiusField`;
|
|||
|
int $Points = `intField -q -v RBFDeformer_PointsField`;
|
|||
|
|
|||
|
int $OrgVtx[] = `polyEvaluate -v $Original`;
|
|||
|
int $DefVtx[] = `polyEvaluate -v $Deformed`;
|
|||
|
|
|||
|
if($OrgVtx[0] != $DefVtx[0]){
|
|||
|
error -n "The topology of the two models is inconsistent...";
|
|||
|
return ;
|
|||
|
}
|
|||
|
|
|||
|
string $sel[] = `ls -sl`;
|
|||
|
SGRBFDeformer -r $Radius -np $Points -rbf 1 -m $Original $Deformed -t $sel;
|
|||
|
}
|
|||
|
|
|||
|
global proc SGRBFDeformerLoadOriginal(){
|
|||
|
string $sel[] = `ls -sl`;
|
|||
|
textFieldButtonGrp -e -tx $sel[0] RBFDeformer_Original;
|
|||
|
}
|
|||
|
|
|||
|
global proc SGRBFDeformerLoadDeformed(){
|
|||
|
string $sel[] = `ls -sl`;
|
|||
|
textFieldButtonGrp -e -tx $sel[0] RBFDeformer_Deformed;
|
|||
|
}
|
|||
|
|
|||
|
global proc SGSetRadiusField(){
|
|||
|
float $v = `floatSlider -q -v RBFDeformer_RadiusSlider`;
|
|||
|
floatField -e -v $v RBFDeformer_RadiusField;
|
|||
|
}
|
|||
|
|
|||
|
global proc SGSetRadiusSlider(){
|
|||
|
float $v = `floatField -q -v RBFDeformer_RadiusField`;
|
|||
|
floatSlider -e -v $v RBFDeformer_RadiusSlider;
|
|||
|
}
|
|||
|
|
|||
|
global proc SGSetPointsField(){
|
|||
|
int $v = `intSlider -q -v RBFDeformer_PointsSlider`;
|
|||
|
intField -e -v $v RBFDeformer_PointsField;
|
|||
|
}
|
|||
|
|
|||
|
global proc SGSetPointsSlider(){
|
|||
|
int $v = `intField -q -v RBFDeformer_PointsField`;
|
|||
|
intSlider -e -v $v RBFDeformer_PointsSlider;
|
|||
|
}
|