workitem by index in sops

   1169   1   0
User Avatar
Member
35 posts
Joined: 12月 2012
Offline
Is there a way to access a particular pdg node and workitem by its index in a python sop?
User Avatar
Member
35 posts
Joined: 12月 2012
Offline
I found the answer to my own question for anyone else interested
node = hou.node(path to pdg node)
pdg_node = node.getPDGNode()

#Get work item by index make sure it's unique per work item
work_item = pdg_node.workItems[index]

#Access attributes using python workItem methods ex.
name = work_item.stringAttribute("name")
  • Quick Links