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.
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.
A batch: one file per frame
Section titled “A batch: one file per frame”Export Batch writes one file per frame, so its Filename Template is filled in once for each. Here a Palette Remap makes three color variants, named after the palette’s slots: red, teal, and gold. The Format adds the extension, so the template has none.
export {source}_{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, and {name} is the slot’s name, 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 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.