The animation elements of ODP (anim:par, anim:seq,
anim:iterate, anim:animate, anim:set and the
rest, described on the slides
page) are SMIL 2.0 elements in ODF namespaces. Their attributes are defined in
chapter 19 of OpenDocument 1.3 part 3, most of them by reference to SMIL 2.0. This page
lists every value the two standards give.
anim: attributes
| Attribute | Values | Meaning |
|---|---|---|
anim:iterate-type | by-paragraph, by-word, by-letter | On anim:iterate: step through the target shape by paragraphs, or the shape or paragraph by words or letters. |
anim:iterate-interval | duration | Time between the steps. |
anim:sub-item | whole, background, text | Animate the shape and its text; only its background; only its text. When iterating, whole includes the background and text only the text. |
anim:color-interpolation | rgb (default), hsl | Colour space for colour animations. |
anim:color-interpolation-direction | clockwise (default), counter-clockwise | Way round the hue circle (HSL only). The standard’s description writes the second value as counterclockwise. |
anim:audio-level | 0 to 1 | Volume of anim:audio: 0 silent, 1 the system volume. |
anim:command | custom, verb, play, toggle-pause, stop, stop-audio | On anim:command; see below. |
anim:name, anim:value | text | On anim:param: a command parameter. |
anim:formula | expression | A formula for the animated value; overrides smil:values, smil:from, smil:to and smil:by. |
anim:id | NCName | Deprecated identifier; must equal xml:id and is then ignored. |
Commands
anim:command | Target | Parameter (anim:param) |
|---|---|---|
custom | user-defined | At least one, with user-defined name and value. |
verb | an embedded OLE object | Name verb, value the verb number to run. |
play | a media shape: start playing | Name play, value the start time in seconds (the standard’s prose calls it media-time); without it, play resumes where it stopped. |
toggle-pause | a media shape: pause or resume | – |
stop | a media shape: stop | – |
stop-audio | no target: stop all sound | – |
Formula grammar
The minimum grammar every reader supports:
formula ::= additive_expression
identifier ::= '$' | 'pi' | 'e' | 'x' | 'y' | 'width' | 'height'
function ::= 'abs' | 'sqrt' | 'sin' | 'cos' | 'tan' | 'atan' | 'acos' | 'asin' | 'exp' | 'log'
binary_function ::= 'min' | 'max'
basic_expression ::= number | identifier
| unary_function S* '(' S* additive_expression S* ')'
| binary_function S* '(' S* additive_expression S* ',' S* additive_expression S* ')'
| '(' S* additive_expression S* ')'
unary_expression ::= '-' S* basic_expression | basic_expression
multiplicative_expression ::= unary_expression ( ( S* '*' S* unary_expression ) | ( S* '/' S* unary_expression ) )*
additive_expression ::= multiplicative_expression ( ( S* '+' S* multiplicative_expression ) | ( S* '-' S* multiplicative_expression ) )*
number ::= sign? integer | sign? floating-point-constant
$ is the progress through the animation, 0 to 1; pi is π.
Inside a presentation also: e (Euler’s number), and x,
y, width, height: the animated shape’s left
edge, top edge, width and height as fractions of the screen (0 to 1). The grammar
calls the one-argument functions function in one rule and
unary_function in another.
Animatable attributes
smil:attributeName takes these values:
| Value | Animates |
|---|---|
x, y | Position, as fractions of the screen (0 left or top, 1 right or bottom). |
width, height | Size, as fractions of the screen size. |
rotate | Rotation of the shape and its text. |
skewX, skewY | Horizontal and vertical skew. |
opacity | Opacity. |
visibility | Visibility. |
color | Fill, line and text colour together (RGB or HSL values). |
fillColor, fillStyle | Fill colour and fill style. |
lineColor, lineStyle | Line colour and line style. |
charColor, charFontName, charHeight, charPosture, charUnderline, charWeight | Text colour, font, size, slant, underline and weight. |
smil:targetElement names the shape by its xml:id or
draw:id, or a paragraph by its xml:id or
text:id.
SMIL attributes
| Attribute | Values | Meaning |
|---|---|---|
smil:begin, smil:end | list of begin values (below) | When the element starts or ends (SMIL §10.3.1). |
smil:dur | string; a clock value | Simple duration (SMIL §10.3.1). |
smil:repeatCount | non-negative decimal or indefinite | Number of repeats. |
smil:repeatDur | clock value or indefinite | Total time to repeat for. |
smil:fill | remove, freeze, hold, auto, default, transition | What happens when the element ends. |
smil:fillDefault | remove, freeze, hold, transition, auto, inherit | Default smil:fill for children. |
smil:restart | never, always, whenNotActive, default (default) | Whether it may start again. |
smil:restartDefault | never, always, whenNotActive, inherit (default) | Default for children. |
smil:endsync | first, last, all, media or an element ID | When a par ends relative to its children. |
smil:accelerate, smil:decelerate | 0 to 1, default 0 | Acceleration and deceleration (SMIL §11.1.2); 0 means none. |
smil:autoReverse | true, false (default) | SMIL §11.1.2. |
smil:from, smil:to, smil:by, smil:values | text | Animation values (SMIL §3.4.2, §3.4.4). |
smil:calcMode | discrete, linear, paced, spline | Interpolation; default discrete for animate and animateColor, paced for animateMotion. |
smil:keyTimes, smil:keySplines | text | Key times and spline control values (SMIL §3.7.1). |
smil:accumulate | none, sum | SMIL §3.4.3. |
smil:additive | replace, sum | SMIL §3.4.3. |
smil:type, smil:subtype | see SMIL transitions | Transition on anim:transitionFilter. |
smil:direction | forward (default), reverse | Transition direction. |
smil:mode | in (default), out | Transition in or out. |
smil:fadeColor | colour, default #000000 | Colour for fade transitions. |
Timing syntax
From SMIL 2.0 §10.3.1. A begin or end attribute is a list of values separated by semicolons; each value is one of:
| Kind | Syntax | Example |
|---|---|---|
| offset | a clock value | 2s |
| syncbase | ID .begin or .end, optional ± clock value | id1.begin |
| event | (ID .)? event name, optional ± clock value | id2.click |
| repeat | (ID .)? repeat(n), optional ± clock value | |
| access key | accesskey(character), optional ± clock value | |
| media marker | ID .marker(name) | |
| wall clock | a wall-clock sync value (SMIL §10.3.1) | |
indefinite | in an ODF main sequence: wait for the user to advance |
A clock value is hh:mm:ss.fraction (full), mm:ss.fraction
(partial; minutes and seconds two digits, 00 to 59) or a count with an optional
fraction and unit: h, min, s (the default) or
ms, such as 0.5s or 250ms. No spaces inside.
ODF’s appendix F uses indefinite for steps that wait for a click,
id.begin for a slide’s transition, and shape-id.click for
interactive sequences.
Source
OpenDocument Version 1.3, OASIS Standard, 27 April 2021, part 3 (schema), sections 19.2 to 19.12 and 19.436 to 19.464, and appendix F. W3C SMIL 2.0 (Recommendation, 7 January 2005), chapter 10 “Timing and synchronization” (§10.3.1 begin values and clock values). Both read for this page. The fuller meaning of each SMIL attribute is in SMIL 2.0 chapters 3, 10, 11 and 12; only the parts named above were read.