kiko Posted February 23, 2021 Share Posted February 23, 2021 (edited) 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. Edited February 23, 2021 by kiko 1 Quote Link to comment Share on other sites More sharing options...
papsphilip Posted June 30, 2021 Share Posted June 30, 2021 (edited) i am struggling with the same problem. i want to get the output of the current work item but this is not working. Can you share a hip file? Edited June 30, 2021 by papsphilip Quote Link to comment Share on other sites More sharing options...
papsphilip Posted June 30, 2021 Share Posted June 30, 2021 (edited) no its not working. i am trying to write a python expression in the file rename to get the output file path and do some string operations later, but its like impossible to get it. this.index is working but i still haven't figured out how to get the output Edited June 30, 2021 by papsphilip Quote Link to comment Share on other sites More sharing options...
papsphilip Posted July 6, 2021 Share Posted July 6, 2021 after a few days of vacation i used the python processor node and the code the author of the topic posted and everything works. I was trying to use this code inside a python expression in order to set the filerename "newfilepath" but i don't know what went wrong. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.