Skip to content

Commit 04da2fb

Browse files
committed
Document glTF base path in Runtime file loading and saving
1 parent d6da7be commit 04da2fb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tutorials/io/runtime_file_loading_and_saving.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,20 @@ Example of loading a glTF scene and appending its root node to the scene:
198198
# `GLTFDocument.generate_buffer()` is also available for saving to memory.
199199
gltf_document_save.write_to_filesystem(gltf_state_save, path)
200200

201+
.. note::
202+
203+
When loading a glTF scene, a *base path* must be set so that external
204+
resources like textures can be loaded correctly. When loading from a file,
205+
the base path is automatically set to the folder containing the file. When
206+
loading from a buffer, this base path must be manually set as there is no
207+
way for Godot to infer this path.
208+
209+
To set the base path, set
210+
:ref:`GLTFState.base_path <class_GLTFState_property_base_path>` on your
211+
GLTFState instance *before* calling
212+
:ref:`GLTFDocument.append_from_buffer <class_GLTFDocument_method_append_from_buffer>`
213+
or :ref:`GLTFDocument.append_from_file <class_GLTFDocument_method_append_from_file>`.
214+
201215
.. _doc_runtime_file_loading_and_saving_fonts:
202216

203217
Fonts

0 commit comments

Comments
 (0)