diff options
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/collada.cpp | 2 | ||||
-rw-r--r-- | editor/import/editor_import_collada.cpp | 6 | ||||
-rw-r--r-- | editor/import/resource_importer_layered_texture.cpp | 14 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.h | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_texture.cpp | 16 |
6 files changed, 25 insertions, 17 deletions
diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp index 7cf35c519b..c54b10842f 100644 --- a/editor/import/collada.cpp +++ b/editor/import/collada.cpp @@ -848,6 +848,8 @@ void Collada::_parse_curve_geometry(XMLParser &parser, String p_id, String p_nam CurveData &curvedata = state.curve_data_map[p_id]; curvedata.name = p_name; + String closed = parser.get_attribute_value_safe("closed").to_lower(); + curvedata.closed = closed == "true" || closed == "1"; COLLADA_PRINT("curve name: " + p_name); diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 8d44329022..6890a46193 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1090,6 +1090,12 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres c->set_point_tilt(i, tilts->array[i]); } } + if (cd.closed && pc > 1) { + Vector3 pos = c->get_point_position(0); + Vector3 in = c->get_point_in(0); + Vector3 out = c->get_point_out(0); + c->add_point(pos, in, out, -1); + } curve_cache[ng->source] = c; path->set_curve(c); diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp index e1df78e741..9adabfb5d1 100644 --- a/editor/import/resource_importer_layered_texture.cpp +++ b/editor/import/resource_importer_layered_texture.cpp @@ -135,7 +135,7 @@ String ResourceImporterLayeredTexture::get_preset_name(int p_idx) const { } void ResourceImporterLayeredTexture::get_import_options(const String &p_path, List<ImportOption> *r_options, int p_preset) const { - r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Lossless (PNG),Lossy (WebP),Video RAM (S3TC/ETC/BPTC),Uncompressed,Basis Universal", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 1)); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Lossless,Lossy,VRAM Compressed,VRAM Uncompressed,Basis Universal", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 1)); r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "compress/lossy_quality", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.7)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/hdr_compression", PROPERTY_HINT_ENUM, "Disabled,Opaque Only,Always"), 1)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/bptc_ldr", PROPERTY_HINT_ENUM, "Disabled,Enabled,RGBA Only"), 0)); @@ -368,7 +368,7 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const for (int j = 0; j < hslices; j++) { int x = slice_w * j; int y = slice_h * i; - Ref<Image> slice = image->get_rect(Rect2i(x, y, slice_w, slice_h)); + Ref<Image> slice = image->get_region(Rect2i(x, y, slice_w, slice_h)); ERR_CONTINUE(slice.is_null() || slice->is_empty()); if (slice->get_width() != slice_w || slice->get_height() != slice_h) { slice->resize(slice_w, slice_h); @@ -418,7 +418,7 @@ String ResourceImporterLayeredTexture::get_import_settings_string() const { int index = 0; while (compression_formats[index]) { String setting_path = "rendering/textures/vram_compression/import_" + String(compression_formats[index]); - bool test = ProjectSettings::get_singleton()->get(setting_path); + bool test = GLOBAL_GET(setting_path); if (test) { s += String(compression_formats[index]); } @@ -450,7 +450,7 @@ bool ResourceImporterLayeredTexture::are_import_settings_valid(const String &p_p bool valid = true; while (compression_formats[index]) { String setting_path = "rendering/textures/vram_compression/import_" + String(compression_formats[index]); - bool test = ProjectSettings::get_singleton()->get(setting_path); + bool test = GLOBAL_GET(setting_path); if (test) { if (!formats_imported.has(compression_formats[index])) { valid = false; @@ -484,7 +484,7 @@ void ResourceImporterLayeredTexture::_check_compress_ctex(const String &p_source // Must import in all formats, in order of priority (so platform choses the best supported one. IE, etc2 over etc). // Android, GLES 2.x - bool can_bptc = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_bptc"); + bool can_bptc = GLOBAL_GET("rendering/textures/vram_compression/import_bptc"); if (can_bptc) { r_texture_import->formats_imported.push_back("bptc"); // BPTC needs to be added anyway. } @@ -492,7 +492,7 @@ void ResourceImporterLayeredTexture::_check_compress_ctex(const String &p_source ERR_FAIL_NULL(r_texture_import->image); bool is_hdr = (r_texture_import->image->get_format() >= Image::FORMAT_RF && r_texture_import->image->get_format() <= Image::FORMAT_RGBE9995); bool is_ldr = (r_texture_import->image->get_format() >= Image::FORMAT_L8 && r_texture_import->image->get_format() <= Image::FORMAT_RGB565); - bool can_s3tc = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_s3tc"); + bool can_s3tc = GLOBAL_GET("rendering/textures/vram_compression/import_s3tc"); ERR_FAIL_NULL(r_texture_import->slices); // Can compress hdr, but hdr with alpha is not compressible. if (r_texture_import->hdr_compression == 2) { @@ -530,7 +530,7 @@ void ResourceImporterLayeredTexture::_check_compress_ctex(const String &p_source } } if (!(r_texture_import->used_channels == Image::USED_CHANNELS_LA || r_texture_import->used_channels == Image::USED_CHANNELS_RGBA)) { - if (ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_etc2")) { + if (GLOBAL_GET("rendering/textures/vram_compression/import_etc2")) { _save_tex(*r_texture_import->slices, r_texture_import->save_path + ".etc2." + extension, r_texture_import->compress_mode, r_texture_import->lossy, Image::COMPRESS_ETC2, *r_texture_import->csource, r_texture_import->used_channels, r_texture_import->mipmaps, true); r_texture_import->platform_variants->push_back("etc2"); r_texture_import->formats_imported.push_back("etc2"); diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 756d61f712..8ede88a888 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1373,7 +1373,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< } for (int i = 0; i < post_importer_plugins.size(); i++) { - post_importer_plugins.write[i]->internal_process(EditorScenePostImportPlugin::INTERNAL_IMPORT_CATEGORY_ANIMATION, p_root, p_node, anim, node_settings); + post_importer_plugins.write[i]->internal_process(EditorScenePostImportPlugin::INTERNAL_IMPORT_CATEGORY_ANIMATION, p_root, p_node, anim, anim_settings); } } } diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index 498e9f2964..5f64330453 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -474,7 +474,7 @@ Transform3D ResourceImporterScene::get_collision_shapes_transform(const M &p_opt } if (p_options.has(SNAME("primitive/rotation"))) { - transform.basis.set_euler((p_options[SNAME("primitive/rotation")].operator Vector3() / 180.0) * Math_PI); + transform.basis = Basis::from_euler(p_options[SNAME("primitive/rotation")].operator Vector3() * (Math_PI / 180.0)); } } return transform; diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index ed3f1ff489..54ad840f3d 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -192,7 +192,7 @@ bool ResourceImporterTexture::get_option_visibility(const String &p_path, const if (compress_mode < COMPRESS_VRAM_COMPRESSED) { return false; } - if (!ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_bptc")) { + if (!GLOBAL_GET("rendering/textures/vram_compression/import_bptc")) { return false; } } @@ -246,7 +246,7 @@ void ResourceImporterTexture::get_import_options(const String &p_path, List<Impo void ResourceImporterTexture::save_to_ctex_format(Ref<FileAccess> f, const Ref<Image> &p_image, CompressMode p_compress_mode, Image::UsedChannels p_channels, Image::CompressMode p_compress_format, float p_lossy_quality) { switch (p_compress_mode) { case COMPRESS_LOSSLESS: { - bool lossless_force_png = ProjectSettings::get_singleton()->get("rendering/textures/lossless_compression/force_png") || + bool lossless_force_png = GLOBAL_GET("rendering/textures/lossless_compression/force_png") || !Image::_webp_mem_loader_func; // WebP module disabled. bool use_webp = !lossless_force_png && p_image->get_width() <= 16383 && p_image->get_height() <= 16383; // WebP has a size limit f->store_32(use_webp ? CompressedTexture2D::DATA_FORMAT_WEBP : CompressedTexture2D::DATA_FORMAT_PNG); @@ -599,8 +599,8 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String const bool is_hdr = (image->get_format() >= Image::FORMAT_RF && image->get_format() <= Image::FORMAT_RGBE9995); bool is_ldr = (image->get_format() >= Image::FORMAT_L8 && image->get_format() <= Image::FORMAT_RGB565); - const bool can_bptc = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_bptc"); - const bool can_s3tc = ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_s3tc"); + const bool can_bptc = GLOBAL_GET("rendering/textures/vram_compression/import_bptc"); + const bool can_s3tc = GLOBAL_GET("rendering/textures/vram_compression/import_s3tc"); if (can_bptc) { // Add to the list anyway. @@ -645,13 +645,13 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String formats_imported.push_back("s3tc"); } - if (ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_etc2")) { + if (GLOBAL_GET("rendering/textures/vram_compression/import_etc2")) { _save_ctex(image, p_save_path + ".etc2.ctex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, stream, detect_3d, detect_roughness, detect_normal, force_normal, srgb_friendly_pack, true, mipmap_limit, normal_image, roughness_channel); r_platform_variants->push_back("etc2"); formats_imported.push_back("etc2"); } - if (ProjectSettings::get_singleton()->get("rendering/textures/vram_compression/import_etc")) { + if (GLOBAL_GET("rendering/textures/vram_compression/import_etc")) { _save_ctex(image, p_save_path + ".etc.ctex", compress_mode, lossy, Image::COMPRESS_ETC, mipmaps, stream, detect_3d, detect_roughness, detect_normal, force_normal, srgb_friendly_pack, true, mipmap_limit, normal_image, roughness_channel); r_platform_variants->push_back("etc"); formats_imported.push_back("etc"); @@ -704,7 +704,7 @@ String ResourceImporterTexture::get_import_settings_string() const { int index = 0; while (compression_formats[index]) { String setting_path = "rendering/textures/vram_compression/import_" + String(compression_formats[index]); - bool test = ProjectSettings::get_singleton()->get(setting_path); + bool test = GLOBAL_GET(setting_path); if (test) { s += String(compression_formats[index]); } @@ -745,7 +745,7 @@ bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) co bool valid = true; while (compression_formats[index]) { String setting_path = "rendering/textures/vram_compression/import_" + String(compression_formats[index]); - bool test = ProjectSettings::get_singleton()->get(setting_path); + bool test = GLOBAL_GET(setting_path); if (test) { if (!formats_imported.has(compression_formats[index])) { valid = false; |