移動先: 概要 戻り値 MEL 例.

概要

string rootOf(string $dagObject)

このプロシージャは、指定したオブジェクトにルートレベル DAG の親があれば、その名前を返します。指定したオブジェクトに親がなければ、戻り値は "" となります。 firstParentOf() も参照してください。

戻り値

なし

引数

変数名 変数型 説明
$dagObjectstringルート レベルの DAG ペアレントを返すオブジェクトです。

MEL 例

		// Create a NURBS sphere.
		//
		string $createdNodes[] = `sphere -constructionHistory false`;
		string $sphere = $createdNodes[0];
		
		// Create a group containing a group containing the sphere.
		//
		string $group1 = `group`;
		string $group2 = `group`;

		// Use rootOf() to get the root of the sphere. This should be
		// the name of the second group.
		//
		string $rootOfSphere = rootOf($sphere);

		if (isSameObject($group2, $rootOfSphere)) print("// Success!\n");
		// Success!