Skip to content

Commit d6b4fe8

Browse files
authored
Merge pull request #6603 from Calinou/update-importing-3d-scenes
Update Importing 3D scenes documentation for Godot 4.0
2 parents bfdba6f + 4bb6cdb commit d6b4fe8

File tree

2 files changed

+122
-41
lines changed

2 files changed

+122
-41
lines changed

about/list_of_features.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,13 @@ Import
474474
- Ogg Vorbis.
475475
- MP3.
476476

477-
- *3D scenes:*
477+
- *3D scenes:* See :ref:`doc_importing_3d_scenes`.
478478

479479
- glTF 2.0 *(recommended)*.
480-
- `ESCN <https://github.com/godotengine/godot-blender-exporter>`__
481-
(direct export from Blender).
482-
- FBX (static meshes only).
480+
- ``.blend`` (by calling Blender's glTF export functionality transparently).
481+
- FBX (by calling fbx2gltf transparently).
483482
- Collada (.dae).
484-
- Wavefront OBJ (static scenes only, can be loaded directly as a mesh).
483+
- Wavefront OBJ (static scenes only, can be loaded directly as a mesh or imported as a 3D scene).
485484

486485
- Support for loading glTF 2.0 scenes at run-time, including from an exported project.
487486
- 3D meshes use `Mikktspace <http://www.mikktspace.com/>`__ to generate tangents

tutorials/assets_pipeline/importing_scenes.rst

Lines changed: 118 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,54 @@ transferred as close as possible.
1313

1414
Godot supports the following 3D *scene file formats*:
1515

16-
* glTF 2.0 **(recommended)**. Godot has full support for both text (``.gltf``) and binary (``.glb``) formats.
17-
* DAE (COLLADA), an older format that is fully supported.
18-
* OBJ (Wavefront) format + their MTL material files. This is also fully supported, but pretty limited (no support for pivots, skeletons, animations, PBR materials, ...).
19-
* ESCN, a Godot-specific format that Blender can export with a plugin.
20-
* FBX, supported via a reverse engineered importer. So we recommend using other formats listed above, if suitable
21-
for your workflow.
16+
- glTF 2.0 **(recommended)**. Godot has full support for both text (``.gltf``) and binary (``.glb``) formats.
17+
- ``.blend`` (Blender). This works by calling Blender to export to glTF in a
18+
transparent manner (requires Blender to be installed).
19+
- DAE (COLLADA), an older format that is fully supported.
20+
- OBJ (Wavefront) format + their MTL material files. This is also fully
21+
supported, but pretty limited given the format's limitations (no support for
22+
pivots, skeletons, animations, UV2, PBR materials, ...).
23+
- FBX, supported via `FBX2glTF <https://github.com/godotengine/FBX2glTF>`__ integration.
24+
This requires installing an external program that links against the proprietary FBX SDK,
25+
so we recommend using other formats listed above (if suitable for your workflow).
2226

2327
Just copy the scene file together with the texture to the project repository, and Godot will do a full import.
2428

2529
It is important that the mesh is not deformed by bones when exporting. Make sure that the skeleton is reset to its T-pose
2630
or default rest pose before exporting with your favorite 3D editor.
2731

28-
Exporting glTF 2.0 files from Blender
29-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32+
Exporting glTF 2.0 files from Blender (recommended)
33+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3034

31-
There are three ways to export glTF files from Blender. As a glTF binary (``.glb`` file), glTF embedded (``.gltf`` file),
32-
and with textures (``gltf`` + ``.bin`` + textures).
35+
There are 3 ways to export glTF files from Blender:
3336

34-
glTF binary files are the smallest of the three options. They include the mesh and textures set up in Blender.
35-
When brought into Godot the textures are part of the object's material file.
37+
- As a glTF binary file (``.glb``).
38+
- As a glTF text-based file with embedded binary data (``.gltf`` file)
39+
- As a glTF text-based file with separate binary data and textures (``.gltf``
40+
file + ``.bin`` file + textures).
3641

37-
glTF embedded files function the same way as binary files. They don't provide extra functionality in Godot,
38-
and shouldn't be used since they have a larger file size.
42+
glTF binary files (``.glb``) are the smallest of the three options. They include
43+
the mesh and textures set up in Blender. When brought into Godot the textures
44+
are part of the object's material file.
3945

40-
There are two reasons to use glTF with the textures separate. One is to have the scene description in a
41-
text based format and the binary data in a separate binary file. This can be useful for version control if you want to review
42-
changes in a text based format. The second is you need the texture files separate from the material file. If you don't need
43-
either of those glTF binary files are fine.
46+
glTF embedded files (``.gltf``) function the same way as binary files. They
47+
don't provide extra functionality in Godot, and shouldn't be used since they
48+
have a larger file size.
49+
50+
There are two reasons to use glTF with the textures separate. One is to have the
51+
scene description in a text based format and the binary data in a separate
52+
binary file. This can be useful for version control if you want to review
53+
changes in a text-based format. The second is you need the texture files
54+
separate from the material file. If you don't need either of those, glTF binary
55+
files are fine.
4456

4557
.. warning::
4658

