Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Welcome to the asblender wiki!
ASBlender is an Actionscript 3 library to read Blender .blend files.
See blender-file-format for an explanation of the .blend format.
The .blend format contains all C-structures used, which are defined in the so called DNA. This way .blend files are fully backward compatible.
Check out the DNA of a Blender 2.48 .blend.
ASBlender simply maps these structures to AS3 Object’s. This means there are no “blender” classes like “BlenderScene” in this library. Everything is an
This means that using this library requires some basic knowledge on the inner workings of Blender. So the learning curve can be rather steep. Its up to you to do something with the data. ASBlender simply provides you the .blend data.
But if your goal is to import simple .blend’s containing a single mesh, the examples below should get you going pretty fast.
- Main.as for a simple implementation.
- PapervisionTest.as for a simple Papervision implementation. See the compiled swf here.
- First you need the create a
ByteArrayby loading a .blend file or by using
- Create a BlendFile object:
var blend:BlendFile = new BlendFile();
- And read it:
blend.read( theByteArray );
All scenes in the .blend are read by default, you can access the scenes contained in the .blend thru
var scenes:Array = blend.scenes.
Blender can contain more then one Scene, but its likely there’s only one.
Note that I’m still learning how all these structures stick together. More example code will follow as my knowledge increases.