def loadValues(*args):
"""loads the saved path file, if there is one"""
#check if file exists
try:
userDir = cmds.internalVar(upd=True) + "zbw_appendPathSave.txt"
file = open(userDir, "r")
paths = []
#read values from file to list
for line in file:
paths.append(line.rstrip("\n"))
file.close()
#replace tfbg's with those values
cmds.textFieldButtonGrp(widgets["path1"], e=True, tx=paths[0])
cmds.textFieldButtonGrp(widgets["path2"], e=True, tx=paths[1])
cmds.textFieldButtonGrp(widgets["path3"], e=True, tx=paths[2])
except IOError:
cmds.warning("You don't seem to have a 'zbw_appendPathSave.txt' file saved in your user prefs dir")
评论列表
文章目录