A blender import/export system for Defold

Overview

defold-blender-export

A blender import/export system for Defold

Setup Notes

There are no exhaustive documents for this tool yet. Its just not complete, so everything is very much 'in flux'. To use the tool follow the guide below.

  1. Copy the blender/scripts python files to the blender plugins folder. See blender docs for this.
  2. Or.. you can copy the python scripts into the folder where your blender source file is, and the scripts should work from there.
  3. Open the blender file you want to work in.
  4. Open the text editor in blender and loadin in the script "defoldExportMeshes.py"
  5. Run this file. You should see "bpy.ops.text.run_script()" in the Info Window in blender.
  6. Open the 3D layout window in blender and ensure you are in "Object Mode".
  7. Press F3 and type "Defold". You shoul see the words "Start Defold Server" - press enter or select the command and it will run.
  8. You should see "bpy.ops.defold.serverstart()" in the Info Window in blender.

Blender is now setup and serving data streams. Now the Sync Tool needs to be run.

Open and then run the Defold project in the defold/sync-tool folder. You should be viewing the config tab for the sync-tool

  1. Fill out the project path for where you want the Blender sync to write to. Make sure this is a Defold folder project path (where a project file exists).
  2. Set the collection name you want to use.
  3. Press the "Connect Localhost" button.
  4. Press the Active Streams tickboxes for Scene and Meshes

After doing the above, data will be getting sent from Blender to the SyncTool. You can check this is the case by looking at the Log (there should be entries in it) and examining the Blender Data tab panel where there should be Meshes and Objects that you can examine. If your Blender scene is empty, you may not see anything, so go and add a Cube! :)

Now select the Sync tickbox. Data will now be getting written into the folder you sepcified. Depending on the type of object you have in Blender, will depend on what data will exist the project folder.

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 :)
Comments
  • The addon just don't work

    The addon just don't work

    I properly set up everything, gave admin permission to both blender and the interpreter, but still, when I click to sync it doesnt do anything. Thats my scene: image

    opened by Caue-Aron 3
  • Support multiple UV coords

    Support multiple UV coords

    Based on discussion here with Ivan_Lytkin: https://forum.defold.com/t/building-a-sync-tool-for-blender-to-defold/69920

    Potentially add a new stream for texcoord1 in the buffer files. This could allow multiple coord access in the material.

    To be tested.

    opened by dlannan 2
  • Alpha channel in Blender BSDF mapped to Albedo texture

    Alpha channel in Blender BSDF mapped to Albedo texture

    Now that tools are available to merge texture channels together to minimise the number of samplers in the Simple PBR shader, it is planned to add the Alpha channel in blender bsdf material into the output Albedo alpha channel. This will produce more consistent alpha sync results without the need for render script changes.

    enhancement 
    opened by dlannan 1
  • Add error reporting and logging

    Add error reporting and logging

    Due to requirements for correct scene and material construction to have a successful export, I need to add some logging and reporting so users can determine what issues there might be. image

    This has been added. Included this issue so that I can track specific enhancements.

    enhancement 
    opened by dlannan 0
  • Remove root rotation for Defold world space transform.

    Remove root rotation for Defold world space transform.

    The current sync tool adds a root node with a rotational transform to get the Blender world space into the Defold world space.

    The problem with applying a complete transform is animations and some object hierarchies. I need to spend some time make a suitable solution (preferably in the lua side of things) to do this vertex + object + anim transform correctly.

    The current system is not ideal because images may come out flipped on a surface (due to the rotation).

    enhancement 
    opened by dlannan 0
  • Simple PBR lighting

    Simple PBR lighting

    The lighting in Simple PBR is essentially the same as the Defold default model lighting - very rudimentary. It is intended that up to 4 dynamic lights are supported. With possibly Point, Spot and Directional types supported.

    This issue is to research some of this and maintain documentation on the process. The solving of this feature will be needed before shadows and some GI solutions are attempted.

    enhancement 
    opened by dlannan 1
  • Split animations into per action dae's with no meshes.

    Split animations into per action dae's with no meshes.

    The current animation export is messy and can be difficult to get right with multiple animations within a scene. The goal is:

    • Output meshes individually. And identify animated meshes. These will be tagged as "Defold models" but still use a mesh buffer.
    • Detect all animation actions and save them out as animation only dae files containing only the skeletons and the skins. No meshes.
    • Export script info (into the meta data table) that allows easy access to available animations, and how to play them (maybe with correct timing and configs too).

    Once complete, it should allow multiple animations in a scene to be easily exported to Defold and easily run in Defold.

    enhancement 
    opened by dlannan 1