47-
If your model contains blend shapes (also known as "shape keys" and "morph targets"),
48-
your glTF export setting **Export Deformation Bones Only** needs to be configured to **Enabled**
49-
under the Animation export configurations.
59+
If your model contains blend shapes (also known as "shape keys" and "morph
60+
targets"), your glTF export setting **Export Deformation Bones Only** needs
61+
to be configured to **Enabled** under the Animation export configurations.
5062

51-
Exporting non-deforming bones anyway will lead to incorrect shading in GLES3.
63+
Exporting non-deforming bones anyway will lead to incorrect shading.
5264

5365
.. note::
5466

@@ -63,27 +75,97 @@ either of those glTF binary files are fine.
6375
being culled by other faces. To resolve this, enable **Backface Culling** in
6476
Blender's Materials tab, then export the scene to glTF again.
6577

78+
Importing ``.blend`` files directly within Godot
79+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80+
81+
.. note::
82+
83+
This functionality requires Blender 3.0 or later.
84+
85+
From Godot 4.0 onwards, the editor can directly import ``.blend`` files by
86+
calling `Blender <https://www.blender.org/>`__'s glTF export functionality in a
87+
transparent manner.
88+
89+
This allows you to iterate on your 3D scenes faster, as you can save the scene
90+
in Blender, alt-tab back to Godot then see your changes immediately. When
91+
working with version control, this is also more efficient as you no longer need
92+
to commit a copy of the exported glTF file to version control.
93+
94+
To use ``.blend`` import, you must install Blender before opening the Godot
95+
editor (if opening a project that already contains ``.blend`` files). If you
96+
keep Blender installed at its default location, Godot should be able to detect
97+
its path automatically. If this isn't the case, configure the path to the
98+
Blender executable in the Editor Settings (**Filesystem > Import > Blender >
99+
Blender 3 Path**).
100+
101+
If you keep ``.blend`` files within your project folder but don't want them to
102+
be imported by Godot, disable **Filesystem > Import > Blender > Enabled** in the
103+
advanced Project Settings.
104+
105+
.. note::
106+
107+
When working in a team, keep in mind using ``.blend`` files in your project
108+
will require *all* team members to have Blender installed. While Blender is
109+
a free download, this may add friction when working on the project.
110+
``.blend`` import is also not available on the Android and web editors, as
111+
these platforms can't call external programs.
112+
113+
If this is problematic, consider using glTF scenes exported from Blender
114+
instead.
115+
66116
Exporting DAE files from Blender
67117
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68118

69-
Blender has built-in COLLADA support, but it does not work properly for the needs of game engines
70-
and should not be used as is.
119+
Blender has built-in COLLADA support, but it does not work properly for the
120+
needs of game engines and shouldn't be used as-is. However, scenes exported with
121+
the built-in Collada support may still work for simple scenes without animation.
122+
123+
For complex scenes or scenes that contain animations, Godot provides a
124+
`Blender plugin <https://github.com/godotengine/collada-exporter>`_
125+
that will correctly export COLLADA scenes for use in Godot.
71126

72-
Godot provides a `Blender plugin <https://github.com/godotengine/collada-exporter>`_
73-
that will correctly export COLLADA scenes for use in Godot. It does not work in Blender 2.8 or
74-
newer, but there are plans to update it in the future.
127+
Importing OBJ files in Godot
128+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
129+
130+
OBJ is one of the simplest 3D formats out there, so Godot should be able to
131+
import most OBJ files successfully. However, OBJ is also a very limited format:
132+
it doesn't support skinning, animation, UV2 or PBR materials.
133+
134+
There are 2 ways to use OBJ meshes in Godot:
135+
136+
- Load them directly in a MeshInstance3D node, or any other property that
137+
expects as mesh (such as GPUParticles3D). This is the default mode.
138+
- Change their import mode to **OBJ as Scene** in the Import dock then restart
139+
the editor. This allows you to use the same import options as glTF or Collada
140+
scenes, such as unwrapping UV2 on import (for :ref:`doc_baked_lightmaps`).
141+
142+
.. note::
75143

76-
Exporting ESCN files from Blender
77-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144+
Blender 3.4 and later can export RGB vertex colors in OBJ files (this is a
145+
nonstandard extension of the OBJ format). Godot is able to import those
146+
vertex colors since Godot 4.0, but they will not be displayed on the
147+
material unless you enable **Vertex Color > Use As Albedo** on the material.
78148

79-
The most powerful one, called `godot-blender-exporter
80-
<https://github.com/godotengine/godot-blender-exporter>`__.
81-
It uses a .escn file, which is kind of another name for a .tscn file (Godot scene file);
82-
it keeps as much information as possible from a Blender scene. However, it is considered
83-
experimental.
149+
Vertex colors from OBJ meshes keep their original color space once imported
150+
(sRGB/linear), but their brightness is clamped to 1.0 (they can't be
151+
overbright).
152+
153+
Importing FBX files in Godot
154+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
155+
156+
When opening a project containing FBX scenes, you will see a dialog asking you
157+
to configure FBX import. Click the link in the dialog to download a fbx2gltf
158+
binary, then extract the ZIP archive, place the binary anywhere you wish, then
159+
specify its path in the dialog.
160+
161+
If you keep ``.fbx`` files within your project folder but don't want them to
162+
be imported by Godot, disable **Filesystem > Import > FBX > Enabled** in the
163+
advanced Project Settings.
164+
165+
.. seealso::
84166

85-
The ESCN exporter has a detailed `document <escn_exporter/index.html>`__ describing
86-
its functionality and usage.
167+
The full installation process for using FBX in Godot is described on the
168+
`FBX import page of the Godot website <https://godotengine.org/fbx-import>`__.
87169

88170
Exporting textures separately
89171
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)