Go to: Synopsis. Return value. Related. Flags. MEL examples.

Synopsis

listHistory [-allConnections] [-allFuture] [-allGraphs boolean] [-breadthFirst] [-future boolean] [-futureLocalAttr] [-futureWorldAttr] [-groupLevels boolean] [-historyAttr] [-interestLevel int] [-leaf boolean] [-levels uint] [-pruneDagObjects boolean] objects

listHistory is undoable, queryable, and NOT editable.

This command traverses backwards or forwards in the graph from the specified node and returns all of the nodes whose construction history it passes through. The construction history consists of connections to specific attributes of a node defined as the creators and results of the node's main data, eg. the curve for a Nurbs Curve node. For information on history connections through specific plugs use the "listConnections" command first to find where the history begins then use this command on the resulting node.

Return value

string[] List of history nodes

In query mode, return type is based on queried flag.

Related

listConnections, listRelatives

Flags

allConnections, allFuture, allGraphs, breadthFirst, future, futureLocalAttr, futureWorldAttr, groupLevels, historyAttr, interestLevel, leaf, levels, pruneDagObjects
Long name (short name) Argument types Properties
-future(-f) boolean create
List the future instead of the history.
-allFuture(-af) create
If listing the future, list all of it. Otherwise if a shape has an attribute that represents its output geometry data, and that plug is connected, only list the future history downstream from that connection.
-allConnections(-ac) create
If specified, the traversal that searches for the history or future will not restrict its traversal across nodes to only dependent plugs. Thus it will reach all upstream nodes (or all downstream nodes for f/future).
-levels(-lv) uint create
Levels deep to traverse. Setting the number of levels to 0 means do all levels. All levels is the default.
-leaf(-lf) boolean create
If transform is selected, show history for its leaf shape. Default is true.
-allGraphs(-ag) boolean create
By default, the traversal will remain in the current graph. If this flag is set to true, the traversal will descend into subgraphs, and ascend into parent graphs.
-breadthFirst(-bf) create
The breadth first traversal will return the closest nodes in the traversal first. The depth first traversal will follow a complete path away from the node, then return to any other paths from the node. Default is depth first.
-interestLevel(-il) int create
If this flag is set, only nodes whose historicallyInteresting attribute value is not less than the value will be listed. The historicallyInteresting attribute is 0 on nodes which are not of interest to non-programmers. 1 for the TDs, 2 for the users.
-pruneDagObjects(-pdo) boolean create
If this flag is set, prune at dag objects.
-groupLevels(-gl) boolean create
The node names are grouped depending on the level. > 1 is the lead, the rest are grouped with it.
-historyAttr(-ha) query
This flag allows querying of the attribute where history connects on shape nodes.
-futureWorldAttr(-fw) query
This flag allows querying of the world-space future-related attribute(s) on shape nodes.
-futureLocalAttr(-fl) query
This flag allows querying of the local-space future-related attribute(s) on shape nodes.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

curve -d 3 -p -3 0 0 -p -1 0 6 -p 6 0 8 -p 8 0 2
      -k 0 -k 0 -k 0 -k 1 -k 1 -k 1 -n snake;
  instance -n rattler;
  revolve -ch on -n charmer rattler;
  revolve -ch on -n medusa snake;

listHistory;
// Result: medusaShape revolve2 snake|curveShape1 //

listHistory charmer;
// Result: charmerShape revolve1 rattler|curveShape1 //

listHistory -lv 1 medusa;
// Result: medusaShape revolve2 //

listHistory -future true medusa;
// Result: medusaShape initialShadingGroup //

  // If you just list the curve's future you get both directions
  listHistory -future true curveShape1;
  // Result: snake|curveShape1 snake|curveShape1 revolve2 medusaShape
// snake|curveShape1 revolve1 charmerShape //

// To follow only one history you'll need to follow the path you
// want first, then add the node you started at if so desired since
// it will not be included (here snake|curveShape1 won't list).

// List the future of the first curve
string $hist[] = `listConnections -c 1 curveShape1.ws[0]`;
listHistory -future true $hist[1];
// Result: revolve2 medusaShape //

// List the future of the second curve
$hist = `listConnections -c 1 curveShape1.ws[1]`;
listHistory -future true $hist[1];
// Result: revolve1 charmerShape //

listHistory -leaf 0;
// Result: medusa //