This is most common used python operation I used so far when using Houdini TOP. With this you will have more control what kind of task you wanted to be.
Built in Attribute, most of the nodes are made with quotes, referring as string
- `@wedgeindex` : Simpy read current task index.
- `pdg_attrib()` : Read Attribute float from TOP
Python Attributes
FileTag
outputTag = parent_item.outputFilesForTag("file/geo/usd")
usdPath = str(outputTag[0])
Read Attributes
blendPath= parent_item.attribValue("blendPath")
blendBasename = os.path.basename(blendPath)
Set Attributes
work_item.setStringAttrib("houdini_temp",houdiniTemp)
Out of Process Tasks
import sys
#Iniate environemnt variables
sys.path.insert(1, '$HFS/houdini/python3.9libs/pdgjob')
from pdgjson import WorkItem
# setup work item
work_item = WorkItem.fromJobEnvironment()
# check work item
filename = work_item.attribValue("filename")
print(filename)
PDG is one of the most powerful tools I have known so far, It simplifies large tasks by small groups of teams.