forked from tangent-opensource/SideFXLabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OPmenu.xml
164 lines (148 loc) · 3.77 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<menuDocument>
<!-- menuDocument can only contain 1 menu element, whose id is
implicitly "root_menu"
-->
<menu>
<scriptItem id="expreditor_edit_python_code">
<label>Edit python source code</label>
<context>
<expression>
<![CDATA[
try:
from HoudiniExprEditor import ParmWatcher
return ParmWatcher.is_python_node(kwargs["node"])
except Exception as e:
return False]]>
</expression>
</context>
<scriptCode>
<![CDATA[
from HoudiniExprEditor import ParmWatcher
try:
reload(ParmWatcher)
except NameError:
from importlib import reload
reload(ParmWatcher)
ParmWatcher.add_watcher(kwargs["node"], type_="python_node")]]>
</scriptCode>
</scriptItem>
<scriptItem id="opmenu.vhda_create">
<label>Create Versioned Digital Asset...</label>
<insertAtIndex>47</insertAtIndex>
<context>
<expression>
import hou
import assettools
reload(assettools)
node = kwargs["node"]
if assettools.isSubnet(node):
return 1
else:
return 0
</expression>
</context>
<scriptCode>
<![CDATA[
import hou
import assettools
node = kwargs["node"]
assettools.createNewVHDAFromSubnet(node)
]]>
</scriptCode>
</scriptItem>
<subMenu id="opmenu.vhda_options">
<label>Versioned Digital Asset</label>
<insertAtIndex>47</insertAtIndex>
<context>
<expression>
import hou
import assettools
reload(assettools)
node = kwargs["node"]
if assettools.isVHDA(node) or assettools.isHDA(node):
return 1
else:
return 0
</expression>
</context>
<scriptItem id="opmenu.vhda_bump_major">
<label>Increase Major Version</label>
<context>
</context>
<scriptCode>
<![CDATA[
import hou
import assettools
node = kwargs["node"]
assettools.increaseMajorVersion(node)
]]>
</scriptCode>
</scriptItem>
<scriptItem id="opmenu.vhda_bump_minor">
<label>Increase Minor Version</label>
<context>
</context>
<scriptCode>
<![CDATA[
import hou
import assettools
node = kwargs["node"]
assettools.increaseMinorVersion(node)
]]>
</scriptCode>
</scriptItem>
<scriptItem id="opmenu.vhda_copy_to_new">
<label>Save As...</label>
<context>
</context>
<scriptCode>
<![CDATA[
import hou
import assettools
node = kwargs["node"]
assettools.copyToNewVHDA(node)
]]>
</scriptCode>
</scriptItem>
<!-- <scriptItem id="opmenu.vhda_make_release">
<label>New Release...</label>
<context>
</context>
<scriptCode>
<![CDATA[
import hou
import assettools
node = kwargs["node"]
assettools.createNewRHDA(node)
]]>
</scriptCode>
</scriptItem> -->
</subMenu>
<scriptItem id="expreditor_edit_extra_sections">
<label>Edit Extra Sections Source Code</label>
<context>
<expression>
<![CDATA[
try:
import os
if os.environ.get("HOUDINI_EXPR_DISABLE_SECTIONS") == "1":
return False
from HoudiniExprEditor import ParmWatcher
return len(ParmWatcher.get_extra_file_scripts(kwargs["node"])) > 0
except Exception as e:
return False]]>
</expression>
</context>
<scriptCode>
<![CDATA[
from HoudiniExprEditor import ParmWatcher
try:
reload(ParmWatcher)
except NameError:
from importlib import reload
reload(ParmWatcher)
ParmWatcher.add_watcher_to_section(kwargs["node"])]]>
</scriptCode>
</scriptItem>
</menu>
</menuDocument>