godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Add support for importing and exporting `.blend` files #3529

Closed fire closed 2 years ago

fire commented 3 years ago

Describe the project you are working on

3d multiplayer game.

Describe the problem or limitation you are having in your project

Currently it takes 3-5 steps to go from Blender to Godot.

  1. Open blender
  2. Work
  3. Save as gltf
  4. Place the gltf file in the Godot Engine project directory
  5. Press save button

The reverse of gltf exporting is true too.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

This feature lets you drag or place .blend files in the project folder and it will import the files.

An editor setting sets the location of the blender binary. A empty setting means the feature is disabled.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

  1. Add an editor setting to define the Blender path.
  2. Set the editor setting so the file system browser works
  3. Open the blend file via the command line without a py.
  4. Save the blend as a gltf in the .godot/imported folder
  5. Open in gltf importer

Symmetrical steps for saving as blend.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Was an addon until Reduz asked for me to port it.

Is there a reason why this should be core and not an add-on in the asset library?

Reduz thought blend i/o should be core instead of an addon.

Calinou commented 3 years ago

Is exporting .blend files from Godot really needed? Isn't the Blender glTF importer good enough for most use cases?

fire commented 3 years ago

The goal of Blender import and export is to reduce the number of steps in the workflow. .blend import and export can all be done manually and is error prone.

Here's the reverse.

  1. Export as gltf from Godot Engine
  2. Open blender
  3. Open blender import dialog
  4. Find the gltf in the Godot Engine project folder
  5. Error prone settings managment on gltf import
  6. Press import
mrjustaguy commented 3 years ago

I think opening and saving .blend files in Godot actually makes a ton of sense if done right, as it is not totally uncommon for something to go wrong with Blender Exports, albeit much rarer these days, so having the option to open Blender's own files (sort of as a fallback) could help in such situations, instead of trying to figure out what went wrong and/or switching export file type in blender and hoping for the best.

ngreve commented 2 years ago

Being able to directly import a blend file and iteratively making Godot more compatible with Blender, would very likely be a massive advantage, compared to other game engines.

What I am looking for in particular, is a way to manipulate the geometry node inputs of a Blender model, from within Godot, to be able to use them for animations.

There is already an Unreal Engine Addon available, called AlterMesh, which provides such a feature. Gamefromscratch also talked about it.

EDIT: Today askNK also reviewed AlterMesh. Check it out to see the communities response. Unsurprisingly, it is received very positive.

GeorgeS2019 commented 2 years ago

@ngreve Please check this repos, perhaps it is relevant to what you have suggested.

image

Zireael07 commented 2 years ago

This (awesome repo) is about modeling in editor, not about Blender import

GeorgeS2019 commented 2 years ago

@Zireael07 Currently this discussion is more about .Blend import as GLTF. Godot4 alpha 1 article discussed about Improved 3D Scene Importer

Godot 4 comes with a dedicated import dialog that allows you to preview and customize every part of the imported scene, its materials and physical properties. Scripts can still be used for additional tweaks,

It is here I see opportunity to improve the scope of .Blend import beyond current scope of GLTF and HOW project like ply may eventually evolve to contribute to that needed feature.

Xartorx commented 2 years ago

It would be awesome to be able to import materials directly from .blend file bypassing GLTF format, because currently GLTF doesn't support some things (e.g. subsurface scatter or clearcoat).

Calinou commented 2 years ago

It would be awesome to be able to import materials directly from .blend file bypassing GLTF format, because currently GLTF doesn't support some things (e.g. subsurface scatter or clearcoat).

I don't think this will ever be feasible, as .blend is not an interchange format. We also have no plans to use Assimp again (which can read .blend files directly, but as I said, it's ill-advised).

fire commented 2 years ago

As someone who is writing a .blend importer for Godot Engine via blender executable. I also second that we will not be using ASSIMP for blender import.