Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (`window -exists $newWindow`) {
- deleteUI $newWindow;
- }
- //////////////////////////////////////////////////////////////////////////
- string $newWindow = `window -title "Strahovid" -menuBar true`;
- menu -label "Edit";
- menuItem -label "Undo" -command "Undo";
- menuItem -label "Redo" -command "Redo";
- columnLayout;
- menu -label "Help" -helpMenu true;
- menuItem -label "About Script...";
- // about
- columnLayout;
- scrollLayout scrollLayout;
- columnLayout -adjustableColumn true;
- frameLayout -label "Deform & cut tool" -borderStyle "in";
- columnLayout -adjustableColumn true;
- floatSliderGrp -label "Vertex offset X: " -field 1 -value 0.1 -min 0 -max 0.5 -step 0.01 X;
- floatSliderGrp -label "Vertex offset Y: " -field 1 -value 0.1 -min 0 -max 0.5 -step 0.01 Y;
- floatSliderGrp -label "Vertex offset Z: " -field 1 -value 0.1 -min 0 -max 0.5 -step 0.01 Z;
- setParent ..;
- columnLayout -adjustableColumn true;
- button -w 174 -h 26 -label "Deform" -command "deform";
- button -w 174 -h 26 -label "Cut" -command "cut";
- button -w 174 -h 26 -label "Close" -command ("deleteUI -window " + $newWindow);
- setParent ..;
- showWindow $newWindow;
- //////////////////////////////////////////////////////////////////////////
- global proc deform() {
- string $list[] = `ls -sl -fl`;
- string $item;
- float $mX = `floatSliderGrp -q -v X`;
- float $mY = `floatSliderGrp -q -v Y`;
- float $mZ = `floatSliderGrp -q -v Z`;
- for($item in $list) {
- move -r (rand(-$mX,$mX)) (rand(-$mY,$mY)) (rand(-$mZ,$mZ)) $item;
- }
- }
- //////////////////////////////////////////////////////////////////////////
- global proc cut() {
- string $o1[] = `ls -sl`;
- string $ob1 = $o1[0];
- string $ob2 = $o1[1];
- string $o2[] = `duplicate $o1`;
- string $o5[] = `duplicate $ob1`;
- string $ob3 = $o2[0];
- string $ob4 = $o2[1];
- polyNormal $ob3;
- string $rez1[] = `polyBoolOp -op 3 $ob1 $ob2`;
- string $rez2[] = `polyBoolOp -op 3 $ob3 $ob4`;
- xform -cp $rez1 $rez2 $o5;
- select $o5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement