Go to: Synopsis. Return value. MEL examples.

Synopsis

string firstParentOf(string $dagObject)

This procedure returns the name of the first DAG parent of the specified object, if any. If the specified object has no parents, the return value is "".

Return value

None

Arguments

Variable Name Variable Type Description
$dagObjectstringThe object whose first DAG parent should be returned.

MEL examples

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

		// Use firstParentOf() to get the parent of the sphere. This should be
		// the name of the group.
		//
		string $firstParentOfSphere = firstParentOf($sphere);

		if (isSameObject($group, $firstParentOfSphere)) print("// Success!\n");
		// Success!