In PDG network, how can I access Outputs (see image) of a preview node withing Python Processor context?
In other words how can I access @pdg_output or workItem.output from Python Processor node?
Update Feb 23, 2:13 pm
I tried the following but it prints an empty array.
for upstream_item in upstream_items:
new_item = item_holder.addWorkItem(parent=upstream_item)
print(new_item.inputResultData)
Update Feb 23, 2:24 pm (Solved)
After struggling with this for 4 hours I finally was able to figure it out by reading HDAProcessor code located at C:\Program Files\Side Effects Software\Houdini 18.5.408\houdini\pdg\types\houdini\hda.py
It seams like most of default nodes store outputs with item.addExpectedResultData(...) call.
So to get output values of a previous PDG node
for upstream_item in upstream_items:
new_item = item_holder.addWorkItem(parent=upstream_item)
parent_outputs = new_item.expectedInputResultData
I hope it helps someone.