以下是这部分代码中出现的错误。尽管路径是有效的,但出现了 RuntimeError — 奇怪。发生了什么,我怎样才能让它发挥作用?
for root,dirs,files in os.walk(self.path):
for f in files :
if (f.split('.')[1] == "mb"):
z = utils.executeInMainThreadWithResult(self.contains,(f.split('.')[0]))
if not (isinstance(z,NoneType)):
cmds.symbolButton(self.arSubCategory + f.split('.')[0], image=(z[1].replace("\\","/")), width = 35,height = 70, c = "h.imp_file(" + "\"" + root.replace("\\","/") + "/" + f + "\"" + ")")
def contains(self,imageName):
print 'imageName : ',imageName,'\n'
for root, dirs, files in os.walk(self.path+"images"):
for g in files:
x = re.search(imageName,g)
if not (isinstance(x, NoneType)):
print 'g ',root+"/"+g.replace("\\","/"),'\n'
return (1,(root+"/"+g))
错误:
# z is (1, 'T:/Reference_Library/Reference_work/Char_models/Workfiles/images\\rboxdisk1\\female\\highpoly/granny01_highpoly.jpg')
Error: File not found: T:/Reference_Library/Reference_work/Char_models/Workfiles/images/rboxdisk1/female/highpoly/granny01_highpoly.jpg
Traceback (most recent call last):
File "<maya console>", line 115, in <module>
File "<maya console>", line 65, in showWindowanimLibrary
RuntimeError: File not found: T:/Reference_Library/Reference_work/Char_models/Workfiles/images/rboxdisk1/female/highpoly/granny01_highpoly.jpg