Go to: Synopsis. Return value. MEL examples.
 
string rootOf(string $dagObject) 
	 
None
| Variable Name | Variable Type | Description | 
|---|---|---|
| $dagObject | string | The object whose root-level DAG parent should be returned. | 
		// 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!