forked from sideeffects/SideFXLabs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainMenuCommon.xml
More file actions
154 lines (115 loc) · 3.63 KB
/
Copy pathMainMenuCommon.xml
File metadata and controls
154 lines (115 loc) · 3.63 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0" encoding="UTF-8"?>
<!--
-->
<mainMenu>
<!-- menuDocument can only contain 1 menu element, whose id is
implicitly "root_menu"
-->
<menu>
<!-- Set external editor -->
<addScriptItem id="set_external_editor">
<label>Set External Text Editor</label>
<parent>preferences_submenu</parent>
<insertAtIndex>26</insertAtIndex>
<scriptCode>
<![CDATA[
from HoudiniExprEditor import ParmWatcher
from imp import reload
reload(ParmWatcher)
ParmWatcher.set_external_editor()]]>
</scriptCode>
</addScriptItem>
<!-- Open session module source watcher -->
<addScriptItem id="external_python_source_editor">
<label>External Python Source Editor</label>
<parent>windows_menu</parent>
<insertAtIndex>8</insertAtIndex>
<context>
<expression>
<![CDATA[
try:
from HoudiniExprEditor import ParmWatcher
return True
except Exception as e:
return False]]>
</expression>
</context>
<scriptCode>
<![CDATA[
from HoudiniExprEditor import ParmWatcher
from imp import reload
ParmWatcher.add_watcher("__temp__python_source_editor", type_="__temp__python_source_editor")]]>
</scriptCode>
</addScriptItem>
</menu>
<menuBar>
<!-- An example of how to add a new submenu at the beginning of the
window menu.
-->
<subMenu id="file_menu">
<!--<insertAtIndex>3</insertAtIndex>-->
<subMenu id="crash_recovery">
<label>Crash Recovery</label>
<insertAtIndex>3</insertAtIndex>
<scriptItem id="open_crashfile">
<label>Open Crashfile</label>
<scriptCode>
<![CDATA[
import restore_backup
from imp import reload
reload(restore_backup)
restore_backup.recoverFile()
]]>
</scriptCode>
</scriptItem>
<scriptItem id="open_crashdirectory">
<label>Open Crash Directory</label>
<scriptCode>
<![CDATA[
file = hou.ui.selectFile(start_directory="$TEMP/", title="Select a file to open", collapse_sequences=False, file_type=hou.fileType.Hip, pattern=None, default_value=None, multiple_select=False, image_chooser=False, chooser_mode=hou.fileChooserMode.Read, width=0, height=0)
if file != "":
hou.hipFile.load(file, suppress_save_prompt=False, ignore_load_warnings=False)]]>
</scriptCode>
</scriptItem>
</subMenu>
</subMenu>
<subMenu id="assets_menu">
<scriptItem id="check_tool_versions">
<label>Check Asset Versions in Scene</label>
<insertAtIndex>10</insertAtIndex>
<scriptCode>
<![CDATA[
LabsNodeInstances = [x for x in hou.node("/").allSubChildren() if x.type().nameComponents()[1] == "labs"]
for node in LabsNodeInstances:
if node.type().definition().nodeType().name() != hou.nodeType(node.type().definition().nodeTypeCategory(), node.type().definition().nodeTypeName()).namespaceOrder()[0]:
print ("Warning... Node instance is using older definition: ", node.path())
]]>
</scriptCode>
</scriptItem>
</subMenu>
<subMenu id="help_menu">
<scriptItem id="reset_viewport">
<label>Reset Viewport</label>
<insertAtIndex>5</insertAtIndex>
<scriptCode>
<![CDATA[
import reset_viewport
from imp import reload
reload(reset_viewport)
reset_viewport.ResetViewport()]]>
</scriptCode>
</scriptItem>
<scriptItem id="quick_tip">
<label>Quick Tip!</label>
<insertAtIndex>9</insertAtIndex>
<scriptCode>
<![CDATA[
import quicktip
from imp import reload
reload(quicktip)
quicktip.ShowQuickTip()]]>
</scriptCode>
</scriptItem>
</subMenu>
</menuBar>
</mainMenu>