dynamically adding work items to a running PDG

   930   1   1
User Avatar
Member
6 posts
Joined: 11月 2022
Offline
Hello.
I have troubles finding a solution to dynamically add work items to my TOP network.

I am trying to build a setup where I am running Houdini’s embedded web server, which is waiting for requests, and a PDG, which is also running continuously, parallel to the web sever.
Once the webserver receives a request, I would like to create a dynamic work item and add it to the already running PDG.

With "adding it to the PDG", I mean to create the work item on the very first TOP of my PDG. The subsequent TOPs are set to: Generate when "Each Upstream item is cooked".

Any help is greatly appreciated.
User Avatar
Member
6 posts
Joined: 11月 2022
Offline
So far, I managed to select a node at the beginning of my PDG and inserting work items using pdg.Processor.injectStaticItems() [www.sidefx.com].

pdg_node = hou.node("path_to_node").getPDGNode()
inject_block = pdg_node.injectStaticItems()
with inject_block as item_holder:
    work_item = item_holder.addWorkItem(work_item_options)

I am stuck at the fact, that executing the above code does not create new work items, while the PDG is running. It only does that when the PDG is not running. The problem is, that I would like not to wait until the PDG has finished cooking, before being able to add a new work item. I would like to make use of PDGs parallelism and start new work while other work is already being executed in the PDG.
  • Quick Links