pathConfig.appendPath可以很方便的把2个路径Combine在一起
不管你后面带不带斜杠
pathConfig.appendPath @"C:\try" @"kle.jpg"
"C:\try\kle.jpg"
pathConfig.appendPath @"C:\try" @"kle.jpg"
"C:\try\kle.jpg"
很酷,然后
pathConfig.appendPath @"C:\try" @"$kle.jpg"
-- Runtime error: $directory not recognized: $kle.jpg
-- MAXScript callstack:
-- thread data: threadID:36248
-- ------------------------------------------------------
-- [stack level: 0]
-- In top-level
虽然我从未用过,指责用这个函数的老哥不太好,但还是忍不住
哪怕,自己从写一个
fn pathConfig_appendPath path1 path2 =
(
if path1[path1.count] != "\\" do path1 += "\\"
return (path1 + path2)
)
或者去.net里取取经
(dotnetClass "System.IO.Path").Combine @"C:\try" @"$kle.jpg"
"C:\try\$kle.jpg"
标签:kle,maxscript,--,pathConfig,jpg,appendPath,try,bug
From: https://www.cnblogs.com/trykle/p/17520796.html