-
Notifications
You must be signed in to change notification settings - Fork 2
/
PARMmenu.xml
61 lines (55 loc) · 1.48 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
<?xml version="1.0" encoding="UTF-8"?>
<menuDocument>
<menu>
<subMenu id="Ying">
<label>Ying</label>
<insertBefore/>
<scriptItem id="CopyParmName">
<label>Copy Parm Name</label>
<scriptCode><![CDATA[
parms = kwargs["parms"]
if len(parms) == 0:
raise ValueError('invalid input', parms)
parm0 = parms[0]
import ying_Utils
ying_Utils.setClipboardText(parm0.name())
]]></scriptCode>
</scriptItem>
<scriptItem id="reveal_in_file_browser">
<label>Open in File browser</label>
<scriptCode>
<![CDATA[
import os
import sys
import subprocess
path = kwargs["parms"][0].eval()
old_path = path
if path != "":
path = hou.expandString(path)
path = os.path.normpath(path)
path = os.path.dirname(path)
if os.path.exists(path) and sys.platform == "win32" :
subprocess.Popen(["explorer", path])
else:
print('Folder "{}" does not exist or you do not have permission to access it'.format(old_path))
]]>
</scriptCode>
</scriptItem>
<scriptItem id="reveal_in_photoshop">
<label>Open in Photoshop</label>
<scriptCode>
<![CDATA[
import os
import sys
import subprocess
path = kwargs["parms"][0].eval()
if path != "":
path = hou.expandString(path)
path = os.path.normpath(path)
subprocess.Popen(["C:\Program Files\Adobe\Adobe Photoshop 2022\Photoshop.exe", path])
]]>
</scriptCode>
</scriptItem>
</subMenu>
</menu>
</menuDocument>