forked from sideeffects/SideFXLabs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
PARMmenu.xml
69 lines (61 loc) · 1.65 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
61
62
63
64
65
66
67
68
69
<?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:
from HoudiniExprEditor import ParmWatcher
return ParmWatcher.is_valid_parm(kwargs["parms"][0])
except:
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["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:
from HoudiniExprEditor import ParmWatcher
return ParmWatcher.parm_has_watcher(kwargs["parms"][0])
except:
return False]]>
</expression>
</context>
<scriptCode>
<![CDATA[
from HoudiniExprEditor import ParmWatcher
try:
reload(ParmWatcher)
except NameError:
from importlib import reload
reload(ParmWatcher)
ParmWatcher.remove_file_watched(kwargs["parms"][0])]]>
</scriptCode>
</addScriptItem>
</menu>
</menuDocument>