記号パス名

MAXScript に指定するファイル名の任意の場所に、$<name> という形式で記号パス名を使用することができます。

この機能は 3ds Max 4 で追加され、3ds Max 9 で大幅に拡張されました。

以下の例で MAXScript に指定するファイル名は、'$' で始まり、下記の記号ディレクトリ名のいずれかが続きます。

次の記号名が認識されます。

インデックス 記号名 ディレクトリ
1 $max メインの MAX 実行可能ディレクトリ
2 $maps マップ ディレクトリ構成内の最初のディレクトリ*
3 $scenes 3ds Max のシーンディレクトリ
4 $fonts フォント ディレクトリ
5 $imports ファイルの読み込み元ディレクトリ
6 $exports ファイルの書き出し先ディレクトリ
7 $sounds サウンド ディレクトリ
8 $matlibs マテリアル ライブラリ ディレクトリ
9 $scripts スクリプト ディレクトリ
10 $startupScripts 自動ロードのスタートアップ スクリプト ディレクトリ
11 $plugins プラグイン ディレクトリ構成内の最初のディレクトリ*
12 $plugcfg プラグイン構成ディレクトリ
13 $images イメージ ディレクトリ
14 $ui ユーザ インタフェース ファイル ディレクトリ
15 $macroScripts UI ディレクトリ内の macroScripts
16 $web Web ダウンロード用ディレクトリ
17 $temp システムの一時ディレクトリ
18 $renderPresets レンダリング プリセット ディレクトリ
19 $help ヘルプ ファイル ディレクトリ
20 $expressions 関数 ディレクトリ
21 $previews プレビュー ディレクトリ
22 $maxstart MAXSTART.MAX のディレクトリ
23 $vpost ビデオ ポスト ディレクトリ
24 $drivers ドライバ ディレクトリ
25 $autoback 自動バックアップ ディレクトリ
26 $marketDefaults 各市場の既定値のディレクトリ
27 $icons アイコン ディレクトリ
28 $maxSysIcons システム アイコン ディレクトリ
29 $renderOutput レンダリング出力ディレクトリ
30 $animation アニメーション ディレクトリ
31 $archives アーカイブ ディレクトリ
32 $photometrics フォトメトリック ファイル ディレクトリ
33 $renderAssets レンダリング アセット ディレクトリ
34 $userScripts ユーザ スクリプト ディレクトリ
35 $userMacros ユーザ マクロスクリプト ディレクトリ
36 $userStartupScripts ユーザ スタートアップ ディレクトリ
37 $userIcons ユーザ アイコン ディレクトリ
38 $maxData Max データ(ルート)ディレクトリ
39 $downloads ダウンロード ディレクトリ
40 $proxies ビットマップ プロキシ ディレクトリ
41 $assemblies アセンブリ ディレクトリ
42 $hardwareShadersCache ハードウェア シェーダ ディレクトリ
43 $plugcfg_ln Plugcfg_ln ディレクトリ
44 $ui_ln UI_LN ディレクトリ
45 $autodeskcloud オートデスク クラウド ディレクトリ
46 $userStartupTemplates スタートアップ テンプレート ディレクトリ
47 $privateExchangeStoreInstallPath プライベート Exchange Store インストール ディレクトリ。注: これは現在 $privatePluginPackageInstallPath のエイリアスですが、後方互換性のために残されています。
48 $publicExchangeStoreInstallPath パブリック Exchange Store インストール ディレクトリ。注: これは現在 $publicPluginPackageInstallPath のエイリアスですが、後方互換性のために残されています。
49 $systemImage システム シーン イメージ ディレクトリ
50 $systemPhotometric フォトメトリック ライト定義(.ies)ファイル ディレクトリ
51 $systemSound システム シーン サウンド アセット ディレクトリ
52 $pageFile 一時ページ ファイル ディレクトリ(3ds Max 2018.4 Update 以降)。
53 $fluidSimulations 流体シミュレーション ファイルのキャッシュの場所(3ds Max 2020 Update 以降)。
54 $userSettings ユーザ設定の場所(3ds Max 2020 Update 以降)。
55 $userTools サード パーティ ツールのユーザ設定(3ds Max 2020 Update 以降)。
56 $privatePluginPackageInstallPath プライベートのプラグイン バンドル パッケージのインストール場所(3ds Max 2020 Update 以降)。
57 $publicPluginPackageInstallPath パブリックのプラグイン バンドル パッケージのインストール場所(3ds Max 2020 Update 以降)。
58 $plugindata プラグイン データの場所
59 $presets パーティクル フロー プリセットの場所(3ds Max 2022 以降)。

これらは GetDir() および SetDir() メソッドの引数である 3ds MAX システム ディレクトリの filetype_names(「#」で始まる)とよく似ていることに注意してください。

以下の例では、現在の 3ds Max スクリプト ディレクトリにある「foo.ms」というファイルを開きます。

fileIn "$scripts\foo.ms"

3ds Max 9 以降では、$maps および $plugins 記号パス名は、インデックスも指定できます。以下の例では、インデックス付きのディレクトリを使用しています。

"$maps[2]\\mybitmap.tga"

インデックスを指定しないと、マップに対応する最初のプラグイン パスが使用されます。

SymbolicPaths 構造体

3ds Max 9 以降では、SymbolicPaths 構造体には、既存の記号パスにアクセスするメソッドと、新しい記号パスを定義するメソッドがあります。

symbolicPaths.numPaths()

記号パス名の数を返します。これには、システム パスとユーザ定義のパス名の両方が含まれます。

symbolicPaths.getPathName<index>

インデックス付きの記号パス名を返します。

for i =1 to symbolicPaths.numPaths() do
format "% : %\n" i (symbolicPaths.getPathName i)
symbolicPaths.isPathName <string>

文字列が記号パス名に対応する場合には true、対応しない場合には false を返します。

symbolicPaths.isPathName "$maps"
true
symbolicPaths.isPathName "$map"
false
symbolicPaths.getPathValue {<index> | <string>}

指定の記号パス名に関連するパスを返します(インデックスまたは名前文字列で指定)。

symbolicPaths.getPathValue 2
"C:\Program Files\Autodesk\3ds Max 2012\maps"
symbolicPaths.getPathValue"$maps"
"C:\Program Files\Autodesk\3ds Max 2012\maps"
symbolicPaths.numUserPaths()

ユーザ定義の記号パス名の数を返します。

symbolicPaths.getUserPathName <index>

インデックス付きのユーザ定義の記号パス名を返します。

symbolicPaths.isUserPathName <string>

文字列がユーザ定義の記号パス名に対応する場合には true、対応しない場合には false を返します。

symbolicPaths.getUserPathValue {<index> | <string>}

指定のユーザ定義の記号パス名に関連付けられたパスを返します。

symbolicPaths.setUserPathValue {<index> | <string>} <filepath>

指定のユーザ定義の記号パス名に関連付けられたパスを設定します。

symbolicPaths.addUserPath <string> <filepath>

ユーザ定義の記号パス名とパスを追加します。

symbolicPaths.removeUserPath {<index> | <string>}

ユーザ定義の記号パス名を削除します。

symbolicPaths.expandFileName <filename>

拡張ファイル名を返します。

symbolicPaths.numUserPaths() --check foruser path- none by default
0
symbolicPaths.addUserPath "$test" "c:\\test" --define new user path
OK
symbolicPaths.numUserPaths() --check foruser path- there is one!
1
symbolicPaths.isUserPathName "$test" --is a user symbolic path?
true
--See if $temp is a user symbolic path.
--NOTE that $temp is aSYSTEMsymbolic path,
--but not aUSERsymbolic path:
symbolicPaths.isUserPathName "$temp"
false
symbolicPaths.getUserPathName 1 --get the name of the first path
"$test"
symbolicPaths.getUserPathValue 1 --get the first path
"c:\test"
symbolicPaths.getUserPathValue "$test" --get the path by name
"c:\test"
symbolicPaths.setUserPathValue "$test" "c:\\another\\path" --change
OK
symbolicPaths.getUserPathValue "$test" --see if itchangeg?
"c:\another\path"
symbolicPaths.expandFileName "$test\\somefile.txt" --expand a path
"c:\another\path\somefile.txt"
symbolicPaths.removeUserPath "$test" --remove the user path
OK
symbolicPaths.numUserPaths() --there are no user paths left
0