Go to: Synopsis. Return value. MEL examples.

Synopsis

string rootOf(string $dagObject)

This procedure returns the name of the root-level DAG parent of the specified object, if any. If the specified object has no parents, the return value is "". See also firstParentOf().

Return value

None

Arguments

Variable Name Variable Type Description
$dagObjectstringThe object whose root-level DAG parent should be returned.

MEL examples

		// 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!