forked from sideeffects/GameDevelopmentToolset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PARMmenu.xml
60 lines (53 loc) · 1.48 KB
/
PARMmenu.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"?>
<!--
-->
<menuDocument>
<!-- menuDocument can only contain 1 menu element, whose id is
implicitly "root_menu"
-->
<menu>
<!-- External Editor -->
<addScriptItem id="open_external_editor">
<label>Edit in External Editor</label>
<parent>expression_menu</parent>
<insertAfter>edit_expression</insertAfter>
<context>
<expression>
<![CDATA[
try:
import houdini_external_editor
return houdini_external_editor.is_valid_parm(kwargs["parms"][0])
except:
return False]]></expression>
</context>
<scriptCode>
<![CDATA[
import houdini_external_editor
reload(houdini_external_editor)
houdini_external_editor.add_watcher(kwargs["parms"][0])]]>
</scriptCode>
</addScriptItem>
<!-- Remove watcher -->
<addScriptItem id="remove_file_watcher">
<label>Remove File Watcher</label>
<parent>expression_menu</parent>
<insertAfter>open_external_editor</insertAfter>
<context>
<expression>
<![CDATA[
try:
import houdini_external_editor
return houdini_external_editor.parm_has_watcher(kwargs["parms"][0])
except:
return False]]>
</expression>
</context>
<scriptCode>
<![CDATA[
import houdini_external_editor
reload(houdini_external_editor)
houdini_external_editor.remove_file_watched(kwargs["parms"][0])]]>
</scriptCode>
</addScriptItem>
</menu>
</menuDocument>