Unfortunately there is not interface to know the last keyframe (or waypoint) of the document. There is not option rather than open the composition in Synfig Studio…
… or create a parser that opens the sif file and search for the last waypoint or keyframe…
carlos@pcnuevo:~/Animación/commandline$ grep 'keyframe' anim1.sif
<keyframe time="0f"/>
<keyframe time="1s 3f"/>
<keyframe time="1s 11f"/>
<keyframe time="1s 15f"/>
carlos@pcnuevo:~/Animación/commandline$
I’m not so good at bash language but I’m sure that it is possible to create a script that extract the latest keyframe. They are listed in order
-G
Thanks for the clue Genete!
I’ve just got it working correctly with the following command lines:
Extract and send to stdout the time of the last key frame:
REM contents of keyext.bat:
gzip -d -c %1 | grep "keyframe" | tail -n 1 | sed "s/.*\"\(.*s\)\( \)*\(.*f\)*\".*/\1\3/"
Render the animation properly using the retrieved information:
for /F "tokens=*" %%i IN ('call keyext.bat anim.sifz') DO SET KEYFRAME=%%i
"C:\Archivos de programa\Synfig\bin\synfig.exe" --start-time 0 --end-time %KEYFRAME% anim.sifz -o frame.png
Although we should recognise this is hardcore stuff
Probably this is something that can be done by default in further releases, don’t you think?
I learnt from one of those books called “teach yourself c++ in 25 days”, I started last week!
I must admit, I downloaded the code and took a look at it yesterday but preparing the environment to compile and develop is something that can take some time so I quit it
Ok, Whenever I had time i’ll try to make the fixes by myself, and send them to the comunity.
Thanks!