SMIL

From Apache OpenOffice Wiki
Jump to: navigation, search

The Synchronized Multimedia Integration Language (SMIL, pronounced "smile") enables simple authoring of interactive audiovisual presentations.

Custom Animations

History

Prior to OOo 2.0, impress stored each shape animation at the shape that was animated. One drawback of this method was that each shape could only have one animation assigned. We later added a second animation so that each shape could have one entrance and one exit animation. The order of the animated shapes could be changed but each entrance animation would be followed directly by the exit animation. The animations where either all triggered on next (this could either be a mouse click or for example the space key) or started automatically.

It was not possible to mix click and automatically started animations on a slide.

Unlike OOo 1.x, the introduction of a SMIL based presentation engine in OOo 2.0 allowed the user to assign more then one animation to each shape. It is now also possible to mix automatic and non automatic animations. The order of the animations can be changed, independent of the animated shapes.

The elements and attributes for custom animations are documented in the OpenDocument file format (also known as ODF).

Timing Root

To support an easy to use interface, Impress depends on a specific hierarchies when storing animations.

In a presentation document, each slide can have a set of multiple animationss that are executed in a defined order when the slide is animated inside a slide show. A SMIL animation consists of a nodes hierarchies where some nodes can have child nodes. Nodes with child nodes are called containers. OOo currently supports the following containers

  • anim:seq

A sequence container that when started starts its first node. When the first node is finished the second node is started and so on.

  • anim:par

A parallel container that when started starts all of its child nodes at the same time

  • anim:iter

Todo

Each slide has on parallel container that may be empty if no animationss are stored on the slide. This container is called the 'timing-root'. If the slide contains custom animations the first child node of the 'timing-root' is a sequence container called 'main-sequence'.

Main Sequence

The 'main-sequence' stores all animations that are started when the slide is animated inside a slide show after the slide transition has been animated. The 'main-sequence' also contains animations that are started on next (mouse click or key press).

The child nodes of the 'main-sequence' are parallel containers that group animations that are started together, called 'start groups'. The user interface currently offers three different start types for animations.

  • on-click

This animation starts on next, meaning when the mouse is clicked or the space key is pressed during the slide show

  • with-previous

This animation starts as soon as the previous animation starts

  • after-previous

This animation starts after the previous animation ends

Animations are added to the current 'start container' until a 'on-click' animation is found (except this would be the first animation in a 'start container'. Then a new 'start group' is created and so on.

So for example if the user interface contains the following animations

  • on-click
  • with-previous
  • after-previous
  • on-click

the SMIL Hierarchies would look like

<anim:par presentation:node-type="timing-root">
  <anim:seq presentation:node-type="main-sequence">
    <anim:par smil:begin="next">
      [..on-click..]
      [..with-previous..]
      [..after-previous..]
    </anim:par>
    <anim:par smil:begin="next">
      [..on-click..]
    </anim:par>
  </anim>
</anim>

Inside the 'start container' is one parallel container for the first animation and all 'with-previous' animations that follow directly. This container is called a 'with container'. For each 'after-previous' animation a new 'with container' is added to the 'start container'.

So our example above would be

<anim:par presentation:node-type="timing-root">
  <anim:seq presentation:node-type="main-sequence">
    <anim:par smil:begin="next">
      <anim:par smil:begin="0s">
        [..on-click..]
        [..with-previous..]
        [..after-previous..]
      </anim:par>
      <anim:par smil:begin="(duration of the above container)">
        [..on-click..]
      </anim:par>
    </anim:par>
  </anim>
</anim>
<pre>

Last but not least a parallel container for each animation is added, the so called 'animation container'. Like the 'timing-root' and the 'main-sequence',
the 'animation container' has a presentation:node-type attribute that documents if it is a 'on-click', 'with-previous' or 'after-previous' animation.
This attribute is for user interface purposes only but should be set accordingly. An 'animation container' can also have the attributes
presentation:preset-class, presentation:preset-id, presentation:preset-sub-type. They are also only for user interface purposes to document
which animation from the predefined animation templates was used to create this animation.

Now the child nodes of the 'animation container' are nodes like anim:set oder anim:transitionFilter to actually animate the shape.

Here is one example with a 'on-click', 'with-previous', 'after-previous' and 'on-click' animation:

<pre>
  <anim:par presentation:node-type="timing-root">
    <anim:seq presentation:node-type="main-sequence">
      <anim:par smil:begin="next">
        <anim:par smil:begin="0s">
          <anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="on-click">
            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="id1" smil:attributeName="visibility" smil:to="visible"/>
            <anim:transitionFilter smil:dur="0.5s" smil:targetElement="id1" smil:type="irisWipe" smil:subtype="rectangle" smil:direction="reverse"/>
          </anim:par>
          <anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="with-previous">
            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="id1" smil:attributeName="visibility" smil:to="visible"/>
            <anim:transitionFilter smil:dur="2s" smil:targetElement="id1" smil:type="irisWipe" smil:subtype="diamond" smil:direction="reverse"/>
          </anim:par>
        </anim:par>
	<anim:par smil:begin="2s">
          <anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="after-previous">
            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="id1" smil:attributeName="visibility" smil:to="visible"/>
            <anim:transitionFilter smil:dur="2s" smil:targetElement="id1" smil:type="fourBoxWipe" smil:subtype="cornersIn"/>
          </anim:par>
        </anim:par>
      </anim:par>
      <anim:par smil:begin="next">
        <anim:par smil:begin="0s">
          <anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="on-click">
            <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="id1" smil:attributeName="visibility" smil:to="visible"/>
            <anim:transitionFilter smil:dur="0.5s" smil:targetElement="id1" smil:type="blindsWipe" smil:subtype="horizontal"/>
          </anim:par>
        </anim:par>
      </anim:par>
    </anim:seq>
</anim:par>

Interactive Animations

Todo

API

Todo

Personal tools