-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.mel
More file actions
66 lines (59 loc) · 2.03 KB
/
menu.mel
File metadata and controls
66 lines (59 loc) · 2.03 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
proc randomNode()
{
polySphere;
instancer;
createNode randomNode;
connectAttr pSphere1.matrix instancer1.inputHierarchy[0];
connectAttr randomNode1.outPoints instancer1.inputPoints;
}
proc randomNodeSelected()
{
string $selObjs[] = `ls -sl`;
string $selShape = $selObjs[0] + ".matrix";
instancer;
createNode randomNode;
connectAttr $selShape instancer1.inputHierarchy[0];
connectAttr randomNode1.outPoints instancer1.inputPoints;
}
proc lSystemInstance()
{
polySphere -n lSystemSphere;
polyCube -n lSystemCube;
instancer -n instancerSphere;
instancer -n instancerCube;
createNode lSystemNode -n lSystemCurNode;
connectAttr lSystemCube.matrix instancerCube.inputHierarchy[0];
connectAttr lSystemSphere.matrix instancerSphere.inputHierarchy[0];
connectAttr lSystemCurNode.outBranches instancerCube.inputPoints;
connectAttr lSystemCurNode.outFlowers instancerSphere.inputPoints;
}
proc lSystemInstanceSelected()
{
string $selObjs[] = `ls -sl`;
string $selShape1 = $selObjs[0];
if($selShape1 == "")
{
return;
}
$selShape1 = $selObjs[0] + ".matrix";
string $selShape2 = $selObjs[1];
if($selShape2 == "")
{
return;
}
$selShape2 = $selObjs[1] + ".matrix";
instancer -n instancerSphere;
instancer -n instancerCube;
createNode lSystemNode -n lSystemCurNode;
connectAttr $selShape1 instancerCube.inputHierarchy[0];
connectAttr $selShape2 instancerSphere.inputHierarchy[0];
connectAttr lSystemCurNode.outBranches instancerCube.inputPoints;
connectAttr lSystemCurNode.outFlowers instancerSphere.inputPoints;
}
global string $gMainWindow;
setParent $gMainWindow;
menu -label "LSystemInstance" -tearOff true;
menuItem -label "randomNode" -command "randomNode()";
menuItem -label "randomNodeSelected" -command "randomNodeSelected()";
menuItem -label "lSystemInstance" -command "lSystemInstance()";
menuItem -label "lSystemInstanceSelected" -command "lSystemInstanceSelected()";