Mirror shave mel

/*
*
* Problem:mirrored shave shorter than original
*
*
* Create: Dec 22 2009
* Last Modify:
*
*/


proc shaveMirrorWin()
{
if(`window -exists mainWindow` == true)
deleteUI mainWindow;
window
-sizeable true
-minimizeButton true
-maximizeButton false
-menuBarVisible false
-widthHeight 200 300
-title "Mirror Shave"
mainWindow;

string $coLayout1 = `columnLayout -columnAttach "both" 5 -rowSpacing 5 -columnWidth 250`;

textScrollList -height 40 -width 150 textScroll_01;

string $rowLayout1 = `rowLayout -numberOfColumns 2 -columnWidth2 120 120 -columnAlign 1 "center" -columnAlign 2 "center"-columnAttach 1 "both" 0 -columnAttach 2 "both" 0`;

string $loadButton = `button -height 28 -label "Load Shave" -width 120 -c "listShave" `;

string $convertButton = `button -height 28 -label "ConvertCurve" -width 120 -c "convertCurve" `;

setParent..;

string $sep1 = `separator -height 10 -style "in"`;

string $coLayout2 = `columnLayout -columnAttach "both" 3 -rowSpacing 3 -columnWidth 240`;

intSliderGrp
-label "CombNum"
-field true
-cw3 58 22 40
-minValue 0 -maxValue 10
-fieldMinValue 0 -fieldMaxValue 10
-value 0
-cl3 "center" "center" "center"
reduce_Percentum;

string $reduceButton = `button -height 28 -label "Reduce" -width 150 -c "combNumReduce"`;

setParent..;

string $sep2 = `separator -height 10 -style "in"`;

string $coLayout3 = `columnLayout -columnAttach "both" 5 -rowSpacing 5 -columnWidth 240`;

radioButtonGrp
-numberOfRadioButtons 3
-cw 1 90
-cw 2 90
-cw 3 60
-labelArray3 "+X" "+Y" "+Z"
-select 1
mirrorAxisRadioButton;

$mirButton = `button -height 28 -label "Mirror" -width 150 -c mirrorShave`;

setParent..;

showWindow;
}


proc listShave()
{

string $selObj[] = `ls -sl -fl`;
textScrollList -e -ra textScroll_01;
textScrollList -e -a $selObj[0] textScroll_01;

}

proc convertCurve()
{
string $shaveList[] = `textScrollList -q -si textScroll_01`;
select $shaveList;
shaveCreateCurvesFromHairs;
}

proc combNumReduce()
{
int $percentumNum = `intSliderGrp -q -value reduce_Percentum`;

$shaveCrvGrp1 = `ls -sl`;

for($i=0; $i<$percentumNum; $i++)
{
string $sel[] = `filterExpand -sm 9`;
for($k=0; $k<size($sel); $k++)
{
if($k%2 == 0)
{
delete $sel[$k];
}
}
}

}

proc mirrorShave()
{
string $selFaces[] = `filterExpand -sm 34`;
if(size($selFaces) == 0)
error "You Must Select Faces First!";

string $shaveList[] = `textScrollList -q -si textScroll_01`;
select $shaveList[0];
string $shaveShpNod[] = `ls -sl -dag -s`;

select $selFaces;
shaveCreateHairCopy($shaveShpNod[0]);

string $newShav[] = `ls -sl`;

int $r = `radioButtonGrp -q -select mirrorAxisRadioButton`;

string $mirrorDirection;
switch($r)
{
case 1:
$mirrorDirection = "shaveCurveGroup1.scaleX";
break;
case 2:
$mirrorDirection = "shaveCurveGroup1.scaleY";
break;
case 3:
$mirrorDirection = "shaveCurveGroup1.scaleZ";
break;
}

string $scalComd = "setAttr " + $mirrorDirection + " -1";
eval($scalComd);
select shaveCurveGroup1;
FreezeTransformations;

select $newShav[0] shaveCurveGroup1;
shaveCombFromCurves;
select shaveCurveGroup1;
delete;
}

shaveMirrorWin;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值