Help with Novice hack
I created a crude Python script that took an svg drawing, created a bunch of copies with sequential numbering(000001.svg 000002.svg etc) and then the script modified elements within each frame. I then converted them to PNGs to in turn become an animation via Mencoder.
Although my program works, it's still pretty much junk because it is such pain to use. I am teaching myself C/C++, I I thought I would try to redo it in C or C++ for programming practice and hopefully improve it as well.
So to get to the point(sorry for the ramble) I was wondering if there is a standard C or C++ library (XML based I guess?)that Inkscape uses for SVG manipulation? On the of chance that my coding yields something useful I love to share it, so I might as well start with something that is already being used.
Finally I am also not very good at Javascript. I was thinking that I could write a javascript program to refresh a browser so that each svg frame would be displayed in turn to preview the coming animation, transforming the SVG frames to PNGs is a pain. Does anyone know a javascript function that would help achieve this?
Sorry if these questions are dumb....
-Patrick
SleeplessDad wrote:
I was wondering if there is a standard C or C++ library (XML based I guess?)that Inkscape uses for SVG manipulation?
Most of Inkscape's SVG-related code is 'homebrew' - we are not using any external library. However, you might look at libxml2 / libxml++ (which is used for XML parsing), libcroco (we use a fork of it to process CSS) or librsvg (which is an unrelated SVG rendering library, though it doesn't allow manipulating the rendered SVG).
Finally I am also not very good at Javascript. I was thinking that I could write a javascript program to refresh a browser so that each svg frame would be displayed in turn to preview the coming animation, transforming the SVG frames to PNGs is a pain. Does anyone know a javascript function that would help achieve this?
I'm not 100% what you want to do, but the proper way would be to animate the SVG with Javascript, so that it does the job of the Python script. However Inkscape can't help you with this, as it doesn't have animation features yet.
Regards, Krzysztof Kosiński
Hi Patrick,
Finally I am also not very good at Javascript. I was thinking that I could write a javascript program to refresh a browser so that each svg frame would be displayed in turn to preview the coming animation, transforming the SVG frames to PNGs is a pain. Does anyone know a javascript function that would help achieve this?
you could have a look at the JessyInk (http://code.google.com/p/jessyink/) code for starters. It's not written for free-style animation, but rather for online presentations. However, it uses animations for slide transitions and effects and might provide you with some clues how to achieve what you want to do.
Cheers, Hannes
participants (3)
-
Hannes Hochreiner
-
Krzysztof Kosiński
-
Patrick