Difference between revisions of "Duplicate Layer"

From Synfig Studio :: Documentation
Jump to: navigation, search
m (Known Problems)
m
 
(24 intermediate revisions by 8 users not shown)
Line 1: Line 1:
The 'Duplicate' layer makes multiple copies of the layers under it in real time.
+
<!-- Page info -->
 +
{{Title|Duplicate Layer}}
 +
{{Category|Layers}}
 +
{{Category|Other}}
 +
{{NewTerminology}}
 +
<!-- Page info end -->
  
It has a single parameter, "Index" which is automatically exported.  This is the only ValueNode that will change from one copy to the next.  This exported value can then be selected in the Children dialog and Connected to the parameter(s) in the layer under the duplicate dialog which should change in the copies.
+
{{l|Image:Layer_other_duplicate_icon.png|64px}}
  
The "Index" parameter has 3 sub-parameters, "From", "To", and "Step".  The value of the exported "Index" parameter varies from the value of "From" to the value of "To" in steps of size "Step".
+
== About Duplicate Layer ==
  
"From" can be higher or lower than "To".  It doesn't matter whether "Step" is positive or negative.  The steps will be in the direction from "From" to "To".
+
The {{Literal|Duplicate Layer}} makes multiple copies of the layers under it in real time.
  
== Known Problems ==
+
The Duplicate Layer works like a loop over the content below it and provides a changing variable to that content. This variable (the {{l|Export|Exported}} Index) can now be used ({{l|Connect|Connected}}) within that content.
  
* The Duplicate Layer doesn't do anything about bounding boxes.  Doing so could help to speed up rendering when the duplicated layers are outside the visible area.  It's not clear how useful or possible this would be.  To calculate its bounding box, the duplicate layer would need to loop through all values of Index to get the underlying bounding boxes and union them together.  Maybe it's worth doing anyway.
+
== Parameters of Duplicate Layer ==
  
* Editing a Bline below a dup layer becomes very difficult because every time you do it, the Bline ducks get all the positions of the duplicated layers and the ducks go here and there if the duplications are at different positions or scale.
+
The parameters of the Duplicate Layers are:
 +
{|border="0" style="border-collapse"  cellpadding="3" cellspacing="0"
 +
|-style="background:silver"
 +
|'''Name'''||'''Value'''||'''Type''' 
 +
|-
 +
||{{l|Image:Real_icon.png|16px}} {{l|Z Depth Parameter|Z Depth}}
 +
||0.000000
 +
||real
 +
|-style="background:#eeeeee"
 +
||{{l|Image:Real_icon.png|16px}} {{l|Amount Parameter|Amount}}
 +
||1.000000
 +
||real
 +
|-
 +
||{{l|Image:Integer_icon.png|16px}} {{l|Blend Method|Blend Method}}
 +
||Composite
 +
||integer
 +
|-style="background:#eeeeee"
 +
||{{l|Image:Real_icon.png|16px}} Index {{l|Image:Valuenode_icon.png|16px}}
 +
||3.000000
 +
||Duplicate
 +
|}
  
=== Recently Fixed Problems (please test) ===
+
=== The Index Parameter ===
  
* Cloning a duplicate layer and having one above the other (rather than having them each inside a disjoint PasteCanvas) causes Synfig to hang, since the same ValueNode will be used for the Index parameter in each of them. [ fixed in r1277 ]
+
The {{Literal|Index}} is automatically {{l|Export|exported}}. This is the only ValueNode that will change from one copy to the next. This exported value can then be selected in the {{l|Library Panel}} and {{l|Connect|Connected}} to the parameter(s) in the layer under the duplicate dialog which should change in the copies.
  
* It shouldn't be possible to Disconnect the Index param in the duplicate layer, but it is. [ fixed in r1278 ]
+
The {{Literal|Index}} parameter has 3 sub-parameters, {{Literal|From}}, {{Literal|To}}, and {{Literal|Step}}. The value of the exported {{Literal|Index}} parameter varies from the value of {{Literal|From}} to the value of {{Literal|To}} in steps of size {{Literal|Step}}.
  
* It shouldn't be possible to Convert the Index param from Duplicate to any other type, but it is. [ fixed in r1279 ]
+
{{Literal|From}} can be higher or lower than {{Literal|To}}. It doesn't matter whether {{Literal|Step}} is positive or negative. The steps will be in the direction from {{Literal|From}} to {{Literal|To}}.
  
* It shouldn't be possible to Disconnect a Duplicate ValueNode using the Children dialog, but it is. [ fixed in r1280 ]
+
The duplicated layers are placed in the layer stack in order, so that those corresponding to the {{Literal|From}} value will appear lower down (i.e. least visible with normal composite blend mode) than those corresponding to the {{Literal|To}} value (most visible).
  
