|
@@ -951,6 +951,9 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
|
|
if (!state.json.has("meshes"))
|
|
if (!state.json.has("meshes"))
|
|
return OK;
|
|
return OK;
|
|
|
|
|
|
|
|
+ bool compress_vert_data = state.import_flags & IMPORT_USE_COMPRESSION;
|
|
|
|
+ uint32_t mesh_flags = compress_vert_data ? Mesh::ARRAY_COMPRESS_DEFAULT : 0;
|
|
|
|
+
|
|
Array meshes = state.json["meshes"];
|
|
Array meshes = state.json["meshes"];
|
|
for (GLTFMeshIndex i = 0; i < meshes.size(); i++) {
|
|
for (GLTFMeshIndex i = 0; i < meshes.size(); i++) {
|
|
|
|
|
|
@@ -1207,7 +1210,7 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
|
|
}
|
|
}
|
|
|
|
|
|
//just add it
|
|
//just add it
|
|
- mesh.mesh->add_surface_from_arrays(primitive, array, morphs);
|
|
|
|
|
|
+ mesh.mesh->add_surface_from_arrays(primitive, array, morphs, mesh_flags);
|
|
|
|
|
|
if (p.has("material")) {
|
|
if (p.has("material")) {
|
|
const int material = p["material"];
|
|
const int material = p["material"];
|
|
@@ -2987,6 +2990,7 @@ Node *EditorSceneImporterGLTF::import_scene(const String &p_path, uint32_t p_fla
|
|
|
|
|
|
String version = asset["version"];
|
|
String version = asset["version"];
|
|
|
|
|
|
|
|
+ state.import_flags = p_flags;
|
|
state.major_version = version.get_slice(".", 0).to_int();
|
|
state.major_version = version.get_slice(".", 0).to_int();
|
|
state.minor_version = version.get_slice(".", 1).to_int();
|
|
state.minor_version = version.get_slice(".", 1).to_int();
|
|
state.use_named_skin_binds = p_flags & IMPORT_USE_NAMED_SKIN_BINDS;
|
|
state.use_named_skin_binds = p_flags & IMPORT_USE_NAMED_SKIN_BINDS;
|