forked from eglaubauf/egMatLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OPmenu.xml
65 lines (64 loc) · 1.94 KB
/
OPmenu.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<menuDocument>
<menu>
<!--***********************************-->
<scriptItem id="saveMatToEgLib">
<context>
<expression>
<![CDATA[
n = kwargs.get("node", None)
if n.type().name() == "redshift_vopnet":
return True
elif n.type().name() == "octane_vopnet":
return True
elif n.type().name() == "materialbuilder":
return True
elif n.type().name() == "principledshader::2.0":
return True
elif n.type().name() == "arnold_materialbuilder":
return True
return False ]]>
</expression>
</context>
<labelExpression>
<![CDATA[
n = kwargs.get("node", None)
if n.type().name() == "redshift_vopnet":
return "Save Material to MatLib"
elif n.type().name() == "octane_vopnet":
return "Save Material to MatLib"
elif n.type().name() == "materialbuilder":
return "Save Material to MatLib"
elif n.type().name() == "principledshader::2.0":
return "Save Material to MatLib"
elif n.type().name() == "arnold_materialbuilder":
return "Save Material to MatLib"
return "Unavailable in this Context"
]]>
</labelExpression>
<scriptCode>
<![CDATA[
n = kwargs.get("node", None)
if n.type().name() == "redshift_vopnet":
import egMatLib
egMatLib.saveMaterial(n)
elif n.type().name() == "octane_vopnet":
import egMatLib
egMatLib.saveMaterial(n)
elif n.type().name() == "materialbuilder":
import egMatLib
egMatLib.saveMaterial(n)
elif n.type().name() == "principledshader::2.0":
import egMatLib
egMatLib.saveMaterial(n)
elif n.type().name() == "arnold_materialbuilder":
import egMatLib
egMatLib.saveMaterial(n)
else:
hou.ui.displayMessage('Please select Material Builder Nodes to save Material')
]]>
</scriptCode>
</scriptItem>
<!--***********************************-->
</menu>
</menuDocument>