forked from cgtoolbox/HoudiniExprEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainMenuCommon.xml
60 lines (52 loc) · 1.41 KB
/
MainMenuCommon.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
-->
<mainMenu>
<!-- menuDocument can only contain 1 menu element, whose id is
implicitly "root_menu"
-->
<menu>
<!-- Set external editor -->
<addScriptItem id="set_external_editor">
<label>Set External Expressions Editor</label>
<parent>preferences_submenu</parent>
<insertAfter>h.prefs_misc</insertAfter>
<scriptCode>
<![CDATA[
from HoudiniExprEditor import ParmWatcher
try:
reload(ParmWatcher)
except NameError:
from importlib import reload
reload(ParmWatcher)
ParmWatcher.set_external_editor()]]>
</scriptCode>
</addScriptItem>
<!-- Open session module source watcher -->
<addScriptItem id="external_python_source_editor">
<label>External Python Source Editor</label>
<parent>windows_menu</parent>
<insertAfter>h.python_source_editor</insertAfter>
<context>
<expression>
<![CDATA[
try:
from HoudiniExprEditor import ParmWatcher
return True
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("__temp__python_source_editor", type_="__temp__python_source_editor")]]>
</scriptCode>
</addScriptItem>
</menu>
</mainMenu>