Folding Animation

Origami supports folding animation since folding engine V4. You can specify the order of folding for each crease line or a more complex folding scenario if needed.

Folding animation in Origami

You can test the animation by creating the “Pizza Box” sample using the “Plus” button at the bottom right corner of the window. Once created, make sure it uses V4 folding engine and drag the Progress slider in the Folding animation section as on the screenshot above.

Editing Animation

In order to specify the animation parameters switch to the dieline editor mode and select the crease line you want to adjust:

Animation parameters of a crease line

You will see the Animation rules field on the left next to the folding angle and crease line name fields. This Animation rules field specifies the way the crease line is animated when you drag the Progress slider.

Folding Order

The easiest way to configure the animation is to assign each crease line a number that will be used to order them for the animation. The smaller is the number, the earlier the crease is folded.

The crease line is folded from 0º to the angle specified in its parameters. If no angle is specified, the 90º value is used, as usual.

The screenshot above shows number “2” for the crease line at the bottom of the box. This means it will be folded second after the flaps that have number “1”:

Flaps are folded first in this box

Note that you can select multiple crease lines and mass-edit their animation rules and other parameters.

Once you finish, you’ll get a dieline folded in the order you specify. Here’s the folding order for the pizza box:

Folding order of the pizza box

The similar crease lines have same order numbers, so the whole shape is folded symmetrically. You can check the numbers yourself by clicking the crease lines and checking the animation rules on the left.

Processing Animation

Once the folding order (or a more complex animation) is configured, Origami runs through all the crease lines and finds out the biggest order number. It then maps all those numbers onto the 0..100% scale that you control using the Progress slider in the Folding animation section.

The Pizza Box example above uses consecutive numbers, so all the crease lines are folded one after another. However, you can make gaps in order numbers and those gaps will effectively make a pause in animation.

Say if a dieline has two crease lines and you set order “1” to the first one and order “3” to the second, you’ll get the first crease folded when the progress slider reaches 33% and the second crease will start folding from the 66% progress. This way you pause the folding animation.

The more complex animations (explained below) are processed the same way, as they also have timings that are mapped onto the 0..100% animation progress scale.

Complex Animations

If you need a more complex animation than a simple ordered folding, you can specify it in a “time - value” manner instead of providing the order number.

Here’s how you do that:

Key-value folding animation in Origami

So instead of simple folding order number you specify something like:

3:0 4:45 5:30 7:90

This is standard key-value animation where you specify the time and angle separated by a colon.

time1:angle1 time2:angle2 time3:angle3

Origami starts with 0:0 and interpolates the crease angle according to the animation progress mapped to the times you specified and the corresponding angles.

The ordered folding explained earlier is actually done the same way. Say a 90º crease line with folding order 5 is actually:

4:0 5:90

or in a more generic manner, a crease line with angle A and order N is actually:

N-1:0 N:A

Note that you cannot combine order numbers and key-value animation parameters for the same crease line. Either this or that. However, you can use folding order for one crease line and complex animation for another.

Illustrator and Other Editors

You can send animated crease lines to Illustrator and other editors (using SVG) format and read them back.

You can also configure the animation right in Illustrator the same way you configure folding angles and crease line names: by properly naming the crease paths.

Let’s send the pizza box dieline with the complex animation to Illustrator and see what happens:

Folding animation rules in Illustrator

Note that you can see the animation rules on the right in the Layers panel. Both folding order numbers and the complex animation sequence are there separated by a special marker @@ from the folding angle.

Yes, it’s that simple: you specify the folding angle (optional), crease line name (optional), then you can put a special animation marker @@ and add the animation rules or folding order you need.

Here are some examples of crease lines names you can use to specify angles, names and animations:

90 Flap angle @@ 5
45 @@ 2:0 4:45
@@ 5

Everything is optional in crease lines names. The angle defaults to 90º, the name is everything between the angle and the animation marker and the animation is everything after the marker.

Possible Problems and Limitations

There’s a number of limitations that you need to be aware of:

  1. You cannot combine folding order and key-value animation in the same rules line (that was mentioned earlier);
  2. If the folding angle doesn’t match the animation result, the animated angle will be used instead;
  3. If animation rules line contains errors, it simply doesn’t work. No errors are emitted. So if a crease line doesn’t fold, it is likely has a typo in its animation parameters;
  4. Negative timings are (obviously) not supported in the complex animations;
  5. Shapes might break during the folding animation if the angles don’t match well. Consider fine-tuning the animation to fix that.

That’s All

That’s pretty much it. The folding animation is actually pretty simple and in most cases all you need is to order the crease lines.

Adobe and Adobe Illustrator are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.