-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathadd_me_to_menu.py
38 lines (30 loc) · 1.22 KB
/
add_me_to_menu.py
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
# shared_toolsets
# Setup your SharedToolSets folder here
import sys
if nuke.GUI:
import shared_toolsets
sharedToolSetsPaths = {
"linux2" : "/mnt/some/nice/place/SharedToolSets", #LINUX
"win32" : "C:/some/nice/place/SharedToolSets", #WINDOWS
"darwin" : "/Volume/some/nice/place/SharedToolSets" #MACOS
}
def toolSetsFilenameFilter(filename):
if nuke.env['MACOS']:
# uppercase
filename = filename.replace( 'P:', '/Volumes/Project' )
# lowercase
filename = filename.replace( 'p:', '/Volumes/Project' )
elif nuke.env['WIN32']:
# lowercase
filename = filename.replace( 'D:', 'C:' )
filename = filename.replace( '/Volumes/Project', 'P:' )
elif nuke.env['LINUX']:
filename = filename.replace( 'P:', '/mnt/project' )
filename = filename.replace( '/Volumes/Project', '/mnt/project' )
return filename
platform = sys.platform
sharedToolSetsPath = sharedToolSetsPaths[platform]
shared_toolsets.setSharedToolSetsPath(sharedToolSetsPath)
shared_toolsets.addFileFilter(toolSetsFilenameFilter)
toolbar = nuke.menu("Nodes")
shared_toolsets.createToolsetsMenu(toolbar)