-
Notifications
You must be signed in to change notification settings - Fork 196
/
OPmenu.xml
57 lines (57 loc) · 1.42 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
<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="expreditor_edit_extra_sections">
<label>Edit Extra Sections Source Code</label>
<insertAtIndex>49</insertAtIndex>
<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>