Skip to content
Petr Vostřel edited this page Jul 16, 2012 · 5 revisions

Image Sequences

With the version 1.2 a revised technique of defining sequence of images has been put in place. Forget writing the long images array or generating it by yourself. Now you can pass a single sequence string to it.

    images: "my/folder/subfolder/pic#.png"

Syntax

Incremental Counter

What makes in a sequence string is the counter consisted of one or more hashes (#) in it. The generator will replace this placeholder with the counter and it will generate as many frame URLs needed for your sequence based on relevant options. Most of the time, specifying images just like that will be enough to get it running.

Padding the String

Fairly often in real life the counter portion is padded, so that all files have the same length, sort well, etc. So instead of having 1.jpg and 10.jpg you have 01.jpg and 10.jpg. You do this by the number of hashes. Length of the group defines the minimal length of the counter. Shorter counters are padded from the left with zero (0). Longer stay untouched. Let's say you want counter to be 4 characters long (e.g. pic0003.png):

    images: "pic####.png"

Advanced Sequences

Custom Range

The counter always starts on number 1 and stops when all frames are generated. To customize these endpoints, you can append pipe (|) and a range to the sequence string. Range is defined like in Ruby - first number and the last with two dots (..) in between. Let's say you want to start with 8 and end on 23:

    images: "folder/pic#.png|8..23"

Custom Increment

Default counter increment is 1. But sometimes you want to skip a few frames. To customize the increment, you can append an additional pipe (|) followed by the increment integer to the range. Let's say we want every fifth frame from the folder in the range of 1 to 45:

    images: "folder/pic#.png|1..45|5"

Raw Array

Sequence string does all the heavy lifting, it generates an Array input for you. In case your frame images can not be fetched with the simple incremental counter, you need to forget the simple string and supply a simple Array of filenames yourself. Let's say you have 3 frames each with a completely different name:

    images: [
        "54a64b6a684ec5654ea9.jpg",
        "987ef1546654c654a612.jpg",
        "9874654c6879d465b488.png"
    ]
Clone this wiki locally