def append(*args):
paths = []
#get paths
path1 = cmds.textFieldButtonGrp(widgets["path1"], q=True, tx=True)
path2 = cmds.textFieldButtonGrp(widgets["path2"], q=True, tx=True)
path3 = cmds.textFieldButtonGrp(widgets["path3"], q=True, tx=True)
paths.append(path1)
paths.append(path2)
paths.append(path3)
#append path with text from fields
check = 0
for path in paths:
if path:
if os.path.isdir(path):
if path in sys.path:
cmds.warning("'%s' is already in sys.path. Skipping!"%path)
else:
sys.path.append(path)
check += 1
else:
cmds.warning("%s is not an existing path and wasn't added to sys.path"%path)
if check > 0:
cmds.warning("Added paths! Check the 'View Paths' tab to see them")
#delete the text
cmds.textFieldButtonGrp(widgets["path1"], e=True, tx="")
cmds.textFieldButtonGrp(widgets["path2"], e=True, tx="")
cmds.textFieldButtonGrp(widgets["path3"], e=True, tx="")
#refresh the path list on second tab
refresh()
评论列表
文章目录