Difference between revisions of "Doc:Snowflake with the Duplicate Layer"

From Synfig Studio :: Documentation
Jump to: navigation, search
(1st draft, still need to add images and improve text.)
(No difference)

Revision as of 16:15, 14 December 2008

Languages Language: 

English • français • română



This tutorial will give a simple example of the use of the Duplicate Layer, to create a snowflake.

First branch of the snowflake

The 1st part is very simple : We'll create a single snowflake branch with the Bline tool (or the polygon tool). Select the Bline tool, and in the tools options, make sure that only Create Region Bline is selected. (If you use the polygon tool, select either Create Polygon Layer or Create Region Layer, as you wish).

Draw the branch in the upper middle part of your image. Once it's drawn, select the newly created layer (I would refer to it as the "Branch layer") and make sure that the bottom of the branch is more or less at the same place as the green dot showing the center of the image.

Adding the Rotate and Duplicate Layers

To make a whole 6-branches snowflake, we need to make several copies of the branch, and rotate them. First, we need a Rotation layer. Right click on the image and select Layer > New Layer > Transform > Rotate. You should now have a Rotate Layer on top of the branch layer.

Then, we'll use the Duplicate Layer. Right click on the image and select Layer > New Layer > Other > Duplicate.

So far, no change is visible on our image, it's normal :). In the Layers dialog, make sure that the layers are in the following order : Duplicate on top, Rotate in the middle, and the "Branch" layer on the bottom.

Connecting everything together

Select the Duplicate layer and look at the param dialog. There's an "Index" value that is automaticaly exported. Its name is "Index 1". (It looks like "Index(Index 1)"). This value is made of 3 parameters : From, To and Step. Those parameters tells how many times an object is duplicated. We need 6 branches so set the To parameter to 6 (keep From and Step to 1).

Now move to the Child tab, and select our "Index 1" value. (Unfold the ValueBase Node if necessary).

In order to have 6 rotated branches, we need to link the duplication and the rotation.

Select the Rotate layer, and go back to the Params tab. It has just 2 parameters, Origin and Amount. The important one is Amount, it tells the angle of the rotation. Right click on it and select Convert > Scale. Now Amount is made of 2 subparameters, the 1st (Link) tells the angle of rotation, and the 2nd (Scalar) tells the number of time the rotation is applied.

Right click on the Scalar parameter and select Connect. It'll connect the previously select "Index 1" value (Child tab) to the Scalar parameters.

Ok, still no change in the image, but that's because the rotation angle is still 0. Select the Link subparameter and set it to 60. You should now have a complete snowflake, yay.

What happened?

We linked the "Scalar" value to the duplicate layer :
Thanks to the Duplicate, the "Scalar" param was set to values between 1 and 6 (From and To), by steps of 1.
So we had 5 rotation : One of 60° (Scalar * Link = 1 * 60°), another of 120° ( 2 * 60°), another of 180°, etc. And all of these rotations were displayed together.

You can think of the Duplicate Layer as something allowing you to have a list of values, that you can link to a (real) parameter in the same way you could link a single value to a parameter.


Languages Language: 

English • français • română