-
Notifications
You must be signed in to change notification settings - Fork 118
/
OPmenu.xml
78 lines (68 loc) · 2.95 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file defines the menu items when right-clicking over nodes in
Houdini.
Files named the same (ie. OPmenu.xml) can exist in $HOME/houdiniX.Y/
directory and will supplement the original definitions found in
$HFS/houdini/ (aka $HH).
The format in this file is similar to the format in $HH/MainMenuMaster
except that it uses the <menuDocument> and <menu> tags instead of
<mainMenu> and <menuBar>. See the comments in that file for more advanced
customization abilities.
Note that the id's correspond to their hotkeys with the h.pane.wsheet.
prefix (where available). For example, the item with id,
"opmenu.flag_display", refers to the action in the hotkeys manager as
"h.pane.wsheet.opemnu.flag_display".
Also note that you can specify which context a particular menu item shows
up in. To do this, add a context property:
<context>
<networkCategory>Object</networkCategory>
</context>
Or, for multiple contexts, a comma-separated list:
<context>
<networkCategory>Object,Sop,Dop,Pop</networkCategory>
</context>
Or use an expression to determine if the menu item appears in the current
context. For example, to make the menu item appear only if the node is an
Object node:
<context>
<expression>kwargs["node"].type().category().name() == "Object"</expression>
</context>
For context expressions and menu scripts, a 'kwargs' python dictionary is
provided with the following values:
'node' : The node that the menu was opened for.
'toolname' : The menu item's hotkey id (ie. the element's id
prefixed with h.pane.parms.)
'altclick' : True if the Alt key was also pressed, False otherwise
'ctrlclick' : True if the Ctrl key was also pressed, False otherwise
'shiftclick' : True if the Shift key was also pressed, False otherwise
'cmdclick' : True if the Option key was also pressed, False
otherwise. Note that this can only be true on OSX.
-->
<menuDocument>
<!--
<menu>
<subMenu id="opmenu.actions_menu">
<scriptItem id="opmenu.select_node_same_type_ql">
<modifyItem><insertAfter>opmenu.select_node</insertAfter></modifyItem>
<label>Select All of Same Type [qL]</label>
<scriptCode><![CDATA[
import qlibutils;
sel = qlibutils.find_same_nodes([kwargs['node']])
for s in sel:
s.setSelected(True)
]]></scriptCode>
</scriptItem>
<separatorItem id="opmenu.select_node_same_type_sep_ql">
<modifyItem><insertAfter>opmenu.select_node_same_type_ql</insertAfter></modifyItem>
</separatorItem>
</subMenu>
<scriptItem id="opmenu.tmp_show_kwargs_ql">
<label>debug: show kwargs [qL]</label>
<scriptCode><![CDATA[
hou.ui.displayMessage(str(kwargs))
]]></scriptCode>
</scriptItem>
</menu>
-->
</menuDocument>