Releases(v1.3.1)
  • v1.3.1(Nov 2, 2022)

  • v1.3.0(Oct 29, 2022)

    A sizable upgrade. Including new LightMapping capabilities.

    Features:

    • LightMapper support (with modifications)
    • General Blender LightMap support.
    • New PBR Lightmap material for Defold.
    • Lightmap and Simple material support in the same scene

    Details on the forum about the new features.

    Source code(tar.gz)
    Source code(zip)
    defender.zip(1.58 MB)
  • v1.2.0(Sep 20, 2022)

    Thanks to Aronimo and Makaber for all the testing and digging a Windows issue has finally been resolved (hence 1.2)

    • Windows utf8 to wide char support in file paths.
    • Some cleanup in the code.

    OSX and Linux have not been heavily tested with this release. Debian 11 seems ok so far (need to add some auto tests).

    Source code(tar.gz)
    Source code(zip)
    defender.zip(1.53 MB)
  • v1.1.1(Sep 3, 2022)

    Added new logging system which begins to provide feedback to the user about scene related issues. Currently supports:

    • Material type checking
    • Collection checking (for existence)
    • Luajit permissions levels (reports where file cannot be executed from).
    • Outputs log report that can be sent to me.

    The main aim of the logging is to catch more and more anomalies that are unsupported in Blender when converting to Defold.

    Source code(tar.gz)
    Source code(zip)
    defender.zip(1.49 MB)
  • v1.1.0(Aug 28, 2022)

    Release supporting incoming changes to Defold for support with gltf and glb mesh and animation data.

    • Added selection for gltf and glb
    • Added updates to export gltf and glb
    • Minor bug fixes for mesh construction
    • Change to new name Defender
    Source code(tar.gz)
    Source code(zip)
    defender.zip(1.49 MB)
  • v1.0.8(Apr 13, 2022)

  • v1.0.6(Mar 16, 2022)

    New fixes for Windows platforms.

    • Pathing was broken on both the blender python side and lua export side.
    • Fixed a number of issues with catching script errors.

    Working on OSX and animation action naming (multiple daes per model - 1 for each action).

    Source code(tar.gz)
    Source code(zip)
    sync_tool.zip(1.36 MB)
  • v1.0.5(Feb 28, 2022)

    Added a new automatic creation of an alpha channel from the Blender Alpha channel in Principled BSDF materials. Important notes of this new feature:

    • If the base color has an alpha channel, and you want to use that, set the Alpha channel to 1.0 value.
    • If you use an Alpha of anything other than 1.0 without a texture then the whole alpha for the material will use that value.
    • To set an alpha mask, simply add it as a texture to the material Alpha channel.

    Alpha textures must be greyscale or all the rgba channels are the same. When merged with the base color, the alpha is merged into a single 8 bit channel for Defold.

    Source code(tar.gz)
    Source code(zip)
    sync_tool.zip(1.34 MB)
  • v1.0.4(Feb 26, 2022)

    Release notes:

    • New ao + metallic + roughness map (as per Khronos GLTF PBR)
    • Fixes to pbr simple material params
    • Bug fixes
    • New png texture merging tools. This will allow alpha merge from alpha channel into the Albedo + Alpha texture (TBD)
    Source code(tar.gz)
    Source code(zip)
    sync_tool.zip(1.34 MB)
  • v1.0.3(Feb 23, 2022)

  • v1.0.2(Feb 22, 2022)

  • v1.0.1(Feb 22, 2022)

  • v1.0.0(Feb 22, 2022)

    Release 1.0 Initial module release for Blender 2.8 and above. Follow install guide on github. Main features:

    • Sync static meshes with hierarchy
    • Sync directly to a Defold project folder
    • Support Animation
    • Lights and Camera - early support
    • Meta Data supported
    • Builtin model material
    • Custom Simple PBR material

    Note: Uses luajit to execute scripts. See install guide.

    Source code(tar.gz)
    Source code(zip)
    sync_tool.zip(1.16 MB)
Owner
David Lannan
David Lannan
Integrate the ZENO node system into Blender for creating robust physics animations!

ZenoBlend Integrate the ZENO node system into Blender for creating robust physics animations! End-user Installation Goto Release page, and click Asset

