Search - User list
Full Version: PDG Services: Writing to work item attributes?
Root » PDG/TOPs » PDG Services: Writing to work item attributes?
AslakKS
Hi,
I was wondering if there was any way to send work item attributes back when cooking with a service.
What I'm trying to do is cache some geometry + store some stats about that cache as PDG attributes.

When using out of process cooking there is this (from docs):
from pdgjson import WorkItem
# create WorkItem object from the data serialized to `$PDG_TEMP/data/workitem.json`
work_item = WorkItem.fromJobEnvironment()
# read attrib values from the running work item
val = work_item.attribValue('myintattrib')
# Send data back to PDG work item via network calls
work_item.setStringAttrib('runtime_attrib', 'test value', 0)
work_item.addOutputFile('/tmp/myoutput.txt')

Is there a equivalent to this using services?
AdamChabane
Bump, any update or solution to this?

I'm trying to find a way to pass attributes between TOPs/Scripts running on a Houdini Service Block.
AslakKS
I did not find anything for my needs, but took a look at the new service blocks - and those can easily write to attributes.

Attaching an hello world example here



What I wanted to achieve was writing to pdg attributes from e.g. Python Sop nodes inside my hython services
AdamChabane
Cheers AslakKS, I wasn't quite understanding the difference between a pdgjson.WorkItem and pdg.WorkItem until having a play with your example scene but now it makes sense they're quite different depending on whether or not you're using services. My initial problem is solved now, thanks,

Adam
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