diff options
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/editor_import_collada.cpp | 8 | ||||
-rw-r--r-- | editor/import/resource_importer_obj.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_texture.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_wav.cpp | 11 |
5 files changed, 21 insertions, 4 deletions
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index e0a2ea624e..5bf2da9912 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -867,7 +867,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me int normal_pos = (normal_src->stride ? normal_src->stride : 3) * p.indices[src + normal_ofs]; ERR_FAIL_INDEX_V(normal_pos, normal_src->array.size(), ERR_INVALID_DATA); vertex.normal = Vector3(normal_src->array[normal_pos + 0], normal_src->array[normal_pos + 1], normal_src->array[normal_pos + 2]); - vertex.normal = vertex.normal.snapped(0.001); + vertex.normal.snap(Vector3(0.001, 0.001, 0.001)); if (tangent_src && binormal_src) { @@ -908,12 +908,18 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me #ifndef NO_UP_AXIS_SWAP if (collada.state.up_axis == Vector3::AXIS_Z) { + Vector3 bn = vertex.normal.cross(vertex.tangent.normal) * vertex.tangent.d; + SWAP(vertex.vertex.z, vertex.vertex.y); vertex.vertex.z = -vertex.vertex.z; SWAP(vertex.normal.z, vertex.normal.y); vertex.normal.z = -vertex.normal.z; SWAP(vertex.tangent.normal.z, vertex.tangent.normal.y); vertex.tangent.normal.z = -vertex.tangent.normal.z; + SWAP(bn.z, bn.y); + bn.z = -bn.z; + + vertex.tangent.d = vertex.normal.cross(vertex.tangent.normal).dot(bn) > 0 ? 1 : -1; } #endif diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 1c5aa95ff1..4a2f37e319 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -188,7 +188,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s Vector3 vertex = vertices[vtx]; if (weld_vertices) - vertex = vertex.snapped(weld_tolerance); + vertex.snap(Vector3(weld_tolerance, weld_tolerance, weld_tolerance)); surf_tool->add_vertex(vertex); } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 2409f6707d..2ccbd36e18 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -594,7 +594,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Array for (int i = 0; i < 3; i++) { - Vector3 v = f.vertex[i].snapped(0.01); + Vector3 v = f.vertex[i].snapped(Vector3(0.01, 0.01, 0.01)); if (!points.has(v)) { points.insert(v); center += v; diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 41b2353ed3..3834e52fab 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -202,7 +202,7 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options, r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/anisotropic"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "flags/srgb", PROPERTY_HINT_ENUM, "Disable,Enable,Detect"), 2)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/fix_alpha_border"), p_preset != PRESET_3D ? true : false)); - r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/premult_alpha"), true)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/premult_alpha"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/HDR_as_SRGB"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "stream"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "size_limit", PROPERTY_HINT_RANGE, "0,4096,1"), 0)); diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index 7841baa02e..18c4bed5dd 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -153,6 +153,8 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s uint16_t compression_code = file->get_16(); + //Issue: #7755 : Not a bug - usage of other formats (format codes) are unsupported in current importer version. + //Consider revision for engine version 3.0 if (compression_code != 1) { ERR_PRINT("Format not supported for WAVE file (not PCM). Save WAVE files as uncompressed PCM instead."); break; @@ -249,6 +251,15 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s if (chunkID[0] == 's' && chunkID[1] == 'm' && chunkID[2] == 'p' && chunkID[3] == 'l') { //loop point info! + /** + * Consider exploring next document: + * http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/RIFFNEW.pdf + * Especially on page: + * 16 - 17 + * Timestamp: + * 22:38 06.07.2017 GMT + **/ + for (int i = 0; i < 10; i++) file->get_32(); // i wish to know why should i do this... no doc! |