Jump to content

Get output of previous node in PDG?


kiko

Recommended Posts

In PDG network, how can I access Outputs (see image) of a preview node withing Python Processor context?

houdini_foKDH71L8L.png

 

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 by kiko
  • Like 1
Link to comment
Share on other sites

  • 4 months later...

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

 

 

Capture.JPG

Edited by papsphilip
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...