You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Respect 'mesh compression' editor import option in Assimp (ie. FBX) and glTF importers
This commit is contained in:
@@ -298,6 +298,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++) {
|
||||
@@ -829,6 +830,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;
|
||||
|
||||
@@ -1266,7 +1269,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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user