Godot: Joint effort to improve integration between Godot and Blender 2.8

Created on 29 May 2018  路  16Comments  路  Source: godotengine/godot

The Blender Foundation announced that the BGE developer Benoit Bolsee will lead work on a new real-time interactive mode for Blender 2.8 (note that BGE itself was removed from Blender for 2.8), and this includes to-be-defined cooperation with us to improve the Blender/Godot workflow.

In Ton Roosendaal's announcement, he mentions:

Related to this work is also to enable good support (export or some kind of integration) for external game engines such as Godot, Armory, Blend4Web, Unreal, Unity, etc.
I especially invite the first three (open source) projects to connect with us to find ways to keep a high level of compatibility.

No specifics are given yet on what this integration would be, and I think Blender expects us to help define it and work on it, so I'm opening this issue to gather our initial thoughts.

Blender devs are more than welcome to chime in too. If/when required, we could also move the discussion to another platform (code.blender.org or anything appropriate).


In parallel, it would be good to outline for Blender devs the current work that we have done already to improve the Blender/Godot workflow.

  • Godot's Collada Exporter, a Blender plugin that exports scenes to Collada with an implementation that works better for Godot than Blender's default exporter. I won't try to revive the heated debate about whether this implementation is actually better and should replace Blender's default one, the Collada ship has sailed and we're now focusing on the next two points. (This plugin gets maintenance support, but no real development).

  • glTF 2.0 support. Godot 3.0 implemented support for glTF 2.0, which is in our experience much superior to what Collada offers (and even proprietary exchange formats like FBX) for PBR materials. Having first class support for glTF 2.0 in Blender 2.8, and ensuring that the glTF 2.0 files output by Blender's exporter are well supported by Godot's importer would go a long way to improve the workflow. On our end we keep improving our importer when we hit glTF 2.0 features that we don't properly support.

  • Finally, the most promising effort so far on our end: a Blender to Godot export plugin, which aims at exporting Blender scenes directly to Godot's scene format, bypassing the need for an asset exchange format like Collada or glTF 2.0, and supporting as much of the common rendering features as possible. It is under heavy development, with @Jason0214 as GSoC student focusing on this project, mentored by @sdfgeoff and @reduz.

discussion thirdparty

Most helpful comment

With the Godot -> Blender exporter we will try to make use of as much blender data as possible. Converting cycles or Principled materials should be possible already I think.

What could be interesting, from Blender side, is to provide engines with a bit more information.. most likely what would be useful is stuff like:

  • Collision information, not just that a mesh is collidable, but also basic collision shapes (sphere, box, etc), etc.
  • Body information, whether something is rigid body, etc. maybe in a bit more engine friendly way
  • Navigation information, or something we can more or less use in nav-meshes

This would allow projects being worked on mostly by small teams to use Blender more as a design tool and just export their scenes with most of the work done to Godot.

All 16 comments

How about the other way, Godot -> Blender? Especially with CSG support in Godot, and the ability to generate meshes procedurally (SurfaceTool <3 ), it might be worth it to be able to open up a procedural mesh in Blender to make final touch-ups.

@Zireael07 I think that beyond the scope of this issue, or at least low-priority. The goal of Blender's realtime interactive mode is to have output that user can interact with, just like a game. It make more sense if we just focus to Blender -> Godot workflow.

The issue doesn't mention Blender's interactive mode, just 'integration with game engines' though.

I believe we should be able to create meshes as placeholder in Godot and then copy them in Blender and make it into a professional model later.

It would be fantastic if some kind of a workflow can be set up to launch (playtest) a godot project straight from blender - the way Armory, BDX,blend4web and other addons work!
https://github.com/GoranM/bdx
Just look at how well this addon is integrating lidgdx
https://youtu.be/gi3fpeaqMlk?t=17m13s
You can playtest, export games,everything without leaving blender

Of course godot as an addon for blender would be absolutely fantastic- in the addon preferences the user would need to specify the path to godot.exe of course. Or the addon could be bundled with godot and work out of the box?

@Zireael07 that is already mentioned here, last paragraph https://godotengine.org/article/godot-gets-csg-support

I don't mean only CSG, also SurfaceTool, but good catch!

Guys, this issue is for Godot and Blender devs to discuss the technical specifics of what this integration could be, not for end user feature requests...
Exporting CSG scenes will just be outputting a glTF 2.0 file usable in Blender or any other modelling program, it's out of scope of this issue.

Currently importing GLTF files means that they are saved as cycles materials but the exporter can't detect them.
E. g. it's easy to import models from Sketchfab using the plugin but it's not possible to edit them in Blender without deleting the materials.
https://github.com/ksons/gltf-blender-importer
https://github.com/KhronosGroup/glTF-Blender-Exporter

