Inkscape for animation

General discussions about Inkscape.
MVision
Posts: 10
Joined: Wed Nov 28, 2012 4:22 pm

Inkscape for animation

Postby MVision » Wed Nov 28, 2012 5:00 pm

Hello everyone. I am new to Inkscape and only had a couple of months to learn it. I have to say, I love this program! I found it whilst I was looking for a free Illustrator alternative and was surprised to discover such a high quality application. I can combine it seamlessly with blender now that I learned more about svg files. Here are some of my first Inkscape creations.

https://www.youtube.com/watch?v=VL_Q77bG-yE
https://www.youtube.com/watch?v=tJG_uGt ... ature=plcp
https://www.youtube.com/watch?v=EN7Y0mU ... ature=plcp


This is an awesome product. With blender I can interpolate the svg models, but I feel that I am ready for more complicated animations now. Does anyone know of any free frame by frame or “traditional” animation software.

User avatar
brynn
Posts: 9446
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Inkscape for animation

Postby brynn » Thu Nov 29, 2012 9:44 am

Image
Welcome to InkscapeForum!

I know a lot of people have used GIMP for frame animation, and I have too. But it's a raster editor, and limited to GIF animation. Options for animating SVG images are fairly limited. Here's some info that I've seen around: http://wiki.inkscape.org/wiki/index.php/SVG_Animation, and http://srufaculty.sru.edu/david.dailey/ ... htm#JSAnim. I can't find my link anymore, but somewhere in the Inkscape wiki is info on using SMIL with Inkscape (http://wiki.inkscape.org/wiki/index.php/Inkscape). And finally, I've heard some good things about Synfig, although it may still be fairly early in its development. I haven't looked at the site in a while, and neither am I sure whether it uses frames for animation. But you can have a look: http://www.synfig.org/cms/

MVision
Posts: 10
Joined: Wed Nov 28, 2012 4:22 pm

Re: Inkscape for animation

Postby MVision » Fri Nov 30, 2012 1:35 am

Thanks for the reply! :D

I checked out Synfig once, but I didn't really understand it.

Gimp however, looks pretty promising. I will definitely try it out later.

User avatar
brynn
Posts: 9446
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Inkscape for animation

Postby brynn » Fri Nov 30, 2012 5:39 am

Gimp will only animates GIFs, and not SVGs. But if you're looking for GIF animation, there are LOTS of programs out there!

MVision
Posts: 10
Joined: Wed Nov 28, 2012 4:22 pm

Re: Inkscape for animation

Postby MVision » Fri Nov 30, 2012 2:07 pm

I just read a little about SMIL. It looks pretty neat. Is it comparable to flash and is it as versatile. As for frame by frame animation, since gimp only saves Gifs, I might as well upload each frame into Blenders video sequencer. It's not that efficient, but it should get the job done.

MVision
Posts: 10
Joined: Wed Nov 28, 2012 4:22 pm

Re: Inkscape for animation

Postby MVision » Fri Nov 30, 2012 2:34 pm

Another question. If I do animate an SVG image, can it be exported as a common video file?

User avatar
brynn
Posts: 9446
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Inkscape for animation

Postby brynn » Fri Nov 30, 2012 11:28 pm

These last couple of questions are beyond my understanding. I should probably buckle down and finally learn how to make these internet videos, such as on YT, one of these days. But surely others know more than I do :D

Jelle
Posts: 78
Joined: Sat Nov 06, 2010 11:25 am

Re: Inkscape for animation

Postby Jelle » Sat Dec 01, 2012 4:00 am

Hello Mvision,

Using SMIL you can create both framebased and time based animations with SVG. It took me a week to figure out how exactly to do that while teaching university students about SVG so maybe I can shorten the time a bit for you.

The first thing you should realise is that it is better to separate the objects you want to animate with the animation logic. The way to do that is by using the <use xlink:href="filename.svg#objectName"> method to call the graphical objects from an external file. You should create 2 svg files rather than one big one. That way you can easily edit the graphics in Inkscape and the logic file with the SMIL in Notepad++ or Emacs for instance.

What you would end up with is something like this example of the logic file that I made for the course.

Code: Select all

<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

<title>SVG Animation</title>

<defs>
<!-- First we need to declare the frames we use, as we cannot expect our browser to be able to load the objects from an external file during runtime.
So we <use> the frames we create in the inkscape file and give them the same id as in the Inkscape file, just so we can easily read our code and know
what frame is used frrom the Inkscape file
That way we have a clear relation to what's in the code and what is in the Inkscape file
-->
<use id="frame1" xlink:href="frame_anim.svg#frame1" />
<use id="frame2" xlink:href="frame_anim.svg#frame2" />
<use id="frame3" xlink:href="frame_anim.svg#frame3" />
<use id="frame4" xlink:href="frame_anim.svg#frame4" />
<use id="frame5" xlink:href="frame_anim.svg#frame5" />
<use id="frame6" xlink:href="frame_anim.svg#frame6" />
<use id="frame7" xlink:href="frame_anim.svg#frame7" />
</defs>



<g display="none">
<!-- Here we use the frames we declared in the <defs>
     and make them display at the end of the previous event, for a certain time (dur="0.1s")
    in this case I declared 16 frames for a total of 1.6 seconds
-->
 <use xlink:href="#frame1" display="none">
 <set id="f1" attributeName="display" attributeType="xml" to="inline" begin="fs1.begin" dur="0.1s" />
 </use>
 <use xlink:href="#frame2" display="none">
 <set id="f2" attributeName="display" attributeType="xml" to="inline" begin="f1.end" dur="0.1s" />
 </use>
 <use xlink:href="#frame3" display="none">
 <set id="f3" attributeName="display" attributeType="xml" to="inline" begin="f2.end" dur="0.1s" />
 </use>
 <use xlink:href="#frame4" display="none">
 <set id="f4" attributeName="display" attributeType="xml" to="inline" begin="f3.end" dur="0.1s" />
 </use>
 <use xlink:href="#frame5" display="none">
 <set id="f5" attributeName="display" attributeType="xml" to="inline" begin="f4.end" dur="0.1s" />
 </use>
 <use xlink:href="#frame6" display="none">
 <set id="f6" attributeName="display" attributeType="xml" to="inline" begin="f5.end" dur="0.1s" />
 </use>
 <use xlink:href="#frame7" display="none">
 <set id="f7" attributeName="display" attributeType="xml" to="inline" begin="f6.end" dur="0.1s" />
 </use>
 <use xlink:href="#frame6" display="none">
 <set id="f8" attributeName="display" attributeType="xml" to="inline" begin="f7.end" dur="0.1s" />
 </use>
  <use xlink:href="#frame5" display="none">
 <set id="f9" attributeName="display" attributeType="xml" to="inline" begin="f8.end" dur="0.1s" />
 </use>
  <use xlink:href="#frame4" display="none">
 <set id="f10" attributeName="display" attributeType="xml" to="inline" begin="f9.end" dur="0.1s" />
 </use>
  <use xlink:href="#frame3" display="none">
 <set id="f11" attributeName="display" attributeType="xml" to="inline" begin="f10.end" dur="0.1s" />
 </use>
  <use xlink:href="#frame2" display="none">
 <set id="f12" attributeName="display" attributeType="xml" to="inline" begin="f11.end" dur="0.1s" />
 </use>
  <use xlink:href="#frame1" display="none">
 <set id="f13" attributeName="display" attributeType="xml" to="inline" begin="f12.end" dur="0.1s" />
 </use>
  <use xlink:href="#frame2" display="none">
 <set id="f14" attributeName="display" attributeType="xml" to="inline" begin="f13.end" dur="0.1s" />
 </use>
  <use xlink:href="#frame3" display="none">
 <set id="f15" attributeName="display" attributeType="xml" to="inline" begin="f14.end" dur="0.1s" />
 </use>
  <use xlink:href="#frame2" display="none">
 <set id="f16" attributeName="display" attributeType="xml" to="inline" begin="f15.end" dur="0.1s" />
 </use>
 
 
 <!-- This is the piece of code to repeat the whole sequence in the scene
 we create an event with the id "fs1" and set the display to "inline"
 our whole sequence has 16 frames of 0.1 seconds length
 as we tell "fs1" to begin when "fs2" ends in the second iteration, we have to start our second "fs1"  at "-1.6s" or it will take "1.6" seconds before our animation starts.
 If your animation sequence takes longer, you'll have to add the total amount of time together and change the timing, or it will be out of sync.
 The same apllies for all durations used. If you change the total amount of time, make sure to change the duration.
 -->
 <set id="fs1" attributeName="display" attributeType="xml" to="inline" begin="0s; fs2.end-1.6s" dur="1.6s"/>
 <set id="fs2" attributeName="display" attributeType="xml" to="inline" begin="fs1.end" dur="1.6s"/>
 </g>


</svg>

Jelle
Posts: 78
Joined: Sat Nov 06, 2010 11:25 am

Re: Inkscape for animation

Postby Jelle » Sat Dec 01, 2012 4:05 am

On the second question,.. hmm,.. I never tried exporting SVG animation to video, but yeah.. Using a screen capture application should do the trick. Just run the SVG code in Opera (best SVG support) or Firefox and capture the part of the screen that you want to turn into video.

User avatar
flamingolady
Posts: 621
Joined: Wed Jun 10, 2009 1:40 pm

Re: Inkscape for animation

Postby flamingolady » Sat Dec 01, 2012 8:42 am

While some of this is really over my head, for basic animation, I've seen (and had done a basic one way back when) YouTube tuts where the design was all done in Inkscape. I think they interpolated some of the effects to show movement (of feet, arms, etc on a walking person, it was a stick person), then once they had all of the frames needed, they exported it (as pngs) to Gimp, and completed the animation there. I remember a youtube tut on doing a greeting card that opens too.

Jelle
Posts: 78
Joined: Sat Nov 06, 2010 11:25 am

Re: Inkscape for animation

Postby Jelle » Sat Dec 01, 2012 7:49 pm

Flamingolady, all,

What you describe actually is not that different from what I'm doing in the example. You basically create an animation from 7 frames and repeat that 16 times. Then you repeat it again ad infinitum. So what you would need to do to make this animation work is create a file called frame_anim.svg in Inkscape, make 7 objects in different phases of the animation and give them the id frame1 to frame7. That would give you a basic animation to play with.

Using this way you can make a library of frame animations that you create in Inkscape and then animate them in a file that contains the logic.

<use xlink:href="#frame3" display="none">
<set id="f11" attributeName="display" attributeType="xml" to="inline" begin="f10.end" dur="0.1s" />
</use>

What happens here is simple we use an object and set the display to "none" so it will not show until it has to. For that we use the SMIl command set that we give an id "f11", so we can refer to it later. We want it to show at the end of the previous frame, so at "f10.end" for a period of 0.1 seconds. For that we have to set the XML attribute "display" to "inline" for the duration.

If we give the name of the group (first <g> tag in the code) that the animation sequence is in an id as well, you can then reuse the whole thing as a sequence, that you can reuse in a later scene that you can build with the same basic structure.

MVision
Posts: 10
Joined: Wed Nov 28, 2012 4:22 pm

Re: Inkscape for animation

Postby MVision » Tue Dec 04, 2012 5:06 am

THANK YOU. :D

Jelle, thanks for kinda clearing things up for me. It appears that SMIL animation has the potential to be very powerful. So why was it so hard for me to come across it? Had I known it existed a month or two ago, I probably would have grown accustomed to it by now. I will start learning SMIL coding as soon as I am through with my current project though. Thanks again.

User avatar
brynn
Posts: 9446
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Inkscape for animation

Postby brynn » Fri Dec 07, 2012 8:43 am

I just ran into this at google+ site: http://davidsbigthoughts.blogspot.com/2 ... ite-1.html There's a whole series of articles. I didn't read yet, so can't give a preview for you. But looks interesting :D


Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest