Starting with the latest build of Houdini 18.5, there are new changes in PDG that allow it to do a better job of tracking attributes that are produced and consumed by nodes/work items. This means that it can, for example, determine if a node needs to be dynamic based on the attributes that are referenced in expressions on that node.

For example, if a node uses @pdg_input in an expression and the input files are produced when upstream work items are cooking, then PDG will make that node dynamic. The same also applies to other attribute references, or for attributes accessed internally by the node itself. PDG will only do this if the Generate When parameter is set to Automatic, which is the default value for that parm. It's always possible to override the behavior and use a specific setting by explicitly setting the Generate When parameter to a different menu entry. I've attached a short video demonstrating the changes with a Python Script and XML Input node:

The changes are currently guarded with the HOUDINI_PDG_EXPERIMENTAL variable, but if there are no strong objections to the new behavior we're aiming to remove that guard in the next few weeks. To try them out now you'll need to set HOUDINI_PDG_EXPERIMENTAL=1 in your environment.


Input/Output Attribute Tracking Details

PDG nodes definitions and node instances can now explicitly define the attributes that they consume from input work items, and the attributes they intend to add to new work items. This includes detecting attribute usage in any HScript expressions in parameters, such as @pdg_input, @attrib, and pdgattrib(“attr”, 2).

Using that information, the node can determine if it needs to be dynamic or static based on the attributes it intends to use, and the set of upstream attributes available from connected input nodes.

In some cases PDG may not always be able to determine exactly which attributes are needed or produced until the graph has actually cooked. For example, a Python Script can run code that adds an arbitrary number of attributes onto work items while it is evaluating. To handle those cases, nodes like the Python Script will indicate to PDG that they may produce an unknown set of attribs. If a downstream node references an attribute that PDG cannot identify, and a node like a Python Script is found in the input chain, then PDG will assume that attribute comes from that Python Script.