diff options
author | lordkettune <lefox2@gmail.com> | 2020-06-29 19:10:18 -0700 |
---|---|---|
committer | lordkettune <lefox2@gmail.com> | 2020-07-02 16:08:20 -0700 |
commit | 4313a7bdc857e7e32a5c71b931e8c02b29416e3c (patch) | |
tree | e3da9d821e3af283181833036a45c63b7f5c9a7c /editor/import | |
parent | c85a51cf87f04ff296678d563dc9299598d2bfae (diff) |
Fix issues with custom tracks on reimport
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 65ebf9dc4f..5dcdf6bec4 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -943,9 +943,9 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String ERR_CONTINUE(anim.is_null()); if (!p_animations.has(anim)) { - // We are making external files so they are modifiable + // Tracks from source file should be set as imported, anything else is a custom track. for (int i = 0; i < anim->get_track_count(); i++) { - anim->track_set_imported(i, false); + anim->track_set_imported(i, true); } String ext_name; @@ -957,10 +957,9 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String } if (FileAccess::exists(ext_name) && p_keep_animations) { - //try to keep custom animation tracks + // Copy custom animation tracks from previously imported files. Ref<Animation> old_anim = ResourceLoader::load(ext_name, "Animation", true); if (old_anim.is_valid()) { - //meergeee for (int i = 0; i < old_anim->get_track_count(); i++) { if (!old_anim->track_is_imported(i)) { old_anim->copy_track(i, anim); @@ -970,7 +969,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String } } - anim->set_path(ext_name, true); //if not set, then its never saved externally + anim->set_path(ext_name, true); // Set path to save externally. ResourceSaver::save(ext_name, anim, ResourceSaver::FLAG_CHANGE_PATH); p_animations[anim] = anim; } |