[Libreoffice] [GSoC 2012][svg export filter] support of 'dur' attribute for time containers

Marco Cecchetti mrcekets at gmail.com
Wed Jun 20 14:17:01 PDT 2012


Hi everybody,
I'm working on the Impress presentation engine that is an
implementation of a subset of the SMIL spec document.
At present for what I can see the active duration for a time
container such as <seq> and <par> is always defined implicitly by
the active durations of its children.
Lately I performed a test to see what happens if we define the 'dur'
attribute for a time container explicitly:

<par begin="0s" dur="1s" fill="hold" node-type="on-click"
      preset-class="entrance" preset-id="ooo-entrance-fly-in"
      preset-sub-type="from-left">
      <set begin="0s" dur="0.004s" fill="hold" targetElement="id11"
           attributeName="visibility" to="visible"/>
      <animate dur="2s" fill="hold" targetElement="id11" attributeName="x"
               values="1+width/2;x" keyTimes="0;1"/>
      <animate dur="2s" fill="hold" targetElement="id11" attributeName="y"
               values="y;y" keyTimes="0;1"/>
</par>

As you can see I set the time duration of the <par> time container
to the half of that of its children. In order to get such a setting
I edited the exported svg document manually. (Editing the odp file
is more annoying.)

So what happens when the presentation engine plays such an animation ?
Well, the rectangle moves only by half the length it moves normally
but after millisecond it jumps to its end position all together:


normal animation:

     0s                                                 2s
---------          continuous translation           ---------
|       | --------------------------------------->  |       |
---------                                           ---------


with dur=1s on <par>

      0s                      at 1s              at 1.001s jumps here
---------   continuous    ---------                 ---------
|       | --------------> |       |                 |       |
---------                 ---------                 ---------


The correct behavior, as required by SMIL spec, is:


      0s                      at 1s
---------   continuous    ---------
|       | --------------> |       |
---------                 ---------


at least when fill="hold".

The final jump is due to the fact that the "deactivate" method of
an animation node invokes the managed activity "end" method that
in turn calls "performEnd" which evaluates the animation by passing
the final time value (usually 1.0, or 0.0 if the animation is
reversed).

By commenting out the call to the "performEnd" method the duration
attribute on the <par> time container is handled correctly and
I can't see any side effect for usual animations.

However I'm wondering if it is worth to perform such a modification
in order to be more conforming to SMIL when such a feature is never
used. Moreover even if I can see no side effect by removing the call
to the "performEnd" method, I'm also sure that has been placed there
for some good reason (can anyone help me here ?)

The motivation that lead me to investigate such a subject is that
I'm implementing support for the repeatCount attribute for time
containers (at least when the attribute value is an integral number)
and I was evaluating the possibility to support such a feature also
when the duration attribute is defined explicitly, but of course
in order to get it working the duration attribute for time containers
has to be handled correctly.

Any hint is welcome.


Cheers,
-- Marco


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the LibreOffice mailing list