Converting Glitch FLA assets to SVG: The story so far
So I've been working on a way to automate a conversion process from FLA to SVG so that I don't have to manually do each one. I've had some progress so far, but it's been a bit of a struggle, so I thought I'd detail the issues here in case some other poor sod has a giant pile of FLA files they need to convert to SVG and happens to find this blog entry.
For this process, you will need Adobe Flash Professional and Adobe Illustrator. This is not an endorsement of Adobe, their unstable products, their annoying and unnecessary proprietary formats, or their horrendously bad customer support; rather, I haven't been able to find a way to convert these files to SVG without using their software. The reason I'm doing this at all is so that people can get at the files in a vector format without depending on Adobe's products.
For the record, I'm using Adobe CS5.5, which I purchased back when it was possible to buy their software in a way that doesn't involve paying them every month for the privilege of continuing to use it.
So, here we go.
First, I opened Flash Professional and used jsfl scripting to make a script that loads all of the FLA files in a directory and converts them to an intermediate format called FXG. FXG is a file format created (and subsequently abandoned) by Adobe that is like SVG, but not SVG, so almost nothing can read it, except a couple of Adobe products, and even those sometimes barf on it (more on this later). I would paste my jsfl script code somewhere that people could get it, but I'm unsure of adobe's wonky licensing, so I'm not sure if I'm actually allowed to or not. Suffice it to say, I crawl through a selected directory, load each FLA file, save it to FXG with an undocumented function (way to go, adobe!), then close the file. It's really fairly simple code.
Next, having converted an entire directory of FLA files to FXG, I fire up Adobe Illustrator and run another script. This script loads all of the FXG files from a selected directory one by one and then either saves each file as SVG or crashes Illustrator. Once it crashed so hard that Firefox crashed too (no idea how that happened). After each crash, I move all of the successfully processed files to a different directory (plus the file that crashed it) and run the script again. This is in no way annoying or tedious, and I am in no way being sarcastic.
Then, I 7zip up the successfully converted files and upload them to OGA.
Thus far, I'm not sure how I'm going to handle exporting animation frames. I'll have to cross that bridge when I come to it.
An interesting side note: In my quest to find better ways to conver FXG to SVG, I discovered the most worthless web page ever made.
At any rate, if anyone else knows of a better way to convert an FXG file to SVG, I'd love to know. There's a little python script on github that tries to do it, but it's just not there yet and the converted files are useless.
A and a final note, to the Inkscape folks, if you're reading this: A couple of years ago, someone requested an FXG import/export function. It was determined that no one would ever want to use an FXG import function, so only export was implemented. I'd just like to point that at this point, there is no way to convert FXG->SVG without using expensive and crash-prone Adobe products. I realize time and developer resources are limited, so I'm not demanding that this be done; I'm just pointing out that it would be really helpful in some situations. :)
P.S. This should in no way be construed to be bashing the fine folks from Glitch who released all of these excellent assets into the public domain. You guys are awesome. :)
Q: But Bart, why don't you just call Adobe tech support?
A: I did that once. It took me four hours to get to a real person, and then they told me that I'd called the wrong line. I waited another several hours and finally gave up and posted an angry message on their forum, then received a reply for people who can't get through to their tech support line and post angry messages on their forum, saying that apparently I'd been forwarded to level 2 tech support. They eventually got back to me several days later during non business hours. I would rather stab my spleen with a rusty spork than deal with Adobe tech support again.
Q: Did you know there's a plugin for Adobe Flash that converts FLA directly to SVG?
A: I tried it. The results weren't usable.