New Expression Functions

   1425   0   0
User Avatar
Staff
585 posts
Joined: May 2014
Offline
Starting with today's daily build (Houdini 18.0.513), there are a number of additional PDG expression functions available.

To start with, pdgattribute(..) and pdgattributes(..) have been deprecated, and renamed to to pdgattrib(..) and pdgattribs(..) respectively. This is mostly for consistency with other expr functions, as well as with the new functions described below. The old function names will continue to work indefinitely.

The following new generic attribute functions have been added. They're applied to the active work item that the parm is being evaluated against:

haspdgattrib(name)
Returns 1 if the active work item has the specified attribute, otherwise returns 0.

pdgattriblist()
Returns a space-separated list of attribute names on the active work item.

pdgattribvals(name)
Returns a space-separated list of all values for the specified attribute. This function will make sure that string values are quoted if needed, e.g. if the values have spaces in them. This is so the results of the function can safely be used as part of a command line string.

pdgattribsize(name)
Returns the size of the specified attribute, or -1 if the attribute does not exist on the active work item

pdgattribtype(name)
Returns the type of the specified attribute, or -1 if the attribute does not exist. The values match the pdg.attribType enum values.


There are also specialized versions of some of the functions for work item input/output files, which take a file tag as an argument:

pdginputsize(tag)
pdgoutputsize(tag)

Returns the number of input/output files on the active work item, with the specified tag

pdginputvals(tag, localize)
pdgoutputvals(tag, localize)
Returns a space a space separate string of all input/output files with the specified tag. The localize arg indicates whether or not the file paths should have variables expanded for the local machine, or left as generic paths with PDG_DIR tokens in them.
  • Quick Links