-
Notifications
You must be signed in to change notification settings - Fork 195
/
NetworkViewMenu.xml
130 lines (129 loc) · 5.22 KB
/
NetworkViewMenu.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file defines the menu items in the Houdini Network View pane.
Files named the same (ie. NetworkViewMenu.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.
See the comments in that file for more advanced customization abilities.
Note that the id's correspond to their hotkeys with the h. prefix. Please
use ids that begin with playbar. when adding new items.
For scriptItem elements, a 'kwargs' python dictionary is provided with the
following values:
'parms' : A list of hou.Parm objects which the script was invoked
upon.
'toolname' : The menu item's hotkey id
'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.
-->
<mainMenu>
<menuBar>
<subMenu id="labs_network_view_menu">
<modifyItem>
<insertBefore>help_menu</insertBefore>
</modifyItem>
<label>Labs</label>
<scriptItem id="parameter_diff">
<label>Node Parameter Differences</label>
<scriptCode>
<![CDATA[
import pyper.widgets.diff as diffmodule
win = diffmodule.run()
hou.session.dummy = win
]]>
</scriptCode>
</scriptItem>
<scriptItem id="labs_check_node_versions">
<label>Scan for Non-latest Labs Nodes</label>
<scriptCode>
<![CDATA[
labs_nodes = [n for n in hou.node("/").allSubChildren() if n.type().nameComponents()[1] == "labs"]
all_up_to_date = 1
paths = ''
for node in labs_nodes:
if node.type().name() != node.type().namespaceOrder()[0]:
paths += node.path() + "\n"
all_up_to_date = 0
if all_up_to_date:
if len(labs_nodes) == 0:
print ("No Labs node is found in the scene.\n")
else:
print ("All Labs nodes found in the scene are using the latest versions.\n")
else:
print ("The following Labs nodes are not using the latest versions:\n" + paths)
]]>
</scriptCode>
</scriptItem>
<separatorItem id="labs_network_view_menu_sep1"/>
<titleItem id="annotation_title">
<label>Network Annotation</label>
</titleItem>
<scriptItem id="labs_paint">
<label>Paint</label>
<scriptCode>
<![CDATA[
from labsopui import networkeditordrawing
networkeditordrawing.paint_in_editor(kwargs['editor'])
]]>
</scriptCode>
</scriptItem>
<scriptItem id="labs_screenshot">
<label>Capture and Embed</label>
<scriptCode>
<![CDATA[
from labsopui import screensampling
screensampling.capture_and_embed(kwargs['editor'])
]]>
</scriptCode>
</scriptItem>
<scriptItem id="labs_sticker">
<label>Sticker Placer</label>
<scriptCode>
<![CDATA[
from labsopui import stickerplacer
dialog = stickerplacer.StickerPlacer(hou.qt.mainWindow())
dialog.show()
]]>
</scriptCode>
</scriptItem>
<separatorItem id="labs_network_view_menu_sep2"/>
<scriptItem id="labs_node_to_network_origin">
<label>Node to Network Origin</label>
<scriptCode>
<![CDATA[
from labsopui import network_organize
network_organize.node_to_network_origin()
]]>
</scriptCode>
</scriptItem>
<subMenu id="labs_network_view_menu_more">
<label>More</label>
<scriptItem id="labs_node_to_network_origin_with_images">
<label>Node to Network Origin with Images</label>
<scriptCode>
<![CDATA[
from labsopui import network_organize
network_organize.node_to_network_origin(move_images=True)
]]>
</scriptCode>
</scriptItem>
<scriptItem id="labs_networkwalk_hotkeys">
<label>Network Walk Hotkeys</label>
<scriptCode>
<![CDATA[
from labsopui import networkwalk
action = hou.ui.displayMessage("Would you like to assign or remove Network Walk hotkeys?", buttons=('Assign',"Remove","Cancel"), severity=hou.severityType.Message, default_choice=2, close_choice=2, help=None, title="Network Walk", details=None, details_label=None, details_expanded=False)
if action == 0:
networkwalk.add_actions()
elif action == 1:
networkwalk.remove_actions()
]]>
</scriptCode>
</scriptItem>
</subMenu>
</subMenu>
</menuBar>
</mainMenu>