Difference between revisions of "Sif Format"

From Synfig Studio :: Documentation
Jump to: navigation, search
(Documented <canvas> attributes)
(Added Concepts section)
Line 1: Line 1:
A .sif file is the XML representation of a [[canvas]].
+
A .sif file is the XML representation of a {{L|Canvas|canvas}}.
It holds the canvas's metadata, such as width and height, as well as information about its [[Layer|layers]].
+
It holds the canvas's metadata, such as width and height, as well as information about its {{L|Layer|layers}}.
 
Typically, a Synfig production comprises many .sif files joined in a sequence or nested within each other.
 
Typically, a Synfig production comprises many .sif files joined in a sequence or nested within each other.
  
Line 15: Line 15:
 
== The format as of January 2016 ==
 
== The format as of January 2016 ==
  
The top-level element of a .sif file is always a {{literal|&lt;canvas&gt;}}.
+
=== Concepts ===
 +
 
 +
.sif files aren't always self-contained.
 +
They can '''import''' (read: link to) other .sif files, which creates a dependency of one on the other.
 +
This may seem alien to animators who are used to Flash Professional because, in Flash, importing something causes it
 +
to become embedded in the animation.
 +
 
 +
A consequence of Synfig's approach is that a .sif file's dependencies can be hard to track.
 +
A tool called [https://github.com/morevnaproject/remake Remake] solves this problem.
 +
 
 +
Recursion should be prohibited in all .sif implementations.
 +
 
 +
=== XML ===
 +
 
 +
The top element of a .sif file is always a <code>&lt;canvas&gt;</code>.
  
 
<pre>
 
<pre>

Revision as of 17:30, 5 January 2016

Languages Language: 

English


A .sif file is the XML representation of a canvas. It holds the canvas's metadata, such as width and height, as well as information about its layers. Typically, a Synfig production comprises many .sif files joined in a sequence or nested within each other.

The .sif format is formidably complex and evolving. It is implementation-defined rather than spec-defined. Therefore, you should take everything on this page with a grain of salt. Indeed, the implementation can change at any point.

There are no plans to freeze the format.

Source code

The .sif format is implemented by the following file:

https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/loadcanvas.cpp

The format as of January 2016

Concepts

.sif files aren't always self-contained. They can import (read: link to) other .sif files, which creates a dependency of one on the other. This may seem alien to animators who are used to Flash Professional because, in Flash, importing something causes it to become embedded in the animation.

A consequence of Synfig's approach is that a .sif file's dependencies can be hard to track. A tool called Remake solves this problem.

Recursion should be prohibited in all .sif implementations.

XML

The top element of a .sif file is always a <canvas>.

<?xml version="1.0"?>
<canvas version="0.1" width="300" height="350" xres="2952.7559"
        yres="2952.7559" view-box="-1.5 2.5 1.5 -1" antialias="2"
        fps="12" begin-time="0f" end-time="0f" bgcolor="0.5 0.5 0.5 1">
    ...
</canvas>
Attribute Value
version 0.1, always
width the width of the canvas in pixels
height the height of the canvas in pixels
xres the width of the canvas in Synfig's own units (?)
yres the height of the canvas in Synfig's own units (?)
view-box the bounding coordinates of the canvas (Xmin Ymin Xmax Ymax)
antialias how hard Synfig should try to antialias the image
fps frames per second
begin-time what frame rendering should start at
end-time what frame rendering should end at
bgcolor the color of the background


Languages Language: 

English