创建对象时,会创建变换节点、形状节点和历史节点等。选择对象,您将看到横跨“属性编辑器”(Attribute Editor)顶部的选项卡显示这些节点。
变换节点具有可用于变换对象(例如移动、缩放或旋转)的属性。
历史节点具有用于创建对象(例如细分、半径等)的属性。
形状节点具有用于控制网格的细分属性、对象的可见性等的属性。
如果使用 MEL 创建对象;例如:
string $plane[] = `polyPlane`;
脚本编辑器的顶部选项卡将显示以下结果:
// Result: pPlane1 polyPlane1 //
换句话说,$plane[0] 指向 pPlane1(变换节点),$plane[1] 指向 polyPlane1(历史节点)。
形状节点是变换节点的子节点。在这种情况下,形状节点将是 pPlaneShape1。
若要从其变换节点获取形状节点,请使用 listRelatives 命令:
{ //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; } }