diff options
author | Lyuma <xn.lyuma@gmail.com> | 2024-05-20 02:56:57 -0700 |
---|---|---|
committer | Lyuma <xn.lyuma@gmail.com> | 2024-05-21 07:58:36 -0700 |
commit | c433754d3483515aab7a4201f12f83fcbd1050b3 (patch) | |
tree | 1ccbd48f11d784d99c3338c32ea9871f078bd9e9 /editor/import_dock.cpp | |
parent | bd2300d77a6008167043f23fd91bcc562cde0a19 (diff) | |
download | redot-engine-c433754d3483515aab7a4201f12f83fcbd1050b3.tar.gz |
fbx: change import option defaults
ufbx has special logic to handle animation/trimming, and most users expect trimming to be on.
For existing projects, we should upgrade files0 to FBX2glTF to preserve node compatibility.
Diffstat (limited to 'editor/import_dock.cpp')
-rw-r--r-- | editor/import_dock.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index fbe76e1d5c..2d87e6592f 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -188,10 +188,20 @@ void ImportDock::_update_options(const String &p_path, const Ref<ConfigFile> &p_ params->checked.clear(); params->base_options_path = p_path; + HashMap<StringName, Variant> import_options; + List<String> section_keys; + p_config->get_section_keys("params", §ion_keys); + for (const String §ion_key : section_keys) { + import_options[section_key] = p_config->get_value("params", section_key); + } + if (params->importer.is_valid()) { + params->importer->handle_compatibility_options(import_options); + } + for (const ResourceImporter::ImportOption &E : options) { params->properties.push_back(E.option); - if (p_config.is_valid() && p_config->has_section_key("params", E.option.name)) { - params->values[E.option.name] = p_config->get_value("params", E.option.name); + if (p_config.is_valid() && import_options.has(E.option.name)) { + params->values[E.option.name] = import_options[E.option.name]; } else { params->values[E.option.name] = E.default_value; } |