Search - User list
Full Version: Cooking Stops at Work Item Expand Nodes
Root » PDG/TOPs » Cooking Stops at Work Item Expand Nodes
bsilvaLS
Hello! First, a disclaimer – I'm an experienced Houdini artist, but just now learning PDG/TOPs.

I have a situation where I've setup a PDG graph that builds up a PyObject attribute named “paths” from Python script nodes, which is a list. At the end of that graph I have a Work Item Expand node, set to apply expansion to “Upstream Attribute” named “paths”.

If I cook the graph from that node, or any node further down in the graph, all the nodes before the Work Item Expand node cook, but then it stops there. The Work Item Expand node remains uncooked and has no work items generated. If I then select the Expand node and “Dirty and Cook Selected node”, it generates the work items and cooks.

Originally I had several nodes upstream set to Static generation, since they were just adding attributes to a single work item (created by an Attribute Create node). But, if I set them all to Automatic I see the same behaviour.

I suspect I may have some misunderstanding of how work items are generated and cooked, but I can't see what it is based on what I've read or done so far.

Any help appreciated!
tpetrick
The PDG graph cook has two phases - generate and cook. You can see what the generated graph looks like by going to Tasks - > Generate Static Work Items. If a node is static it must be able to produce its work items during the generation phase, without any of the work items having cooked yet. Dynamic nodes, on the other hand, will not produce any work items during the generation phase. They create new items each time an upstream work item finishes cooking.

The attributes produced by the Python Script code are added when the script work item cooks, not when it's generated. That means that the attribute does not exist when the graph is generated, so if your Work Item Expand is static it won't see the attribute. In 18.0.426 we added an option to make the Python Script run its script code during the generation phase instead, so you can use it more like a programmatic attribute create starting with that build.
bsilvaLS
Ah, that's exactly it, thank you! Great to know about the Python Script behaviour.

With my current build, setting the Work Item Expand nodes explicitly to Dynamic makes everything work as expected. But having the Python Script nodes run at generation time would be even better, so I'll give that a go once we move to 18.0.426+.

Cheers!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB