Share
 
 

Obtain the transform, shape, and history nodes

When you create an object, a transform node, a shape node, and a history node are created, among others. Select the object, and you will see that the tabs across the top of the Attribute Editor display these nodes.

  • The transform node has attributes that allow you to transform an object, for example, move, scale or rotate.

  • The history node has attributes used to create an object, for example, subdivisions, radius and so forth.

  • The shape node has attributes used to control the tessellation attributes of the mesh, the visibility of the object and so forth.

If you create an object using MEL; for example:

string $plane[] = `polyPlane`;

The Script Editor top tab displays the results:

// Result: pPlane1 polyPlane1 // 

In other words, $plane[0] points to pPlane1 (transform node), and $plane[1] points to polyPlane1 (history node).

Shape nodes are child nodes of transform nodes. In this case, the shape node would be pPlaneShape1.

To obtain a shape node from its transform node, use the listRelatives command:

{
//Lists the transform nodes of all selected objects in the scene
string $nodes[] = `ls -selection`;

for ($node in $nodes)
{
//From each transform node, obtain its shape node and print its name
string $shapes[] = `listRelatives -shapes $node`;
print $shapes;
}
}

Was this information helpful?