Difference between revisions of "Sif Format"
m (Refined the Concepts section) |
(→<canvas>: default canvas attributes) |
||
Line 42: | Line 42: | ||
{|border="1" cellpadding="5" cellspacing="0" | {|border="1" cellpadding="5" cellspacing="0" | ||
− | |'''Attribute'''||''' | + | |'''Attribute'''||'''Default'''||'''Value''' |
|- | |- | ||
− | |version||''' | + | |version||'''no default''', this attribute is required||0.1, always |
|- | |- | ||
− | |width|| | + | |width||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L130 720]||the width of the canvas in pixels |
|- | |- | ||
− | |height|| | + | |height||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L131 480]||the height of the canvas in pixels |
|- | |- | ||
− | |xres|| | + | |xres||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L132 2835]||the width of the canvas in pixels per meter |
|- | |- | ||
− | |yres|| | + | |yres||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L133 2835]||the height of the canvas in pixels per meter |
|- | |- | ||
− | |view-box|| | + | |view-box||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L134-135 -4 2.25 4 -2.25]||the bounding coordinates of the canvas (left top right bottom) |
|- | |- | ||
− | |antialias|| | + | |antialias||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L137 2]||how hard Synfig should try to antialias the image |
|- | |- | ||
− | |fps|| | + | |fps||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L143 24]||frames per second |
|- | |- | ||
− | |begin-time|| | + | |begin-time||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L144 0]||where on the timetrack should rendering start |
|- | |- | ||
− | |end-time|| | + | |end-time||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L145 0]||what on the timetrack should rendering end |
|- | |- | ||
− | |bgcolor|| | + | |bgcolor||[https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/renddesc.h#L138 0.5 0.5 0.5 1.0]||the color of the background in RGBA |
|} | |} | ||
Revision as of 18:23, 5 January 2016
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.
Contents
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 strange to animators who use Flash because, in Flash, importing something causes it to be embedded in the current animation.
One drawback of Synfig's approach is that .sif dependencies can be hard to track. A tool called Remake solves this problem.
Recursion of .sif files is prohibited.
XML
<canvas>
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 | Default | Value |
version | no default, this attribute is required | 0.1, always |
width | 720 | the width of the canvas in pixels |
height | 480 | the height of the canvas in pixels |
xres | 2835 | the width of the canvas in pixels per meter |
yres | 2835 | the height of the canvas in pixels per meter |
view-box | -4 2.25 4 -2.25 | the bounding coordinates of the canvas (left top right bottom) |
antialias | 2 | how hard Synfig should try to antialias the image |
fps | 24 | frames per second |
begin-time | 0 | where on the timetrack should rendering start |
end-time | 0 | what on the timetrack should rendering end |
bgcolor | 0.5 0.5 0.5 1.0 | the color of the background in RGBA |
<canvas> Children
Inside a <canvas> you can find the following elements:
- <defs>
- <meta>
- <name>
- <desc>
- <author>
- <layer>
- <bones>
- <keyframe>