Skip to main content

Formatted String Generator

Intro

Build a custom string by combining an array of input strings.

UI

Formatted String - Enter a string. Use {<indexNumber>} to reference an index.

Button iconAdd
- Use this button to add more rows (indices) to the array.

0:String - The first index in the array.

Formatting Strings

Each string within the array can be referenced within the Formatted String by wrapping its index in curly brackets. The output string generated will replace {0} with the contents entered into 0:String.

Example
  1. Create a String Generator.
  2. Set the Generator to Formatted String.
  3. Enter Here's to the {0} ones. into the Formatted String.
  4. Enter crazy into 0:String.
  5. Create a Text Shape.
  6. Connect stringGenerator.idtextShape.string.

{0} from the Formatted String has been replaced with crazy so the Text Shape outputs "Here's to the crazy ones.".

Values

The Formatted String Generator only accepts strings as inputs but a Value String Generator can be used to convert values into a string. For example, the Width of a Rectangle can be added to a Formatted String Generator by first connecting it to a Value String Generator and then connecting the Value String Generator to an index of the Formatted String Generator.

Dynamic File Names

The Formatted String Generator is also a good way to generate dynamic file names. This can be useful in combination with Dynamic Rendering. Simply connect the Formatted String Generator to the File Name of a Render Queue Item in the Render Manager – each time the Dynamic Index increments, a new file name is generated.

The Formatted String Generator can be used to combine various inputs including data from a Spreadsheet Utility, Render Tokens and values from the Composition to create bespoke, unique file names.

If external data via a Spreadsheet Utility or the Index of an Array is already connected to the Render Manager's Dynamic Index, each render will be given a unique file name generated by the Formatted String Generator.

Example
  1. Import a .csv or Google Sheet Asset containing the following data to the Assets Window:
ColourHex
Red#ff0000
Green#00ff00
Blue#0000ff
  1. Drag the Asset into the Viewport to create a Spreadsheet Utility.
  2. Set the Spreadsheet's Column Title to Colour.
  3. Check Fixed Row.
  4. Connect the Render Manager's Dynamic Index to the Spreadsheet's Row Index.
  5. Create a String Generator.
  6. Set the Generator to Formatted String.
  7. Enter Colour-{0} into the Formatted String.
  8. Connect spreadsheet.idstringGenerator.array.0 (the 0:String attribute).
  9. Connect the String Generator to the Render Queue Item's File Name.

When Dynamic Rendering, each file will be named Colour-Red, Colour-Green, Colour-Blue.

Render Tokens

Note that Render Tokens do not inherit the styling that confirms they are valid within a Formatted String Generator so ensure they are spelt and formatted correctly. The styling will appear when connected to a Render Queue Item's File Name so this can be used to ensure they have been correctly entered.

info

Non indexed entries (empty curly brackets) are enumerated on based on their position in the string. For example, a string containing {} {} {} is the equivalent of {0} {1} {2}. This is also true where indexed and non indexed entries exist in the same string. For example, {2} {} {1} {} would be interpreted as {2} {0} {1} {1}