If we are sticking with glTF then the exporter needs some serious improvements cause at the moment it's mostly useless for material conversion and stuff.
Probably asking the Blender devs to help with it might be a good idea. Although it might be too much work, configuring the node conversion system.
I think the system would need to automatically bake the material and then export it to Godot using glTF nodes and baked textures.
Have little experience with creating addons in Blender. So I can be wrong but this seems like the simplest solution.

With the Godot -> Blender exporter we will try to make use of as much blender data as possible. Converting cycles or Principled materials should be possible already I think.

What could be interesting, from Blender side, is to provide engines with a bit more information.. most likely what would be useful is stuff like:

  • Collision information, not just that a mesh is collidable, but also basic collision shapes (sphere, box, etc), etc.
  • Body information, whether something is rigid body, etc. maybe in a bit more engine friendly way
  • Navigation information, or something we can more or less use in nav-meshes

This would allow projects being worked on mostly by small teams to use Blender more as a design tool and just export their scenes with most of the work done to Godot.

Navmesh generation in Blender will be a big help. With Blender's features it might be awesome way to create proper Navmesh for complex projects.

@reduz But does Blender even have collision information, and body information.? Has it ever had anything like that.

I would the ability to be able to import rigs since bones will be in Godot soon. But there shouldn't be a problem in that. Softbodies and some basic settings, too?

Collision information, not just that a mesh is collidable, but also basic collision shapes (sphere, box, etc), etc.
Body information, whether something is rigid body, etc. maybe in a bit more engine friendly way

@reduz @swarnimarun We needed the collision export at Simedis, so exporting physics properties was added really early. Temporarily documented here.

Similarly, exporting rigs was added by @Jason0214 recently, though it has some limitations currently.

Materials are currently extremely primitive (but the exporter does a search for matching blender->godot materials). @Jason0214 will be focusing on this after rigs/animations/morphs are done.


Simedis' intention is exactly as Reduz says: use blender as a design tool and export mostly-finished-assets into Godot. At this stage we don't do whole scenes (assets are assembled in Godot), but it would be nice.

At this stage the major thing to figure out is: what is the ideal integration. However, we have to realize that we do not want to rebuild the Godot GUI _inside_ blender. Thus the focus should be on getting things form blender into godot that can't be created inside godot. This includes exporting to godot:

  • model data
  • animation data
  • collision geometry
  • blender (cycles, eevee) materials into Godot materials
  • lighting data (including environment settings?)

These features are what the GSOC blender-exporter project focus' on.

Also good is anything that allows more complete previewing of this content inside the blender interface, such as:

  • Preview of godot materials on your blender objects while developing them (ie use godot renderer in blender's viewport - this is intended to be possible, see the 2017 blender conference keynote).
  • Physics behavior in blender animation simulation should be similar to that in a godot game

Possibly also:

  • Create tools for assigning godot-specific data such as:

    • nav-meshes

    • assigning scripts

      I've already tossed some code around, and adding these sort of tools shouldn't be too hard. There are some blender integrations for fallout/skyrim, and various workflow plugins for other engines that may be worth investigating.

  • Complex scenes with linked objects should be handled in a sane way (possibly into multiple files)

Tools to ease the use of this pipeline should also be considered:

  • Playing a game without needing to manually export (currently at Simedis we automate the build with Make and some semi-intelligent python scripts, but this is hard to set up on Windows).

    • Ability to start the game engine inside blenders interface and have your assets present.

    • Performance of the integration (if it takes 30 seconds to start the game, there is a problem)

We are also very excited about the prospect of even better integration between Blender and Unity, since we recently switched to Blender from 3ds max. We have experienced some problems exporting to gltf and getting the correct result in Godot, so this is definitely something that could use an improvement.

As of 2020 January, Godot Engine's glTF2 importer has greatly improved.

For Blender 2.83, there are patches to upgrade Blender's glTF2 import to match Godot Engine's compatibility. https://github.com/KhronosGroup/glTF-Blender-IO/pull/857

Blender 2.81 is able to be used in production too.

For any Blender developers that want some models and a project for stress testing, check out the TPS demo. I recently converted the demo to have the level geometry in multiple files, and I was able to export the level geometry as GLTF just fine (and it works better and takes up less space than Collada DAE by a significant amount).

However, I experienced issues trying to export models with animations to GLTF, so for the moment those are still Collada DAE in the repo. The model is broken when exporting from Blender and importing back into Blender, so it's Blender's fault. Any Blender developer is welcome to take a look at the TPS demo, including by using it to improve Blender's GLTF support, and you are also welcome to submit a pull request to the repo to convert those files to GLTF. It's also possible there are issues with the Blender files, I'm a Blender noob so I wouldn't know, so that's another reason why a PR would be helpful.

Was this page helpful?
0 / 5 - 0 ratings