summaryrefslogtreecommitdiff
path: root/modules/assimp/editor_scene_importer_assimp.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-06-08 13:16:31 +0200
committerGitHub <noreply@github.com>2020-06-08 13:16:31 +0200
commitf6430eec2c39382870a433a1267df5fa695e40a9 (patch)
tree9947461d8ca1425ebdb5fce4c8e30ad99ea73f7f /modules/assimp/editor_scene_importer_assimp.cpp
parent96f3e33a6b3be4404de806a21cb4706eba9dab69 (diff)
parent9175af6f1368b22d26b9fff1b4e5380f39d9dc2c (diff)
Merge pull request #39152 from abustin/fbx_mesh_compression_fix_master
Respect 'mesh compression' editor import option in Assimp and glTF importers [master]
Diffstat (limited to 'modules/assimp/editor_scene_importer_assimp.cpp')
-rw-r--r--modules/assimp/editor_scene_importer_assimp.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp
index fed54a76b7..abbd08ae4e 100644
--- a/modules/assimp/editor_scene_importer_assimp.cpp
+++ b/modules/assimp/editor_scene_importer_assimp.cpp
@@ -299,6 +299,7 @@ EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScene *scene,
state.assimp_scene = scene;
state.max_bone_weights = p_max_bone_weights;
state.animation_player = nullptr;
+ state.import_flags = p_flags;
// populate light map
for (unsigned int l = 0; l < scene->mNumLights; l++) {
@@ -830,6 +831,8 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
Ref<ArrayMesh> mesh;
mesh.instance();
bool has_uvs = false;
+ bool compress_vert_data = state.import_flags & IMPORT_USE_COMPRESSION;
+ uint32_t mesh_flags = compress_vert_data ? Mesh::ARRAY_COMPRESS_DEFAULT : 0;
Map<String, uint32_t> morph_mesh_string_lookup;
@@ -1267,7 +1270,7 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat
morphs[j] = array_copy;
}
- mesh->add_surface_from_arrays(primitive, array_mesh, morphs);
+ mesh->add_surface_from_arrays(primitive, array_mesh, morphs, Dictionary(), mesh_flags);
mesh->surface_set_material(i, mat);
mesh->surface_set_name(i, AssimpUtils::get_assimp_string(ai_mesh->mName));
}