* It shouldn't be possible to Convert a Duplicate ValueNode to any other type using the Children dialog, but it is. [fixed in r1281 ]
+
== How to use ==
  
* It shouldn't be possible to Connect any ValueNode from the Children dialog to the Index param of a Duplicate layer, but it is. [ fixed in r1282 ]
+
* {{l|Doc:Snowflake_with_the_Duplicate_Layer}} : {{l|Duplicate Layer}} + {{l|Rotate Layer}}
 +
* {{l|Doc:Tiling_object}} : {{l|Duplicate Layer}} + {{l|Linking}} {{l|Group Layer}}'s {{l|Origin_Parameter}}
  
* Maybe it would be helpful to Auto-Export the Index parameter to give the user less work to do.  It can always be renamed to something memorable later. [ added in r1283 ]
+
== Known Problems ==
 
+
* Automatic export of the Index parameter works for new layers, but not for cloned layers (copy/paste or right-click > duplicate). [ fixed in r1286 ]
+
 
+
* The Add and Subtract ValueNodes won't allow the linking of the Duplicate layer's Index to their LHS and RHS if they are converted from a Time parameter. [ fixed in r1299 (for add) and r1330 (for subtract) ]
+
  
* The layer doesn't seem to work well with PasteCanvas' parameters. Duplicating a PasteCanvas and linking the Index to its position or time offset doesn't have any effect. [ fixed in r1331 ]
+
* The Duplicate Layer doesn't do anything about bounding boxes. Doing so could help to speed up rendering when the duplicated layers are outside the visible area. It's not clear how useful or possible this would be. To calculate its bounding box, the duplicate layer would need to loop through all values of Index to get the underlying bounding boxes and union them together. Maybe it's worth doing anyway.
  
* Rendering the Duplicate layer modifies the Index parameter.  Studio renders the Navigator dialog's thumbnail and the main canvas at the same time.  These two renders can interfere with each other, since they don't use a mutex to protect the read/write of the Index parameter. [ fixed in r1358 ]
+
* Editing a Spline below a Duplicate Layer becomes very difficult while a recent edit is still being rendered, because the Spline Handles move around as the render runs (if the duplications are at different positions or scale). I tried using the same mutex around the Duplicate ValueNode's operator() method as is used in the Duplicate Layer's code, but it lead to [http://dooglus.rincevent.net/random/deadlock.txt a deadlock].

Latest revision as of 13:04, 26 February 2017

Languages Language: 

English • română


Layer other duplicate icon.png

About Duplicate Layer

The "Duplicate Layer" makes multiple copies of the layers under it in real time.

The Duplicate Layer works like a loop over the content below it and provides a changing variable to that content. This variable (the Exported Index) can now be used (Connected) within that content.

Parameters of Duplicate Layer

The parameters of the Duplicate Layers are:

Name Value Type
Type real icon.png Z Depth 0.000000 real
Type real icon.png Amount 1.000000 real
Type integer icon.png Blend Method Composite integer
Type real icon.png Index Valuenode icon.png 3.000000 Duplicate

The Index Parameter

The "Index" is automatically exported. This is the only ValueNode that will change from one copy to the next. This exported value can then be selected in the Library Panel and Connected to the parameter(s) in the layer under the duplicate dialog which should change in the copies.

The "Index" parameter has 3 sub-parameters, "From", "To", and "Step". The value of the exported "Index" parameter varies from the value of "From" to the value of "To" in steps of size "Step".

"From" can be higher or lower than "To". It doesn't matter whether "Step" is positive or negative. The steps will be in the direction from "From" to "To".

The duplicated layers are placed in the layer stack in order, so that those corresponding to the "From" value will appear lower down (i.e. least visible with normal composite blend mode) than those corresponding to the "To" value (most visible).

How to use

Known Problems

  • The Duplicate Layer doesn't do anything about bounding boxes. Doing so could help to speed up rendering when the duplicated layers are outside the visible area. It's not clear how useful or possible this would be. To calculate its bounding box, the duplicate layer would need to loop through all values of Index to get the underlying bounding boxes and union them together. Maybe it's worth doing anyway.
  • Editing a Spline below a Duplicate Layer becomes very difficult while a recent edit is still being rendered, because the Spline Handles move around as the render runs (if the duplications are at different positions or scale). I tried using the same mutex around the Duplicate ValueNode's operator() method as is used in the Duplicate Layer's code, but it lead to a deadlock.


Languages Language: 

English • română