Pipeline.toml

WIP

Pipeline toml files can be incredibly concise by using many bits of shortcut syntax. Be sure to familiarise yourself with the TOML language to get the most from this.

Pipelines have three sections, defined in up to two locations: An input, an output, and a series of actions that will be executed in order to transform one to the other.

# # #
# Create reusable sets of actions in the "refs" map that can be used for multiple assets. Pipeline actions can also 
# be defined inline, but you will typically need to use a pipeline more than once.
# # #
[[refs.flip_and_scale.actions]]
command = "Flip"
params = { direction = "horizontal" }

[[refs.flip_and_scale.actions]]
command = "Scale"
params = { factor = 2.0 }

[[refs.rotate.actions]]
command = "Rotate"
params = { amount = "one" }

# There are three ways to write the input & output section of a pipeline.

# 1) You can defined everything inline in the pipelines array
[[pipelines]]
input_path = "./some_sprites.png"
output_path = "../built/some_sprites.png"
actions = [
    { command = "Rotate", params = { amount = "one" } }
]

# 2) You can reference a preset of actions defined in the "refs" table
[[pipelines]]
input_path = "./some_sprites.png"
output_path = "../built/some_sprites.png"
reference = "flip_and_scale"

# 3) You can use a reference alongside a glob pattern to target multiple assets
[[pipelines]]
pattern = "./creatures/*.png"
output_dir = "../built/creatures"
reference = "rotate"

Another way to write the reference section of the above example would be:

[refs.flip_and_scale]
actions = [
  { command = "Flip", params = { direction = "horizontal" } },
  { command = "Scale", params = { factor = 2.0 } }
]

[refs.rotate]
actions = [
  { command = "Rotate", params = { amount = "one" } }
]

results matching ""

    No results matching ""