Q: Why would you do this? Python is hard!
A: To learn more about the SWF format, and to try and make something that can comfortably used as part of a toolchain. If I want to make a cutie mark mod for all the adorable little ponies out there, I'm going to need to automate my workflow.
----------
Q: "Toolchain", whussat?
A: I use
Inkscape to draw the replacement shapes, and save them to a folder in .svg format. I can then run sdtmill on every shapes file in that folder to make a .swf mod file for each shape. I use other people's original mods as templates, and the fancy ActionScript bytecode in their files gets preserved by all of this.
Sure, it's a bit more complicated than that: in fact it's automated, but that's the gist of it. Using multiple tools one after the other maketh the toolchain.
----------
Q: How to I make the .swfml template file?
A: You don't have to do this, but it's the most convenient format for the template - i.e. some other guy's mod. It's a kind of XML, so you can edit it with a text editor and cut out bits you don't want.
I first decompile an original SWF mod to the swfML-full XML dialect:
swfmill swf2xml ORIGINAL.swf TEMPLATE.swfml
then I edit the .swfml file as necessary to discard any unwanted elements.
----------
Q: Is it possible to fuck up and make a broken .swf file with this tool
A: Yes. It's real easy. SwfML-full is not a forgiving format; it's a verbose XML dump of the terse, inflexible crap packed inside a .swf file. You need to understand how its internal references work even if you're just removing bits.
----------
Q: I'm just an artist, any hints?
A: Learn how to trial and error the position offsets if you're doing something new, and remember that shapes are often tilted even when the character is in her rest position. Split your SVG files into multiple layers, and put template images on one layer with a name that doesn't occur in the original mod. That way you can organize stuff, make nice SVG templates for other people to use, and the layers with the unique names won't make it into the output file.
swfmill does a surprisingly good job of converting SVG shapes to SWF ones, given how different the two vector formats are. Nevertheless, keep your shapes simple and vector-only for the best results.
----------
Q: You gonna make a tutorial or something, bruv?
A: Maaaybe.