-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathOPmenu.xml
48 lines (41 loc) · 1.76 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
<?xml version="1.0" encoding="UTF-8"?>
<menuDocument>
<menu>
<addScriptItem id="opmenu.hammer_play_audio">
<label>Play Audio</label>
<parent>opmenu.actions_menu</parent>
<insertBefore />
<context>
<expression>
from hammer_tools.settings import SettingsManager
if not SettingsManager.instance().value('hammer.audio.play.enable'):
return 0
node_type = kwargs['node'].type()
return node_type.category() in (hou.chopNodeTypeCategory(), hou.chopNetNodeTypeCategory()) or node_type.name() == 'chopnet'
</expression>
</context>
<scriptCode>
from hammer_tools.nodeutils import playChopAudio
playChopAudio(kwargs['node'])
</scriptCode>
</addScriptItem>
<addScriptItem id="opmenu.hammer_set_scene_audio">
<label>Use as Scene Audio</label>
<parent>opmenu.actions_menu</parent>
<insertAfter>opmenu.hammer_play_audio</insertAfter>
<context>
<expression>
from hammer_tools.settings import SettingsManager
if not SettingsManager.instance().value('hammer.audio.set_scene_audio.enable'):
return 0
node_type = kwargs['node'].type()
return node_type.category() in (hou.chopNodeTypeCategory(), hou.chopNetNodeTypeCategory()) or node_type.name() == 'chopnet'
</expression>
</context>
<scriptCode>
from hammer_tools.nodeutils import setSceneChopAudio
setSceneChopAudio(kwargs['node'])
</scriptCode>
</addScriptItem>
</menu>
</menuDocument>