papsphilip
2024年3月21日 07:41:55
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
2024年3月21日 09:34:22
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
2024年3月23日 09:46:49
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
2024年3月23日 11:48:12
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
2024年3月23日 12:15:14
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
2024年3月23日 12:25:52
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
2024年3月23日 12:40:48
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
2024年3月24日 01:20:51
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
2024年3月24日 13:47:38
thanks @alexwheezy! Here is the asset for anyone interested.