SWF python export script for Blender.
THIS IS VERY BASIC RIGHT NOW!!
PLUS THIS IS WINDOWS ONLY!! (Because we get more
stuff :))
You MUST have the Flash plug-in to see the small videos. Please wait for animations to load...the *.py code is below!
Blender Logo (somewhat) 85Kb animation: And Basic Cube (8Kb):
Also to use the script, make sure you have Python 2.0 installed as well!
These shockwave movies were made using a python script to export the mesh data out to the SWF file format. The python script makes use of two main tools: the Bukoo ActiveX SWF control, and the Python Win32 extensions. The Bukoo control can be found at http://bukoo.sourceforge.net and the Win32 extensions are at http://www.activestate.com/Products/ActivePython/win32all.html . Simply download the bukoo control, and install it by using RegSvr32. Then download win32all and install it. This is nice anyway because it gives you a nice windows python editor you can use, as well as sets up your PYTHONPATH environment variable correctly. One MORE THING YOU MUST DO: After you have installed both products (equal to about 3.6 or so megs) RUN PYTHONWIN, the windows python editor, and go to the menu option "TOOLS" and go to "COM Makepy Utility". This will come up with a box showing all the COM objects on your system. Select the object named "swfobjs 1.0 type library" and click OK. PythonWin will now compile a *.py file to represent this COM object so it can be called from python. Now you can use my script no problem. You may however, want to edit my filenames, since I was just testing things.
SWF export script for Blender..HERE.(very
basic right now)
Demo file with Blender logo : HERE
This script is very basic right now. IT ONLY DOES
WIREFRAME AT THIS TIME! Please do not complain that it is "slow" or
doesn't do fills, etc, etc. It could be optimized of course, I do not claim to
be a math genius. And fills can be performed but two things stand as problems:
The SWF bukoo control refuses to fill a multiple poly object, which means all
faces would have to be seperate objects (which is okay, because , what if they
have different colors on each face) but this adds to the SWF file size. Also, to
show them correctly then you would need to do z-sorting or something similar. I
haven't gotten around to doing this yet obviously (The z-sort, which is why I
haven't added poly color fills yet). Of course, removing faces which cannot be
seen by using z-sort or hidden surface removal would also improve the file size
(make it smaller). PLUS the view is NOT based off the camera right now. This can
also be easily added too, however. I just don't have time right now - too many
other things going on.
This script will handle cube and triangle
faces. I have ran into some problems with text objects, however. I'm not sure
why just yet. You should be able to create almost any low-poly model and
export it. TO USE THIS SCRIPT:::: Start a new blender file, and throw in or
create a nice model you want to use, and animate it however you like. THE SCRIPT
ACTS as though you are looking down on the object (NUMPAD 7 ). SO animate
it from that point of reference. It also uses 0,0,0 as the centerpoint right
now. (I TOLD YOU IT WAS BASIC!) . The camera DOES NOT affect the
output at all. NOW simply name your object "Cube", load in the SWF
export script in a text window, and press ALT+P in the text window to run
the script. If your SWF control and win32all were installed properly, you will
get a nice exported SWF movie of the mesh...A FEW OTHER NOTES: The script uses
the window size defined in the RENDER buttons window for X and Y, and it uses
the EndFrame number in the bottom of the Render buttons window (SO, setting just
leave start at 1, but set END to the actual end of your animation. Just use
end:1 if you want a single still frame).
Enjoy the power of Python combined with COM!
Nikolatesla20.....