Houdini 17.5 Nodes TOP nodes

File Pattern TOP node

Creates work items based on files that match a certain pattern.

On this page

This node generates a work item for each file (and/or directory) name that matches a pattern in a directory (and optionally all sub-directories).

The pattern field specifies the path to start searching in as well as the pattern to match. For example, $PDG_DIR/geo/*.bgeo finds all files ending in .bgeo, looking in the geo directory inside the project working directory.

Note

The pattern is always expanded on the machine where the network cooks, not on a remote host on the render farm. The expanded file names should still be under the working directory in the shared network filesystem. The node will automatically convert local matched file paths to paths that are relative to the working directory.

See the pattern parameter for an explanation of the pattern syntax.

This node has two modes for generating work items:

Whenever this node is asked to generate items (when it cooks, or when you ask nodes to pre-generate static items), the node checks if the pattern matches different files from the last cook, and also if the modification times have changed on any files. If so, it updates and marks dirty the changed items. So if the directory contents change, normally only the changed items need to recook.

TOP Attributes

When Split Results into Separate Items is on, the node sets the following attributes on each work item.

directory

string

The directory containing the file associated with the work item, without the file name or extension.

extension

string

The extension of the file associated with the work item. Not set if File Types is set to Directories Only or when the globbed path is a directory.

filename

string

The name of file, including the extension. Not set if File Types is set to Directories Only or when the globbed path is a directory.

Parameters

Work Item Generation

Whether this node generates static or dynamic work items. You should generally leave this set to "Automatic" unless you know the node’s work items can be computed statically, or that they need to be generated dynamically.

Dynamic

This node always creates dynamic work items: it waits until the upstream work items are known, and generates new work items from the upstream work items.

Static

This node always creates static work items: it creates the number of work items it thinks it needs based on the parameters (and any upstream static items) before the network runs.

Automatic

If the input is static (a static processor, or a partitioner with only static inputs, or a mapper), this node generates static work items, otherwise it generates dynamic work items.

File Types

Whether to match Files Only, Directories Only, or All (both files and directories).

Pattern

Match file paths against this pattern. Note that the pattern specifies where to look for files, for example $PDG_DIR/geo/*.bego. The pattern allows wildcards such as ? (match any character), * (match any string of characters), and [abc] (match any one of the characters inside the square brackets). For example, *.png matches any file that ends with .png.

Recursive

Also look for matching file names in sub-directories of the path specified in the pattern parameter.

Result Data Tag

When this is on and Split Results into Separate Items is off, assign this file tag to the output file paths. If this is off, the node guesses appropriate file tags based on filename extensions.

Index From File Sequence

Looks for a final numeric sequence in the matched filenames (for example, frame001.exr) and uses that value as each work item’s index.

Split Results into Separate Items

When this is on (the default), the node creates separate work items for each matched name, with the file name data stored in attributes. When this is off, the node creates one work item, with the matching file paths set as the item’s output results. Turning this off can be useful if the node you're wiring this node into operates on results data.

Error on No Matches

Report an error on the node if the pattern doesn’t match any files. This defaults to off, but you may want to turn it on at least while you're building and debugging a network, and/or if the match should never be empty (for example, it’s gathering necessary configuration files).

Examples

example_top_filepattern Example for File Pattern TOP node

This example demonstrates how to use File Pattern to load files using a match expression.

The following examples include this node.

example_top_csvinput Example for CSV Input TOP node

This example demonstrates how to read in data from CSV files. The CSV Input node will read CSV files and create 1 workitem per row.

example_top_filecompress Example for File Compress TOP node

This example demonstrates how to compress files using TOPs / PDG.

example_top_filecopy Example for File Copy TOP node

This example demonstrates how to copy files using TOPs / PDG.

example_top_filedecompress Example for File Decompress TOP node

This example demonstrates how to decompress files using TOPs / PDG.

example_top_filepattern Example for File Pattern TOP node

This example demonstrates how to use File Pattern to load files using a match expression.

example_top_fileremove Example for File Remove TOP node

This example demonstrates how to remove a file using the Remove File node.

example_top_filerename Example for File Rename TOP node

This example demonstrates how to use the File Rename node to rename a group of files.

example_top_imagemagick Example for ImageMagick TOP node

This example demonstrates how to use Image Magick to montage and convert images.

example_top_jsoninput Example for Json Input TOP node

This example demonstrates how to use json input node to create workitems based on information contained in json files.

example_top_jsonoutput Example for Json Output TOP node

This example demonstrates how to use json output node to write workitem data to json format, or to reformat existing json files.

example_top_renderifd Example for Render IFD TOP node

This example demonstrates how to render ifd files using the renderifd node.

example_top_texttocsv Example for Text to CSV TOP node

This example demonstrates how to use the Text to CSV node in PDG/TOPs.

example_top_xmlinput Example for Xml Input TOP node

This example demonstrates how to use the xml input node in PDG/TOPs.

TOP nodes