Houdini 20.0 Nodes TOP nodes

Filter by Expression TOP node

Conditionally filters upstream work items.

On this page
Since 17.5

This node evaluates an expression for each upstream work item to determine if the upstream item should be filtered out. You can also invert the filter so that matched work items are retained by setting the Operation parameter to Keep Matched Items.

Filtering can either use a parameter expression (HScript or Python), or a regular expression. When using a parameter expression the expression result should be 0 to indicate that a work item failed to match against the filter, or 1 to indicate that it did match. When using regex you can choose to match the regex against the input work items' output files, an attribute value on each work item, or a custom string.

Parameters

Generate When

Determines when this node will generate work items. You should generally leave this set to “Automatic” unless you know the node requires a specific generation mode, or that the work items need to be generated dynamically.

All Upstream Items are Generated

This node will generate work items once all of the input nodes have generated their work items.

All Upstream Items are Cooked

This node will generate work items once all of the input nodes have cooked their work items.

Each Upstream Item is Cooked

This node will generate work items each time a work item in an input node is cooked.

Automatic

The generation mode is selected based on the generation mode of the input nodes. If any of the input nodes are generating work items when their inputs cook, this node will be set to Each Upstream Item is Cooked. Otherwise, it will be set to All Upstream Items are Generated.

Operation

Determines whether this node should remove any work items that match the Filter Expression or keep the work items that match the filter

Include Output Files

When on, output files from the upstream item are included on the copied work items.

Filter Type

Determines whether the filter is a parameter expression or a regex.

Filter Expression

When Filter Type is set to Parameter Expression, this parameter detrmines the expression applied to each upstream work item. When the result is 1/true, then the specified Operation is performed. By default, the upstream item is filtered out. Otherwise, the item is copied by this node.

Extra Expressions

When Filter Type is set to Parameter Expression, specifies the number of extra filter expressions in addition to Filter Expression. The expressions are evaluated from top to bottom; i.e.: (((expr AND expr1) OR expr2) AND expr3), where expr is the base Filter Expression parameter and expr# are all entries from Extra Expressions.

Expression

For each entry in the Extra Expressions multiparm, Specifies an extra filter expression as well as the boolean operation (AND, OR) to use when combining the expression result with the previous expression result(s).

Regular Expression

When Filter Type is set to Regular Expression, this parameter specifies the regex to use when filtering work items.

Match Against

When Filter Type is set to Regular Expression, this parameter determines what the Regular Expression should be match with when filtering.

Attribute Name

When Match Against is set to Attribute Value, this parameter determines the name of the work item attribute to match against the Regular Expression.

Custom String

When Match Against is set to Custom Value, this parameter can be set to a value or expression using work item attributes to compare against the Regular Expression string.

Examples

FilterStringAttrib Example for Filter by Expression TOP node

This example demonstrates how to use the strcmp HScript function along with the Filter by Expression TOP node.

FilterWorkItems Example for Filter by Expression TOP node

This example demonstrates how to filter upstream workitems so that the remaining set can be further processed or debugged.

See also

TOP nodes