Work item attributes are always accessed with
@attribute.index or
pdgattribute(“attribute”, index) when using HScript. For each work item, the wedge node will create:
- The wedgeattribs attribute, which is a list of the attributes created by the wedge
- For each wedged attribute, an attribute with the name specified on the wedge node and the value of the variation for that work item
- If a target parameter was specified, an attribute named <attrib>channel which contains the the target parameter.
Those are accessible on the job side as well, e.g. a ROP Geometry can cook a SOP net that contained expressions with PDG attributes in them. If you have a wedge attribute called “scale”, you could put the following in the overlay text for example:
scale = `@scale`, parameter = `@scalechannel`
Note that backticks are needed becasue the text field is a string parameter.
If you want a more automated solution that dumps out all wedge attributes, the easiest way is probably to set a Python expression on the overlay text field:
import pdg
active_item = pdg.EvaluationContext.workItemDep()
data = active_item.data
attribs = ""
for wedge_attrib in data.stringDataArray("wedgeattribs"):
val = data.stringDataArray(wedge_attrib)
if not val:
val = data.intDataArray(wedge_attrib)
if not val:
val = data.floatDataArray(wedge_attrib)
if not val:
continue
attribs += "{} = {}\n".format(wedge_attrib, str(val))
return attribs
This will query the active work item and then create a multi-line string from the wedge attribute/value pairs.