MAXScript Reference - PathConfig Struct
以下從中節錄出較常用的項目
pathConfig.appendPath
- 將路徑片段合併
pathConfig.appendPath "c:\\temp" "test.txt"
"c:\temp\test.txt"
pathConfig.convertPathToLowerCase
- 將路徑轉為小寫並將反斜槓統一
pathConfig.convertPathToLowerCase "C:\\Temp\Test/pATH"
"c:\temp\test\path"
pathConfig.pathsResolveEquivalent
- 比對兩個路徑是否相同
pathConfig.pathsResolveEquivalent "scenes\\test.txt" "./scenes/test.txt"
true
pathConfig.removePathLeaf
- 取得上一層的目錄路徑
pathConfig.removePathLeaf "c:\\temp\\test"
"c:\temp"
pathConfig.stripPathToTopParent
- 取得最上層的路徑
pathConfig.stripPathToTopParent "C:\\temp\\test\\test.tga"
"C:\"
pathConfig.stripPathToTopParent "\\\\SomeServer\\Projects\\Test"
"\\SomeServer"
pathConfig.removePathTopParent
- 去除最上層的路徑
pathConfig.removePathLeaf "c:\\temp\\test"
"temp\test"
pathConfig.stripPathToLeaf
- 取得最深一層的路徑,與filenameFromPath作用相同
pathConfig.stripPathToLeaf "C:\\temp\\test"
"test"
pathConfig.stripPathToLeaf "C:\\temp\\test\\"
""
pathConfig.stripPathToLeaf "C:\\temp\\test\\somefile.tga"
"somefile.tga"
pathConfig.isAbsolutePath
- 檢驗是否是絕對路徑(但不檢驗該路徑是否存在)
pathConfig.isLegalPath
- 檢驗是否是合法的路徑(但不檢驗該路徑是否存在)
pathConfig.GetDir <#directory_type>
- 傳回系統預設目錄路徑
#font | #Scene | #export | #import | #help | #expression | #preview |
#image | #Sound | #plugcfg | #maxstart | #vpost | #drivers | #autoback | #matlib
| #scripts | #startupScripts | #defaults | #renderPresets | #ui | #maxroot |
#renderoutput | #animations | #archives | #Photometric | #renderassets |
#userScripts | #userMacros | #userStartupScripts | #temp | #userIcons | #maxData
| #downloads | #proxies
pathConfig.isPathRootedAtBackslash
- 檢驗路徑是否是以斜槓為開頭
要取得Max的一些預設路徑則從此查找
MAXScript Reference - 3ds Max System Directories
沒有留言:
張貼留言