Naming with Tokens
Every export node writes a file whose name you type as a template. Type plain text and every export overwrites the same file; put a token in braces, such as {name}, and the name comes from the graph: the image, the node, the file the pixels came from. This page builds a template up one step at a time and shows the exact file each step writes. The full list of tokens is in the Token Reference.
You never need to remember a token. Click </> at the end of any token field, or type {, and pick from a list that shows each token’s live value. The Writes line under the fields shows the path the export will write before you export anything.
The examples use one document, dungeon.arcb, saved in D:/Projects/Dungeon. A relative path such as export/hero.png lands next to it.
From a fixed name to the image’s name
Section titled “From a fixed name to the image’s name”An Image In loads knight.png, and an Export Image writes it. With plain text in the Output Path, the file is called whatever you typed:
export/hero.png A knight saved as hero.png, over whatever was there. Replace the name with {name}, the name of the image arriving at the export:
export/{name}.png Now the file follows the picture: point Image In at hero.png and the same template writes export/hero.png. Hover the field to see where each value came from: {name}: knight, from the image.
Where an image’s name comes from
Section titled “Where an image’s name comes from”An image’s name is the last name anything gave it, and every other node passes it on:
- An Image In names its picture after its file, and a generator such as Noise after itself (
Noise1). Rename the node and the rename becomes the name. - A palette color, a trim, a frame from a folder, and a Tag each name their own image. A filter after a Tag keeps the Tag’s name.
- The pieces Separate cuts out and the colors Palette Remap splits out join their parent’s name:
tree_object_01,tree_purple. - A Merge of two pictures keeps A’s name.
- An image nothing named is
frame_1,frame_2, and so on, by its position.
Collect, Inspect, the Preview, Text, every export node, and Export Data all show and write that same name. {source} and {label} are different: they say where the pixels came from, whatever the image is called.
Name the file after the export
Section titled “Name the file after the export”Sometimes the name belongs to the export, not the picture: a full-size copy and a thumbnail of the same image, say. Give each Export Image a custom label, the name you type in the node’s title, and use {this.label}. this is the node that owns the field.
export/{this.label}.png export/{this.label}.png Both exports have the same template; only their labels differ. Copy an export node, rename it, and it writes a file of its own.
When the label is empty
Section titled “When the label is empty”A new node has no custom label, so {this.label} has nothing to write, and the field says so:
export/{this.label}.png Click Use the Node ID when empty and the token becomes {this.label|or:this.id}: the custom label, or else the node’s Node ID, its type and number without the space, which every node has and which never changes.
export/{this.label|or:this.id}.png Label the node later and the same template writes the label. The picker’s first row, Label or ID, inserts this token in one click; it is also what a new Export Data names its file with.
Name the file after the step before it
Section titled “Name the file after the step before it”Here one picture goes down two branches, a Levels labeled “Night” and a Levels labeled “Day”, each into its own Export Image. {input.label} is the custom label of the node wired into the export.
export/{source}_{input.label}.png Export Image 2 has the same template and writes export/hero_Day.png. The rings show the three places the template reads, from the point of view of Export Image 1:
- This node (
{this.label},{this.id}): the export that owns the field. - Wired in (
{input.label},{input.id}): the node plugged into its input, Levels 1.inputfollows the wire, and skips any Reroutes on it; it never looks further back. - Source (
{source},{label}): where the pixels came from,hero.pngin Image In 1.
The picker names the real node in each group’s header, such as WIRED IN · Levels 1 "Night", so you can check which node a token reads before you export.
Name the file after any node
Section titled “Name the file after any node”this and input move with the field: copy the export and they read the copy. To read one particular node wherever the field is, name it by its Node ID: {Levels2.label} is the custom label of Levels 2, and {Levels2.id} is its Node ID. Here Levels 2 is labeled “Hero” and sits two steps before the export, so neither this nor input reaches it:
export/{Levels2.label}_{this.id}.png Relabel Levels 2 “Night” and the Writes line reads Night_ExportImage1.png at once. {Levels2.label|or:Levels2.id} writes the label, else the Node ID, and a reference also works after |or: as a fallback.
Where to find a Node ID
Section titled “Where to find a Node ID”A Node ID is the node’s type and number without the space: Levels2, ExportImage1, 3dRender1. ArcBrush gives one to every node when it is created and never changes it or gives it to a second node. The Parameters header shows it in dim text after the title, Export Image 1 ExportImage1, on a node with or without a custom label. In a narrow panel it moves to its own line under the title, so it always shows whole. Hover it to read what it is for, and click it to copy it. A Node ID matches in any letter case, so {levels2.label} reads Levels 2 too.
Pick the node from the list
Section titled “Pick the node from the list”You never type a Node ID from memory. In the token picker, Another node… sits under OTHER NODES, after This node and Wired in. Click it and the list becomes every other node in the graph, in title order, with its custom label in quotes and its Node ID on the right. Type in the search field to filter by title, label or Node ID; click the crosshair at the end of a row to see that node on the canvas without closing the list.
Pick a node and the picker lists what you can read from it, each row with its value now:
| Row | Inserts | Gives |
|---|---|---|
| Label or ID | {Levels2.label|or:Levels2.id} | the custom label, else the Node ID |
| Custom label | {Levels2.label} | the custom label; empty, with a note, when there is none |
| Node ID | {Levels2.id} | the Node ID |
In an Export Data field, an export node also lists its exporter rows, such as the path it wrote. Other nodes and Back to tokens at the top step back. Typing { and the start of a Node ID or a title in the field suggests the same rows.
Hover the field afterward and it names the node each reference read, one line per token: {Levels2.label}: Hero, from Levels 2.
A caption that names the grade
Section titled “A caption that names the grade”The Text node takes references too, and redraws as soon as the node it reads is relabeled:
Grade: {Levels2.label} References work in the same fields as {this.label}: every Export Image, Export Batch and Export Texture file name and folder, Export Data’s File Name, columns and Custom Text, and the Text node. A Tag rule and an import path gray the Another node row with the reason, and a reference in a variable’s value is written as typed, with a note.
When the node is not there
Section titled “When the node is not there”A reference never guesses. Delete Levels 2 and the reference stays as typed, writes nothing, and the field shows an amber note:
export/{Levels2.label}_{this.id}.png Undo brings the node back and the note goes away. Pick again from Another node… to read a different node. If two nodes share one Node ID, which only a document edited outside ArcBrush can have (two versions of one file merged in version control, say), the reference writes nothing and the note names both: Two nodes are named Levels2: Levels 2 and Levels 2 "Hero".
Copying, appending and presets
Section titled “Copying, appending and presets”- Paste and Duplicate. Copy a node together with the node it reads and the copy reads the new copy: duplicate Levels 2 and a Text reading
{Levels2.label}, and the new Text reads the new Levels node, such as{Levels3.label}. This holds for Ctrl+D, Alt-drag and Duplicate Without Wires. - A reference left behind. A reference to a node you did not copy keeps its text. When the graph you paste into has no node with that Node ID, or a different node with it (a paste into another document, say), one message lists each such reference by node and field, and the missing ones keep their amber note.
- Append Document. A node renumbered because your document already used its Node ID takes its readers with it: an appended
{ExportImage1.id}arrives as{ExportImage3.id}when its export does. - Presets. A preset is used in other documents, where the same Node ID can be a different node, so Save as Preset refuses a node holding a reference, with the reason, such as
A preset cannot name another node: {Levels2.label} in Output Path.Export Data’s exporter name suffix, such as{data:export_path:ExportImage2}, still saves.
ArcBrush 1.7.2 opens a document that uses references, but writes each one as typed.
A batch: one file per frame
Section titled “A batch: one file per frame”Export Batch writes one file per frame, so its File Name is filled in once for each. Here a Palette Remap makes three color variants. Each is named after the picture and a palette slot: hero_red, hero_teal, and hero_gold. The Format adds the extension, so the template has none.
export {name} To number the frames instead, use {index}, each frame’s position from 1. {index:3} pads it to three digits:
{source}_{index:3} Folders
Section titled “Folders”A / in the template makes a folder. The Output Directory takes tokens too, but only ones that are the same for every file, such as {graph}, the document’s name:
export/{graph} {name}/{source} A per-frame token such as {name} is grayed in the Output Directory’s picker with “the folder is chosen before any file”.
A sprite sheet’s name
Section titled “A sprite sheet’s name”With Generate Sprite Sheet on, the frames go into one sheet, and Sheet Filename names the sheet and its JSON. A new Export Batch starts with {this.label|or:this.id}_sheet, so one labeled “hero” writes hero_sheet.png and hero_sheet.json, and an unlabeled one ExportBatch1_sheet.png.
Reshape a value: transforms
Section titled “Reshape a value: transforms”Labels are written for people: Hero full, with a space and a capital. Game engines and web servers want hero_full. Add | and a transform after the token’s name:
export/{this.label|snake}.png The same label through other transforms:
{this.label|kebab}writeshero-full, the usual web style.{this.label|pascal}writesHeroFull, the Unreal and C# style.{this.label|snake|upper}writesHERO_FULL: transforms run left to right.
In the picker, choose a transform under Insert as, then click the token. All seven are in the Token Reference.
When a value is missing: fallbacks
Section titled “When a value is missing: fallbacks”You have already used one fallback: {this.label|or:this.id} writes the label, or the Node ID when there is none. |or: works after any token, and you can chain several; the first with a value wins.
{tag:title|or:name}writes a frame’stitletag where one was set, else its name.{tag:time|or:day}: a fallback that is not a token is written as plain text, so a frame with notimetag writesday.{this.label|snake|or:this.id}: the transform belongs to the label, so this writeshero_full, orExportImage3untouched.
After |or:, typing { lists the tokens again.
Recipes
Section titled “Recipes”Sprites for a game engine
Section titled “Sprites for a game engine”A folder of characters, each in two team colors, written lowercase with no spaces and one folder per character, the way Godot and Unity projects usually keep sprites.
export/sprites {source}/{name|snake} Palette Remap pairs every character with every slot. {source} still names the character’s file after the recolor, so each character gets a folder, and {name} joins the character and the slot (knight_Red Team, written knight_red_team by |snake), so every pair gets a file of its own. Drop a third character into the folder and its files appear on the next export, with no change to the template.
A texture set for Unreal
Section titled “A texture set for Unreal”Under the Unreal destination, Export Texture names files T_{name}_{channel}: {name} is the set’s asset name and {channel} is each map’s suffix in Unreal’s spelling (BC, N, ORM, and so on). A Texture Folder with assets named oak_bark and mossy_rock would write T_oak_bark_BC.png. Unreal assets are usually named in PascalCase, so add a transform, and put {name} in the Folder to give each asset a folder of its own:
export/{name|pascal} T_{name|pascal}_{channel} The Folder is resolved once per asset, so only the set’s tokens such as {name} work there; {channel} is empty in a Folder. Under any other destination the same template works, with {channel} spelled the way that destination spells its maps.
Captions with the Text node
Section titled “Captions with the Text node”The Text node reads tokens too, and draws the value into the picture. Put a batch on its Background and every frame gets its own caption.
{name|upper} {color} draws each variant’s color as a hex code instead, and {this.label} draws the Text node’s own label, redrawn as soon as you rename the node. Tokens that only exist when a file is written, such as {index} or {date}, are drawn as typed: the Text node sees one frame at a time, not its place in the batch. Number the frames in the Export Batch file name instead.
Mark frames with a tag
Section titled “Mark frames with a tag”When frames from different branches meet in one batch, a Tag tells them apart. Here a day and a night grade of the same sprite are collected into one Export Batch. After Collect, {source} is hero for both and {input.label} reads Collect 1, so neither can tell them apart. A Tag on each branch sets a time tag, and the tag travels with the frame:
{tag:time}/{source} A Tag can also rename the frames for everything after it. In Build from Template, a rule such as {source}_{tag:time} names the frames hero_day and hero_night, and then {name} in an Export Batch, a Text caption, or an Export Data column all read that name:
{source}_{tag:time} A Tag rule cannot use {this.label} or {input.label}: a tag goes wherever the image goes, far from the node that set it, so the picker grays those groups there.
An atlas JSON with Export Data
Section titled “An atlas JSON with Export Data”A Sprite Sheet packs icons into one atlas; an Export Image writes the picture, and an Export Data writes the JSON a game engine reads. Label the Sprite Sheet “Icons Atlas” and let the Export Image name the picture after it:
export/atlas/{input.label|snake}.png export/atlas {this.label|or:this.id} Export Data’s File Name starts as {this.label|or:this.id}, so labeling the node names the file. {input.label} would not work there: Export Data can read several inputs, so its Wired in group is grayed. Export Data finds the Export Image that writes the atlas by itself, so the JSON’s "image" reads icons_atlas.png, and Export All writes the picture first and the JSON last. Every preset is in Exporting Data.
Why did I get this name?
Section titled “Why did I get this name?”The label is missing from my file name
Section titled “The label is missing from my file name”The node has no custom label, so {this.label} or {input.label} wrote nothing. The amber note under the field names the node; click Use the Node ID when empty, or give the node a label.
My file is literally named {nmae}.png
Section titled “My file is literally named {nmae}.png”A token that matches nothing (a typo, or a variable that is not defined on this computer) is written exactly as typed, with a note:
export/{nmae}.png Fix the spelling, or pick the token from the list.
{label} gave hero, not the label I typed
Section titled “{label} gave hero, not the label I typed”{label} reads the source, the node that loaded the pixels. The label you typed is on the node wired in ({input.label}) or on the export itself ({this.label}). {node}, also from older templates, is the Node ID, the same as {this.id}.
A whole group is grayed in the picker
Section titled “A whole group is grayed in the picker”Its header says why. On Export Data, Wired in reads “Export Data reads several inputs”; use {this.label}, or {data:input} to name each row’s input. With nothing plugged in, it reads “nothing is wired into this node”. You can still insert a grayed token; it behaves as the reason says.
My caption shows {date} as typed
Section titled “My caption shows {date} as typed”{date}, {time}, {index}, {count}, {channel}, and the exact source tokens such as {source_path} exist only when a file is written, so a Text node draws them as typed. Use them in an export path.
A node reference writes nothing
Section titled “A node reference writes nothing”A node reference such as {Levels2.label} read nothing. The note under the field says why: the node was deleted (There is no node Levels2 in this graph.), two nodes share the Node ID, or the node has no custom label. Pick the node again from Another node…, or use the Label or ID row so an unlabeled node writes its Node ID.
A teammate’s export wrote {this.label}.png
Section titled “A teammate’s export wrote {this.label}.png”They opened the document in ArcBrush 1.6. Node tokens and | transforms and fallbacks need ArcBrush 1.7.0 or later; older builds write them as text. Templates written in 1.6 keep writing the same names in 1.7. Details are in the Token Reference.
Related
Section titled “Related”- Token Reference: every token, where each one works, every transform, note, and grayed reason.
- Variables: your own values, such as
{CLIENT}or{TEXTURES}, used in the same fields. - Batch Processing: getting many images through one graph.
- Exporting Data: Export Data’s presets and Custom Text.