defold-blender-export
A Blender export system for the Defold game engine.
Setup Notes
There are no exhaustive documents for this tool yet. Its just not complete, so everything is very much 'in flux'.
Note: The Sync Tool is now a Blender Only addon. This makes building Defold resource collections much simpler.
To use the tool follow the guide below.
- Copy the blender/addons/sync_tool folder to the blender addons folder. See blender docs for this.
- Or.. you can copy the blender/addons/sync_tool/* files into the folder where your blender source file is, and the scripts should work from there.
- Open the blender file you want to work in (or open the test.blend to see an example already setup)
- Open the text editor in blender and loadin in the script "defoldSynUI.py"
- Run this file. You should see "bpy.ops.text.run_script()" in the Info Window in blender.
- Open the 3D layout window in blender and ensure you are in "Object Mode".
- Examine the Tools menu on the right side of the Layout 3D View (see below)
- Enter the appropriate properties for Scene Name and Directory (project directory to save into).
- Select "Sync Build" for the scene mode and press the "Sync Scene" button when ready.
A folder will be created in the target project directory with all the resources needed to load the scene into Defold.
At a minimum you should see a collection file and some gameobjects (in the gameobjects folder). You can open this project and open the collection. While the "Sync" tickbox is enabled, data will be written to the collection file - do not save new objects into it while Sync is on - they will be overwritten. Sync can be unticked at any time and the data will stop pushing to the collection.
Once this is setup you can add/edit the blender scene as you need and any Sync's you do, will update the meshes, textures and object positions in Defold.
Issues
There are a number of odd issues using this system. It is early days, so they will be ironed out. Some limitations on what Blender can stream:
- Only single texture for each object is used (this is a Defold thing).
- Object materials only use model materials at the moment. This might change to PBR materials.
- Lights and Camera are added in Defold, but they are not yet setup to operate correctly (TBD)
- Many features are only partially functional. Tread carefully :)