Search - User list
Full Version: Filtering by tag
Root » PDG/TOPs » Filtering by tag
chekboom
Hi,

I have 2 work items, each with a different tag:
  • “file/geo/terrain”
  • “file/image”
I'd like to filter out the work item with the “file/geo/terrain” tag.

I've tried using the “Filter By Expression” top node with no success:
I've used the HScript expression
pdginput(1, "file/image", 0)
with various string functions, but I couldn't get what I wanted.

Does anyone would have a solution?
Thanks!

Alex
BrookeA
The pdginput function returns the input file, but the Filter Expression parameter is expecting an integer.

You will need to use the strcmp function:

strcmp(pdginput(0, "file/geo/terrain", 0), "")
chekboom
Thanks Brandon, it works!

The only thing I don't get is: My work item's index is 1, so I wrote
strcmp(pdginput(1, "file/geo/terrain", 0), "")
Why is it only working with the work item's index set to 0?
tpetrick
The index in that function is the index of the file in the list of output files, not the work item index. In this case, the 0 means the first file with that tag, while 1 would mean the second file with the tag (if it existed).

The work item index isn't needed because PDG evaluates the parameter against each work item, so all of the expression functions are computed with respect to a particular work item. If you select a work item dot in the UI, you can preview the evaluation w/ respect to that work item in the parameter interface by MMB-ing on the parm label.
chekboom
Thanks for the clarification!

I guess the documentation would need a small update then
http://www.sidefx.com/docs/houdini/expressions/pdginput.html [www.sidefx.com]
tpetrick
Yep I checked after writing my post and realized the docs are quite unclear about how the function should be used. I'm going to update it today so it does a better job describing what the function arguments are.
Dronson
I am not very familiar with PDG yet. Please tell me why I get a warning when the filter by expression node is cooking ?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB