移動先: 概要 戻り値 キーワード. 関連項目. フラグ. MEL 例.
nodeCast [-copyDynamicAttrs boolean] [-disableAPICallbacks boolean] [-disableScriptJobCallbacks boolean] [-disconnectUnmatchedAttrs boolean] [-force boolean] [-swapNames boolean] [-swapValues boolean]
nodeCast は 「元に戻す」が可能、「照会」が不可能、「編集」が不可能 です。
タイプ A のソース ノードと、タイプ B のターゲット ノードの 2 つのノードを指定し、タイプ A がタイプ B かそのサブタイプである場合、このコマンドはターゲット ノードをソース ノードに置換します。つまりターゲット ノードのすべてのノード コネクション、DAG 階層、アトリビュート値はターゲット ノードから削除され、ソース ノードに配置されます。どちらかのオブジェクトが参照されている、ロックされている、またはサブタイプを共有していない場合、この操作は失敗します。この操作はアトミックです。指定したパラメータが失敗すると、ソース ノードとターゲット ノードはコマンド実行前の初期状態に戻ります。
重要: このコマンドは現在、インスタンス コネクション、インスタンス オブジェクト、そしてリファレンス ノードを無視します。
node, swap, cast
createNode, nodeType
copyDynamicAttrs, disableAPICallbacks, disableScriptJobCallbacks, disconnectUnmatchedAttrs, force, swapNames, swapValues
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: 1 つのコマンドで複数回使用可能なフラグ
|
// Create two transform nodes and make a connection between them.
//
string $tr1 = `createNode transform`;
string $tr2 = `createNode transform`;
connectAttr -f ($tr1 + ".t") ($tr2 + ".t");
connectAttr -f ($tr2 + ".r") ($tr1 + ".r");
// We want to swap $tr1 out. Create a new node $swapNode that will
// replace $tr1. To prove that this is working, we will add a new
// dynamic attribute to $tr1 and connect it to the middle man.
// If nodeCast cannot find the corresponding attribute on the
// node to be swaped, it will either ignore the connection or
// disconnect the connection based on user input.
//
string $theT = $tr1;
select -r $theT;
addAttr -ln "unmatched" -at "long";
string $middle_man = `createNode transform`;
connectAttr ($theT + ".unmatched") ($middle_man + ".tx");
$swapNode = `createNode transform`;
nodeCast -disconnectUnmatchedAttrs true $theT $swapNode;