Zenus Technology 36 Oct 28, 2022
A simple Defold extension to get the project root dir when running from the editor

Defold Project Directory extension This is a small native extension that makes it so that you can get the project directory of a game that is being ru

Marius Petcu 2 Oct 2, 2021
ZzFX extension for Defold

ZzFX Defold Extension Zuper Zmall Zound Zynth ZzFX Sound Designer Port of ZzFX for the Defold Game Engine WIP Pending release while I work through som

Justin Walsh 8 Nov 22, 2022
Defold Math eXtention Library that avoids allocations

A re-imagining of vmath functions that avoid allocations by taking the output as the first argument instead of returning a new Vector3, Vector4, or Quat requiring an allocation.

Justin Walsh 16 Nov 9, 2022
ZzFX extension for Defold

ZzFX Defold Extension Zuper Zmall Zound Zynth ZzFX Sound Designer Port of ZzFX for the Defold Game Engine Defold Setup Open your game.project file and

Justin Walsh 8 Nov 22, 2022
Defold Engine integration with Yandex.Metrica to track your games on Yandex.Games.

Yandex.Metrica for Defold Yandex.Metrica is a free of charge web analytics tool for websites, that's the reason why we can use it for HTML5 games. Yan

Indiesoft LLC 8 Nov 26, 2022
Blender addon for AutoRemesher by huxingyi

AutoRemesher Blender 2.8 Blender addon implementation of AutoRemesher by huxingyi. This implementation works on Windows 10 and Ubuntu. Install the add

null 75 Dec 2, 2022
A Blender 2.7+ plugin that exports sausage link characters with animations

Sausage64 Sausage64 is a plugin for Blender 2.7 onwards, which allows you to export "sausage link" style character models with animations. The plugin

Buu342 33 Dec 17, 2022
Windows 7 support for Blender 3.0

BlenderCompat Windows 7 support for Blender 3.0 Description This repository contains a compatibility DLL for running Blender 3.0 on Windows 7 and a pa

Alexandru Naiman 161 Dec 30, 2022
Blender is the free and open source 3D creation suite

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender 7.4k Jan 1, 2023
A Blender script to procedurally generate 3D spaceships

Spaceship Generator A Blender script to procedurally generate 3D spaceships from a random seed. Usage Install Blender 2.80 or greater: http://blender.

Michael Davies 7.3k Dec 30, 2022
The FLIP Fluids addon is a tool that helps you set up, run, and render high quality liquid fluid effects all within Blender, the free and open source 3D creation suite.

FLIP Fluids The FLIP Fluids addon is a tool that helps you set up, run, and render liquid simulation effects. Our custom built fluid engine is based a

Ryan Guy 1.4k Dec 22, 2022
Import of the DIY Dynamic Template v2, retrieved from the Internet Archive

Dynamic Templates This is a copy of the D*I*Y Planner Dynamic Template application that was posted to diyplanner.com/node/6210 back in 2009,

Trammell Hudson 21 Aug 7, 2022
api & source menu base import imgui from imgui-js

onetap v4 crack https://discord.gg/AXCtxVH4PB people asking me for otv4 source "bin2h" (meaning binary to hex) large hexadecimal array deleted all the

h4xr0x#1337 9 Sep 6, 2022
Vmpfix - Universal x86/x64 VMProtect 2.0-3.X Import fixer

vmpfix VMPfix is a dynamic x86/x64 VMProtect 2.0-3.x import fixer. The main goal of this project was to build correct and reliable tool to fix imports

Pavel 195 Dec 28, 2022
A gdnative plugin for Godot's UWP export to add xbox live integration

GodotXbox Current instructions for setting up DLL, steps to setup project for contributing/modifying are coming soon. It should be noted that Godot's

Cregg Hancock 37 Oct 31, 2022
📃 Export WeChat chat histories to HTML files.

wechat-export Export WeChat chat histories to HTML files. Preview This script generates a HTML file for each contact's chat history. Currently it supp

Zihua Li 607 Dec 15, 2022
Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Pavel Stehule 1.9k Jan 4, 2023
Pure Data patch export to lv2 plugin using heavy compiler + dpf example

Pure Data patch export to lv2 plugin using heavy compiler + dpf example Work in progress - Takes an audio input and writes to a 0.5 seconds buffers. 4

Qwrtst 3 Dec 27, 2022