-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlsys.mel
53 lines (47 loc) · 1.73 KB
/
lsys.mel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
global proc openGrammar(){
global string $fileName;
$fileName = `fileDialog`;
return;
}
global proc OKfunc(){
global string $sliderIt, $sliderSS, $sliderDA, $fileName;
print `floatSliderGrp -q -value $sliderSS`;
print `floatSliderGrp -q -value $sliderDA`;
print `floatSliderGrp -q -value $sliderIt`;
print $fileName;
LSystemCmd -stepsize `floatSliderGrp -q -value $sliderSS` -angle `floatSliderGrp -q -value $sliderDA` -iteration `floatSliderGrp -q -value $sliderIt` -grammar $fileName;
}
global proc lsys(){
window;
columnLayout;
global string $sliderIt, $sliderSS, $sliderDA, $fileName;
button -label "Open Grammar File" -command "openGrammar";
$sliderIt = `floatSliderGrp -label "Iterations" -field true -minValue 0 -maxValue 10`;
$sliderSS = `floatSliderGrp -label "Default Step Size" -field true -fieldMinValue -180 -fieldMaxValue 180 -minValue 0 -maxValue 100`;
$sliderDA = `floatSliderGrp -label "Default angle" -field true -minValue -180 -maxValue 180`;
button -label "OK" -command "OKfunc()";
showWindow;
}
global proc lnode(){
createNode transform -n LSystem1;
createNode mesh -n LSystemShape1 -p LSystem1;
sets -add initialShadingGroup LSystemShape1;
createNode LSystemNode -n LSystemNode1;
connectAttr time1.outTime LSystemNode1.time;
connectAttr LSystemNode1.outputMesh LSystemShape1.inMesh;
}
//global string $gMainWindow;
//setParent $gMainWindow;
global string $sliderIt, $sliderSS, $sliderDA, $fileName;
menu -l "LSystem"
-p MayaWindow
-to 1
-aob true
LsystemMenu;
global string $sliderIt, $sliderSS, $sliderDA, $fileName;
menuItem -l "LSystem Command"
-command "lsys()"
LsysCMDItem;
menuItem -l "LSystem Node..."
-command "lnode()"
LnodeMenuItem;