summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-02-01 12:10:13 +0100
committerGitHub <noreply@github.com>2023-02-01 12:10:13 +0100
commitc40020513ac8201a449b5ae2eeb58fef0ce0a2a4 (patch)
tree7f83a0eece0253ab5aa9b5a5bed8015ef08ee71a /editor
parent1033dfcb3d4d91a08f1d659ded2000c73c938094 (diff)
parentbc24d0135944dedbdbaa8f6aff8f9faee772fe3e (diff)
Merge pull request #72440 from V-Sekai/gltf_embed_as_uncompressed
gltf: Add GLTFHandleBinary::HANDLE_BINARY_EMBED_AS_UNCOMPRESSED
Diffstat (limited to 'editor')
-rw-r--r--editor/import/resource_importer_scene.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 9560f4bed2..d0f04cb46f 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -2289,7 +2289,14 @@ Node *ResourceImporterScene::pre_import(const String &p_source_file, const HashM
ERR_FAIL_COND_V(!importer.is_valid(), nullptr);
Error err = OK;
- Node *scene = importer->import_scene(p_source_file, EditorSceneFormatImporter::IMPORT_ANIMATION | EditorSceneFormatImporter::IMPORT_GENERATE_TANGENT_ARRAYS, p_options, nullptr, &err);
+ HashMap<StringName, Variant> options_dupe = p_options;
+
+ // By default, the GLTF importer will extract embedded images into files on disk
+ // However, we do not want the advanced settings dialog to be able to write files on disk.
+ // To avoid this and also avoid compressing to basis every time, we are using the uncompressed option.
+ options_dupe["gltf/embedded_image_handling"] = 3; // Embed as Uncompressed defined in GLTFState::GLTFHandleBinary::HANDLE_BINARY_EMBED_AS_UNCOMPRESSED
+
+ Node *scene = importer->import_scene(p_source_file, EditorSceneFormatImporter::IMPORT_ANIMATION | EditorSceneFormatImporter::IMPORT_GENERATE_TANGENT_ARRAYS, options_dupe, nullptr, &err);
if (!scene || err != OK) {
return nullptr;
}