Python deselectWorkItem() equivalent for selecting

   327   1   0
User Avatar
Member
2135 posts
Joined: Sept. 2015
Offline
Is there a python function equivalent to the deselectWorkItem()method?

I can't seem to find anything in the docs that might indicate how to get a work item selected without having to manually select it.


I have a top network that outputs a single work item from a Filter by Range node run through an external parm reference.

I can also with python get that Top Nework to output the single work item with pythons cookWorkItems() method.

But can't seem to automate the last step of selecting that work item.

I was thinking of submitting an RFE...but thought I would ask here in case there might already be a python method/function for this that I am unaware of.
User Avatar
Staff
601 posts
Joined: May 2014
Offline
You can select a work item using hou.TopNode.setSelectedWorkItem(), as described bere: https://www.sidefx.com/docs/houdini/hom/hou/TopNode.html#setSelectedWorkItem [www.sidefx.com]

You'll need to pass in the unique ID of the work item -- not the index of the work item in the node. A work item's ID can be retrieved using it's ID property, e.g. pdg.WorkItem.id.
  • Quick Links