Advertisement
Guest User

deform&cut tool

a guest
Oct 15th, 2012
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 2.27 KB | None | 0 0
  1. if (`window -exists $newWindow`) {
  2.     deleteUI $newWindow;
  3. }
  4.  
  5. //////////////////////////////////////////////////////////////////////////
  6. string $newWindow = `window -title "Strahovid" -menuBar true`;
  7.  
  8.     menu -label "Edit";
  9.         menuItem -label "Undo" -command "Undo";
  10.         menuItem -label "Redo" -command "Redo";
  11.     columnLayout;
  12.     menu -label "Help" -helpMenu true;
  13.         menuItem -label "About Script...";
  14.         // about
  15.     columnLayout;
  16.  
  17.     scrollLayout scrollLayout;
  18.         columnLayout -adjustableColumn true;
  19.             frameLayout -label "Deform & cut tool" -borderStyle "in";
  20.                 columnLayout -adjustableColumn true;
  21.                     floatSliderGrp -label "Vertex offset X: " -field 1 -value 0.1 -min 0 -max 0.5 -step 0.01 X;
  22.                     floatSliderGrp -label "Vertex offset Y: " -field 1 -value 0.1 -min 0 -max 0.5 -step 0.01 Y;
  23.                     floatSliderGrp -label "Vertex offset Z: " -field 1 -value 0.1 -min 0 -max 0.5 -step 0.01 Z;
  24.                 setParent ..;
  25.                
  26.                 columnLayout -adjustableColumn true;
  27.                     button -w 174 -h 26 -label "Deform" -command "deform";
  28.                     button -w 174 -h 26 -label "Cut" -command "cut";
  29.                     button -w 174 -h 26 -label "Close" -command ("deleteUI -window " + $newWindow);
  30.                 setParent ..;
  31.                
  32. showWindow $newWindow;
  33.  
  34. //////////////////////////////////////////////////////////////////////////
  35. global proc deform() {
  36.     string $list[] = `ls -sl -fl`;
  37.     string $item;
  38.     float $mX = `floatSliderGrp -q -v X`;
  39.     float $mY = `floatSliderGrp -q -v Y`;
  40.     float $mZ = `floatSliderGrp -q -v Z`;
  41.     for($item in $list) {
  42.         move -r (rand(-$mX,$mX)) (rand(-$mY,$mY)) (rand(-$mZ,$mZ)) $item;
  43.     }
  44. }
  45.  
  46.  
  47. //////////////////////////////////////////////////////////////////////////
  48. global proc cut() {
  49.     string $o1[] = `ls -sl`;
  50.     string $ob1 = $o1[0];
  51.     string $ob2 = $o1[1];
  52.     string $o2[] = `duplicate $o1`;
  53.     string $o5[] = `duplicate $ob1`;
  54.     string $ob3 = $o2[0];
  55.     string $ob4 = $o2[1];
  56.     polyNormal $ob3;
  57.     string $rez1[] = `polyBoolOp -op 3 $ob1 $ob2`;
  58.     string $rez2[] = `polyBoolOp -op 3 $ob3 $ob4`;
  59.     xform -cp $rez1 $rez2 $o5;
  60.     select $o5;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement