Search - User list
Full Version: File pattern - Specific files selection
Root » PDG/TOPs » File pattern - Specific files selection
papsphilip
i'd like to use File Pattern TOP to select specific files from a folder, there is no pattern though, no similarities in naming.
Something like a multi parm menu would be super useful. Is there a way to do this with another node or do i have to built it myself?
Maybe File pattern is not the only node that reads files from disk?
alexwheezy
Pattern allows wild cards such as ? (match any character), * (match any string of characters), and (match any one of the characters inside the square brackets). For example, *.png matches any file that ends with .png. But I don't think it's going to be flexible.
You can first read all the files from the disc using the *.extension template, and then filter the desired files using Filter by Expression.
papsphilip
alexwheezy
You can first read all the files from the disc using the *.extension template, and then filter the desired files using Filter by Expression.
how can i filter based on specific files? i'd like to have a controller where i select the specific files so filter would have to read the filepaths from the controller and keep only those, discard the rest workitems

i have made an attempt here but this has to be automated somehow. maybe python?
alexwheezy
Then we can consider 2 more options to solve this problem.
Use Filter by Attribute or Labs Filter by Value, which is actually written in Python Script.

https://www.sidefx.com/docs/houdini/nodes/top/labs--filter_by_value-1.1.html [www.sidefx.com]
papsphilip
alexwheezy
Use Filter by Attribute or Labs Filter by Value, which is actually written in Python Script.
where are you creating the attribute though? can you share a file please?
alexwheezy
The File Pattern node knows how to create attributes from a path such as directory, filename, extension.

https://www.sidefx.com/docs/houdini/nodes/top/filepattern.html [www.sidefx.com]
papsphilip
Problem with this method is that for the labs tool you have to use python to add values automatically to the filter as you are adding more files in the controller null.
alexwheezy
Why not use the Labs Filter by Value node itself as a control node? It seems that so far there is no problem to replace it.

All I've changed here is a setting in the asset that allows you to select files on disk rather than populate a line, then you don't have to create a new layer of data indirection and avoid the hassle of writing code.
papsphilip
thanks @alexwheezy! Here is the asset for anyone interested.
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