移動先: 概要 戻り値 キーワード. フラグ. MEL 例.
nodePreset [-attributes string] [-custom string] [-delete name string] [-exists name string] [-isValidName string] [-list name] [-load name string] [-save name string]
nodePreset は 「元に戻す」が不可能、「照会」が不可能、「編集」が不可能 です。
ノードのプリセットの設定を保存/ロードするためのコマンドです。
このコマンドで、ノードのすべてのアトリビュート値を記録し、任意の名前を付けてディスクに保存することができます。保存したプリセットをロードし、同じタイプのノードに適用することができます。プリセットを適用したノードの値は、プリセットを生成したノードの、記録した時点での値と同じになります。
boolean | isValidName または exists が使用されているかどうか。 |
preset, render, globals
attributes, custom, delete, exists, isValidName, list, load, save
ロング ネーム(ショート ネーム) |
引数型 |
プロパティ |
-save(-sv)
|
name string
|
|
|
1 番目の引数で指定したノードのカレントの設定を、2 番目の引数で指定した名前のプリセットに保存します。指定した名前のプリセットがノードに存在する場合、警告メッセージを出すことなく上書きします。-exists フラグを使用して、該当プリセットが存在しているかどうかを確認できます。ノードのアトリビュートがコネクト先の場合は、そのアトリビュート値はプリセットとして書き込まれません。
|
|
-load(-ld)
|
name string
|
|
|
1 番目の引数で指定したノードの設定を、2 番目の引数で指定したプリセットに従って設定します。コネクト先のノード、あるいはその子(複数の子、あるいは合成された子)は、このプリセットでは変更されません。
|
|
-delete(-del)
|
name string
|
|
|
2 番目の引数で指定した名前を持つ、1 番目の引数で指定したノードのプリセットを削除します。
|
|
-list(-ls)
|
name
|
|
|
指定したノードにロードすることができるすべてのプリセット名をリスト表示します。
|
|
-exists(-ex)
|
name string
|
|
|
1 番目の引数で指定したノードに 2 番目の引数で指定した名前のプリセットが存在する場合、true を返します。このフラグを使用して、既存のプリセットが上書きされてしまうかどうかを確認でき、上書きしたくない場合は別の名前を付けることができます。
|
|
-isValidName(-ivn)
|
string
|
|
|
プリセット名を構成する文字がすべて有効であれば true を返します。それ以外の場合には false を返します。プリセット名はファイル名や MEL プロシージャ名の一部になるため、無効な文字も設定されています。プリセット名の有効文字は、英数字とアンダースコアのみです。
|
|
-custom(-ctm)
|
string
|
|
|
マルチ、ダイナミック アトリビュート、コネクションなどの一般的なプリセットの保存の仕組みによって処理されないノード アトリビュートをカスタムで処理するための MEL スクリプトを指定します。#presetName と #nodeName の識別子は、スクリプトの実行前に展開されます。このスクリプトは、プリセット ファイルに保存され、プリセットを別のノードに適用した際に、これをコマンドとして実行する文字配列を返す必要があります。
このカスタム スクリプトを使用して、プリセットへの保存内容を定義する #nodeName の照会や、プリセットの適用方法を定義するために、選択したノードを照会するコマンドの実行ができます。
|
|
-attributes(-atr)
|
string
|
|
|
プリセット ファイルに保存する指定アトリビュートの、空白で区切られた文字列です。指定していない場合、すべてのアトリビュートが格納されます。
|
|
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: 1 つのコマンドで複数回使用可能なフラグ
|
// To determine if "My Special Settings" is a valid name for a preset (it
// isn't because it contains spaces):
//
nodePreset -isValidName "My Special Settings";
// Result: 0 //
// To save the settings of nurbsSphereShape1 as a preset called "smithers":
//
nodePreset -save nurbsSphereShape1 "smithers";
// To get a list of all presets available that could be applied to
// nurbsSphereShape1:
//
nodePreset -list nurbsSphereShape1;
// Result: smithers smoothSphere roughSphere atmoSphere //
// To load the preset named "smoothSphere" onto nurbsSphereShape1:
//
nodePreset -load nurbsSphereShape1 "smoothSphere";
// To delete the preset named "smithers" which was formerly available for the
// node nurbsSphereShape1 (and other nodes of the same type):
//
nodePreset -delete nurbsSphereShape1 "smithers";
// To determine if a preset named "smithers" exists for the node
// nurbsSphereShape1 (it doesn't because it has been deleted):
//
nodePreset -exists nurbsSphereShape1 "smithers";
// Result: 0 //
// Create a preset containing only the color and diffuse attributes:
//
nodePreset -attributes "color diffuse" -save lambert1 "colorAndDiffuse";
// Create a preset to map a checker texture to the applied node:
//
global proc string[] customChecker() {
string $cmds[];
// Get the name of the node to apply the checker to.
$cmds[0] = "string $selection[] = `ls -selection`;";
$cmds[1] = "string $nodeName = $selection[0];";
// Create a checker texture.
$cmds[2] = "string $checkerName = `shadingNode -asTexture checker`;";
// Connect the checker to the node the preset is applied to.
$cmds[3] = "connectAttr ($checkerName+\".outColor\") ($nodeName+\".color\");";
return $cmds;
}
nodePreset -custom "customChecker" -save lambert1 "checkered";