Difference between revisions of "Pattern Replacement"

From TouchDesigner Documentation
Jump to: navigation, search
(Created page with "Pattern Replacement Pattern Replacement takes place in a 2nd parameter after a Pattern Matching parameter, for example in the Rename CHOP. It builds up the new names t...")
(No difference)

Revision as of 18:42, 22 March 2019

Pattern Replacement Pattern Replacement takes place in a 2nd parameter after a Pattern Matching parameter, for example in the Rename CHOP. It builds up the new names to replace the matched names using both the features of Pattern Expansion, as well as extra syntax specific to Pattern Replacement. The extra syntax allows for pulling out wildcards matched during the Pattern Matching.

The synxtax is either a * or a ?, followed by (<matchedIndex>).

For example if a CHOP has 3 channels named

 left_side_monitor
 right_side_projector
 top_side_led. 

And the Rename from has

 *_side_* 

as it's entry. You can pull out what was matched before the first _ and after the last _ using *(0) and *(1).

A pattern expansion of

 *(1)_floor_*(0)
 

Will result in the channel names

 monitor_floor_left
 projector_floor_right
 led_floor_top

Pattern Replacement occurs in:

Rename CHOP, Select CHOP, File In CHOP, Parameter CHOP

Used in conjunction with Pattern Matching to replace all or portions of matched strings with new data. Used in places such as the Rename CHOP.

Matching strings using wildcard characters and bracketing. Useful in "Select" parameters to select multiple operators, paths, etc.

Matching strings using wildcard characters and bracketing. Useful in "Select" parameters to select multiple operators, paths, etc.

An Operator Family which operate on Channels (a series of numbers) which are used for animation, audio, mathematics, simulation, logic, UI construction, and many other applications.