1
2
3 import os.path
4 import re
5 import nuke
6
7
8
9
10
11
12
13
14
15
17 """Returns file names from all Read nodes.
18
19 Options:
20 file - outputs only file names
21 dir - outputs only directory names
22 long - outputs the entire path"""
23
24
25 finalmsg = ""
26
27 allnodes = nuke.allNodes(group = nuke.root())
28 for i in allnodes:
29 _class = i.Class()
30 if _class == "Read":
31
32
33 curname = ""
34 name = nuke.filename(i)
35 if name is None:
36 continue
37 if method == "file":
38 curname = os.path.basename(name)
39
40 if method == "dir" or method == "":
41 curname = os.path.dirname(name)
42
43 if method == "long":
44 curname = name
45
46 curname = re.sub("\.%.*", "", curname)
47
48
49
50 match = re.search("slate", curname)
51 if match is None:
52 finalmsg += curname
53
54 finalmsg += "\n"
55
56 return finalmsg
57