Difference between revisions of "Convert"

From Synfig Studio :: Documentation
Jump to: navigation, search
m (Linear: added 'color' and 'integer' types)
m (move converts-per-valuetype to the end)
Line 3: Line 3:
 
To convert the value back to its original type, select "Disconnect" from its context menu.
 
To convert the value back to its original type, select "Disconnect" from its context menu.
  
* Angle values can be converted to [[Convert#Linear|Linear]], [[Convert#Scale|Scale]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
+
== Convert Types ==
  
* BLinePoint values can be converted to [[Convert#Composite|Composite]] and [[Convert#Reference|Reference]] types.
+
=== BLine ===
 
+
* Bool values can only be converted to the [[Convert#Reference|Reference]] type.
+
 
+
* Canvas values can be converted to the [[Convert#Reference|Reference]] type.
+
 
+
* Color values can be converted to [[Convert#Composite|Composite]], [[Convert#Linear|Linear]], [[Convert#Radial Composite|Radial Composite]], [[Convert#Scale|Scale]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
+
 
+
* Gradient values can be converted to [[Convert#Gradient Rotate|Gradient Rotate]], [[Convert#Stripes|Stripes]], [[Convert#Two-Tone|Two-Tone]], and [[Convert#Reference|Reference]] types.
+
 
+
* Integer values can be converted to [[Convert#Linear|Linear]], [[Convert#Scale|Scale]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
+
 
+
* List values can be converted to [[Convert#BLine|BLine]], [[Convert#Dynamic List|Dynamic List]], and [[Convert#Reference|Reference]] types.
+
 
+
* Real values can be converted to [[Convert#Linear|Linear]], [[Convert#Scale|Scale]], [[Convert#Sine|Sine]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
+
 
+
* Segment values can be converted to the [[Convert#Composite|Composite]] and [[Convert#Reference|Reference]] types.
+
 
+
* String values can be converted to the [[Convert#Reference|Reference]] type.
+
 
+
* Time values can be converted to the [[Convert#Linear|Linear]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
+
 
+
* Vector values can be converted to [[Convert#Composite|Composite]], [[Convert#Linear|Linear]], [[Convert#Radial Composite|Radial Composite]], [[Convert#Scale|Scale]], [[Convert#Segment Tangent|Segment Tangent]], [[Convert#Segment Vertex|Segment Vertex]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
+
 
+
== BLine ==
+
  
 
Converting a list parameter to "BLine" doesn't seem to change anything.  Perhaps that's the default type for lists of vertices, such as are found in outlines and regions?
 
Converting a list parameter to "BLine" doesn't seem to change anything.  Perhaps that's the default type for lists of vertices, such as are found in outlines and regions?
  
== Composite ==
+
=== Composite ===
  
 
Converting a blinepoint parameter to "Composite" adds six sub-parameters:
 
Converting a blinepoint parameter to "Composite" adds six sub-parameters:
Line 61: Line 37:
 
The resulting value is a blinepoint, color, segment, or vector made by combining the component parts.
 
The resulting value is a blinepoint, color, segment, or vector made by combining the component parts.
  
== Dynamic List ==
+
=== Dynamic List ===
  
 
Converting a list parameter to "Dynamic List" seems to replace each of the "Vertex NNN" sub-parameters with "Item NNN" parameters which can't be expanded, but can be exported.
 
Converting a list parameter to "Dynamic List" seems to replace each of the "Vertex NNN" sub-parameters with "Item NNN" parameters which can't be expanded, but can be exported.
  
== Gradient Rotate ==
+
=== Gradient Rotate ===
  
 
Converting a gradient parameter to "Gradient Rotate" adds two sub-parameters:
 
Converting a gradient parameter to "Gradient Rotate" adds two sub-parameters:
Line 74: Line 50:
 
The resulting value is a gradient based on the "Gradient" parameter, but shifted left (for negative values) or right, according to the value of the "Offset" parameter.  An offset of 1.0 will shift the gradient by its entire visible width.  Values shifted off the left or right edge aren't lost - they aren't visible in the gradient as it's displayed in the parameters dialog, but they will still be used when rendering (depending on parameters such as 'Loop' and 'Zigzag', which can cause gradients to be looped between their their left and right edges, rather than using the non-displayed parts).
 
The resulting value is a gradient based on the "Gradient" parameter, but shifted left (for negative values) or right, according to the value of the "Offset" parameter.  An offset of 1.0 will shift the gradient by its entire visible width.  Values shifted off the left or right edge aren't lost - they aren't visible in the gradient as it's displayed in the parameters dialog, but they will still be used when rendering (depending on parameters such as 'Loop' and 'Zigzag', which can cause gradients to be looped between their their left and right edges, rather than using the non-displayed parts).
  
== Linear ==
+
=== Linear ===
  
 
Converting an angle parameter to be 'Linear' adds two angle sub-parameters:
 
Converting an angle parameter to be 'Linear' adds two angle sub-parameters:
Line 108: Line 84:
 
   Offset + Rate*time
 
   Offset + Rate*time
  
== Radial Composite ==
+
=== Radial Composite ===
  
 
Converting a color to "Radial Composite" adds four sub-parameters:
 
Converting a color to "Radial Composite" adds four sub-parameters:
Line 124: Line 100:
 
For vector parameters, the resulting value is the point reached by traveling a distance "Radius" from the origin, in the distance given by the angle "Theta".
 
For vector parameters, the resulting value is the point reached by traveling a distance "Radius" from the origin, in the distance given by the angle "Theta".
  
== Reference ==
+
=== Reference ===
  
 
Converting a parameter to "Reference" adds a single sub-parameter called "Link".  The "Link" parameter is the same type as the parameter being converted.
 
Converting a parameter to "Reference" adds a single sub-parameter called "Link".  The "Link" parameter is the same type as the parameter being converted.
Line 140: Line 116:
 
   Link
 
   Link
  
== Scale ==
+
=== Scale ===
  
 
Converting a parameter to "Scale" adds two sub-parameters: one called "Link", of the same type as the parameter itself, and a real-valued parameter called "Scalar".
 
Converting a parameter to "Scale" adds two sub-parameters: one called "Link", of the same type as the parameter itself, and a real-valued parameter called "Scalar".
Line 149: Line 125:
 
   Link * Scalar
 
   Link * Scalar
  
== Segment Tangent ==
+
=== Segment Tangent ===
  
 
Converting a vector parameter to "Segment Tangent" adds two sub-parameters:
 
Converting a vector parameter to "Segment Tangent" adds two sub-parameters:
Line 157: Line 133:
 
Amount is a number between 0 and 1, defining the distance along the given segment.  The resulting value for the whole parameter is the tangent to the segment, at the given point along the segment.
 
Amount is a number between 0 and 1, defining the distance along the given segment.  The resulting value for the whole parameter is the tangent to the segment, at the given point along the segment.
  
== Segment Vertex ==
+
=== Segment Vertex ===
  
 
Converting a vector parameter to "Segment Vertex" adds two sub-parameters:
 
Converting a vector parameter to "Segment Vertex" adds two sub-parameters:
Line 165: Line 141:
 
Amount is a number between 0 and 1, defining the distance along the given segment.  The resulting value is the vertex at the given point along the segment.
 
Amount is a number between 0 and 1, defining the distance along the given segment.  The resulting value is the vertex at the given point along the segment.
  
== Sine ==
+
=== Sine ===
  
 
Converting a real-valued parameter to "Sine" adds two sub-parameters:
 
Converting a real-valued parameter to "Sine" adds two sub-parameters:
Line 174: Line 150:
 
   Amplitude * sin(Angle)
 
   Amplitude * sin(Angle)
  
== Stripes ==
+
=== Stripes ===
  
 
Converting a gradient parameter to "Stripes" adds four sub-parameters:
 
Converting a gradient parameter to "Stripes" adds four sub-parameters:
Line 184: Line 160:
 
The resulting value is a gradient containing "Stripe Count" equally spaced, equally wide stripes of color "Color 2" with a background of "Color 1".  "Width" specifies the width of the stripes, with a width of 0 or less meaning they are invisible, and a width of 1 or more meaning the whole gradient is of "Color 2".
 
The resulting value is a gradient containing "Stripe Count" equally spaced, equally wide stripes of color "Color 2" with a background of "Color 1".  "Width" specifies the width of the stripes, with a width of 0 or less meaning they are invisible, and a width of 1 or more meaning the whole gradient is of "Color 2".
  
== Subtract ==
+
=== Subtract ===
  
 
Converting a parameter to "Subtract" adds three real-valued sub-parameters:
 
Converting a parameter to "Subtract" adds three real-valued sub-parameters:
Line 194: Line 170:
 
   (LHS - RHS) * Scalar
 
   (LHS - RHS) * Scalar
  
== Timed Swap ==
+
=== Timed Swap ===
  
 
This convert type was disabled in Synfig 0.61.06 and earlier because it didn't work.
 
This convert type was disabled in Synfig 0.61.06 and earlier because it didn't work.
Line 217: Line 193:
 
   else interpolate between "Before" and "After"
 
   else interpolate between "Before" and "After"
  
== Two-Tone ==
+
=== Two-Tone ===
  
 
Converting a gradient to "Two-Tone" adds two color-valued sub-parameters:
 
Converting a gradient to "Two-Tone" adds two color-valued sub-parameters:
Line 226: Line 202:
  
 
These color parameters can be animated, giving us the ability to have the gradient change color over time.  This can be used as a workaround for [http://sourceforge.net/tracker/index.php?func=detail&aid=1568818&group_id=144022&atid=757416 this bug].
 
These color parameters can be animated, giving us the ability to have the gradient change color over time.  This can be used as a workaround for [http://sourceforge.net/tracker/index.php?func=detail&aid=1568818&group_id=144022&atid=757416 this bug].
 +
 +
== Which Value Types can use which Convert Types? ==
 +
 +
There are 13 different types of value in Synfig.  Each of these types has a different set of convert types available to it, as follows:
 +
 +
=== Angle ===
 +
 +
* Angle parameters can be converted to [[Convert#Linear|Linear]], [[Convert#Scale|Scale]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
 +
 +
=== BLinePoint ===
 +
 +
* BLinePoint parameters can be converted to [[Convert#Composite|Composite]] and [[Convert#Reference|Reference]] types.
 +
 +
=== Bool ===
 +
 +
* Bool parameters can only be converted to the [[Convert#Reference|Reference]] type.
 +
 +
=== Canvas ===
 +
 +
* Canvas parameters can be converted to the [[Convert#Reference|Reference]] type.
 +
 +
=== Color ===
 +
 +
* Color parameters can be converted to [[Convert#Composite|Composite]], [[Convert#Linear|Linear]], [[Convert#Radial Composite|Radial Composite]], [[Convert#Scale|Scale]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
 +
 +
=== Gradient ===
 +
 +
* Gradient parameters can be converted to [[Convert#Gradient Rotate|Gradient Rotate]], [[Convert#Stripes|Stripes]], [[Convert#Two-Tone|Two-Tone]], and [[Convert#Reference|Reference]] types.
 +
 +
=== Integer ===
 +
 +
* Integer parameters can be converted to [[Convert#Linear|Linear]], [[Convert#Scale|Scale]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
 +
 +
=== List ===
 +
 +
* List parameters can be converted to [[Convert#BLine|BLine]], [[Convert#Dynamic List|Dynamic List]], and [[Convert#Reference|Reference]] types.
 +
 +
=== Real ===
 +
 +
* Real parameters can be converted to [[Convert#Linear|Linear]], [[Convert#Scale|Scale]], [[Convert#Sine|Sine]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
 +
 +
=== Segment ===
 +
 +
* Segment parameters can be converted to the [[Convert#Composite|Composite]] and [[Convert#Reference|Reference]] types.
 +
 +
=== String ===
 +
 +
* String parameters can be converted to the [[Convert#Reference|Reference]] type.
 +
 +
=== Time ===
 +
 +
* Time parameters can be converted to the [[Convert#Linear|Linear]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.
 +
 +
=== Vector ===
 +
 +
* Vector parameters can be converted to [[Convert#Composite|Composite]], [[Convert#Linear|Linear]], [[Convert#Radial Composite|Radial Composite]], [[Convert#Scale|Scale]], [[Convert#Segment Tangent|Segment Tangent]], [[Convert#Segment Vertex|Segment Vertex]], [[Convert#Subtract|Subtract]], [[Convert#Timed Swap|Timed Swap]], and [[Convert#Reference|Reference]] types.

Revision as of 18:31, 6 September 2007

Languages Language: 

English • română


Right-clicking on a value in the Parameters dialog brings up a context menu which has a sub-menu called "Convert". The "Convert" menu allows you to specify that the parameter should be controlled automatically in various ways. Depending on the type of the parameter the Convert menu will contain different options.

To convert the value back to its original type, select "Disconnect" from its context menu.

Convert Types

BLine

Converting a list parameter to "BLine" doesn't seem to change anything. Perhaps that's the default type for lists of vertices, such as are found in outlines and regions?

Composite

Converting a blinepoint parameter to "Composite" adds six sub-parameters:

  • vector "Vertex"
  • real "Width"
  • real "Origin"
  • bool "Split Tangents"
  • vector "Tangent 1"
  • vector "Tangent 2"

Converting a color parameter to "Composite" adds four real-valued sub-parameters:

  • real "Red"
  • real "Green"
  • real "Blue"
  • real "Alpha"

Converting a segment parameter to "Composite" adds four vertex sub-parameters:

  • vertex "Vertex 1"
  • vertex "Tangent 1"
  • vertex "Vertex 2"
  • vertex "Tangent 2"

Converting a vector parameter to "Composite" adds two real-valued sub-parameters:

  • real "X-Axis"
  • real "Y-Axis"

The resulting value is a blinepoint, color, segment, or vector made by combining the component parts.

Dynamic List

Converting a list parameter to "Dynamic List" seems to replace each of the "Vertex NNN" sub-parameters with "Item NNN" parameters which can't be expanded, but can be exported.

Gradient Rotate

Converting a gradient parameter to "Gradient Rotate" adds two sub-parameters:

  • gradient "Gradient"
  • real "Offset"

The resulting value is a gradient based on the "Gradient" parameter, but shifted left (for negative values) or right, according to the value of the "Offset" parameter. An offset of 1.0 will shift the gradient by its entire visible width. Values shifted off the left or right edge aren't lost - they aren't visible in the gradient as it's displayed in the parameters dialog, but they will still be used when rendering (depending on parameters such as 'Loop' and 'Zigzag', which can cause gradients to be looped between their their left and right edges, rather than using the non-displayed parts).

Linear

Converting an angle parameter to be 'Linear' adds two angle sub-parameters:

  • angle "Rate"
  • angle "Offset"

Converting a color parameter to be 'Linear' adds two angle sub-parameters (since svn r617):

  • color "Rate"
  • color "Offset"

Converting an integer parameter to be 'Linear' adds two angle sub-parameters (since svn r617):

  • integer "Rate"
  • integer "Offset"

Converting a real parameter to be 'Linear' adds two real-valued sub-parameters:

  • real "Rate"
  • real "Offset"

Converting a time parameter to be 'Linear' adds two time sub-parameters:

  • time "Rate"
  • time "Offset"

Converting a vector parameter to be 'Linear' adds two vector sub-parameters:

  • vector "Slope"
  • vector "Offset"

The parameter's value will change linearly over time, starting with the value specified by "Offset" at time zero, and increasing by the value specified by "Rate" (or "Slope", in the case of vector parameters) every second.

The resulting value for vector parameters is:

  Offset + Slope*time

and for the other 5 types of parameter it is:

  Offset + Rate*time

Radial Composite

Converting a color to "Radial Composite" adds four sub-parameters:

  • real "Luma"
  • real "Saturation"
  • angle "Hue"
  • real "Alpha"

Converting a vector to "Radial Composite" adds two sub-parameters:

  • real "Radius"
  • angle "Theta"

For color parameters, the resulting value is the color with the given lima, saturation, hue, and alpha amounts.

For vector parameters, the resulting value is the point reached by traveling a distance "Radius" from the origin, in the distance given by the angle "Theta".

Reference

Converting a parameter to "Reference" adds a single sub-parameter called "Link". The "Link" parameter is the same type as the parameter being converted.

It doesn't seem to do anything at all, other than adding an extra parameter. Whatever value is put into "Link" becomes the value of the parameter being converted.

The only use for this conversion type I can think of is the following:

  • you know that point A should follow point B, so you export point B and connect point A to it
  • you're not yet sure exactly how point B should move, so you experiment with different conversion types for point B
  • changing the conversion type for point B breaks the connection you made in the first step
  • converting point B to be a reference, and then experimenting with different conversions in its "Link" parameter allows point A to connect to point B and for the connection to remain in place while you experiment in the "Link" parameter

The resulting value is:

  Link

Scale

Converting a parameter to "Scale" adds two sub-parameters: one called "Link", of the same type as the parameter itself, and a real-valued parameter called "Scalar".

"Scale" can be used on angles, colors, integers, reals, and vectors.

The resulting value is:

  Link * Scalar

Segment Tangent

Converting a vector parameter to "Segment Tangent" adds two sub-parameters:

  • segment "Segment"
  • real "Amount"

Amount is a number between 0 and 1, defining the distance along the given segment. The resulting value for the whole parameter is the tangent to the segment, at the given point along the segment.

Segment Vertex

Converting a vector parameter to "Segment Vertex" adds two sub-parameters:

  • segment "Segment"
  • real "Amount"

Amount is a number between 0 and 1, defining the distance along the given segment. The resulting value is the vertex at the given point along the segment.

Sine

Converting a real-valued parameter to "Sine" adds two sub-parameters:

  • angle "Angle"
  • real "Amplitude".

The resulting value is:

  Amplitude * sin(Angle)

Stripes

Converting a gradient parameter to "Stripes" adds four sub-parameters:

  • color "Color 1"
  • color "Color 2"
  • integer "Stripe Count"
  • real "Width"

The resulting value is a gradient containing "Stripe Count" equally spaced, equally wide stripes of color "Color 2" with a background of "Color 1". "Width" specifies the width of the stripes, with a width of 0 or less meaning they are invisible, and a width of 1 or more meaning the whole gradient is of "Color 2".

Subtract

Converting a parameter to "Subtract" adds three real-valued sub-parameters:

  • real "LHS"
  • real "RHS"
  • real "Scalar"

The resulting value is:

  (LHS - RHS) * Scalar

Timed Swap

This convert type was disabled in Synfig 0.61.06 and earlier because it didn't work.

Converting a parameter to "Timed Swap" adds four sub-parameters:

  • parent "Before"
  • parent "After"
  • time "Swap Time"
  • time "Swap Duration"

"Before" and "After" are the same type as the parameter being converted.

This conversion type linearly switches from "Before" to "After", taking "Swap Duration" seconds to do so, and completing the swap at "Swap Time".

Note that this doesn't give us anything that we can't achieve using the "Linear" conversion type and a few waypoints, except that it works on more types than the somewhat restricted "Linear" conversion. The "Linear" conversion could be extended to work on the missing types.

"Timed Swap" can be used on angles, colors, integers, reals, times, and vectors.

The resulting value is:

  if time > "Swap Time" then "After"
  else if time < ("Swap Time" - "Swap Duration") then "Before"
  else interpolate between "Before" and "After"

Two-Tone

Converting a gradient to "Two-Tone" adds two color-valued sub-parameters:

  • color "Color1"
  • color "Color2"

The resulting gradient has two CPoints, one at each end, starting with "Color1" and ending with "Color2".

These color parameters can be animated, giving us the ability to have the gradient change color over time. This can be used as a workaround for this bug.

Which Value Types can use which Convert Types?

There are 13 different types of value in Synfig. Each of these types has a different set of convert types available to it, as follows:

Angle

BLinePoint

Bool

  • Bool parameters can only be converted to the Reference type.

Canvas

  • Canvas parameters can be converted to the Reference type.

Color

Gradient

Integer

List

Real

Segment

String

  • String parameters can be converted to the Reference type.

Time

Vector


Languages Language: 

English • română