From 342266d7824e4030e24cf6ab87d9c20d1a64800d Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Tue, 23 Apr 2019 16:34:37 -0700 Subject: Modify ResourceImporterScene to split animations with blendshapes. # Conflicts: # editor/import/resource_importer_scene.cpp --- editor/import/resource_importer_scene.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'editor') diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index ab515785da..2ba85d421a 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -708,6 +708,10 @@ void ResourceImporterScene::_create_clips(Node *scene, const Array &p_clips, boo default_anim->transform_track_interpolate(j, from, &p, &q, &s); new_anim->transform_track_insert_key(dtrack, 0, p, q, s); } + if (default_anim->track_get_type(j) == Animation::TYPE_VALUE) { + Variant var = default_anim->value_track_interpolate(j, from); + new_anim->track_insert_key(dtrack, 0, var); + } } } @@ -718,6 +722,10 @@ void ResourceImporterScene::_create_clips(Node *scene, const Array &p_clips, boo default_anim->transform_track_get_key(j, k, &p, &q, &s); new_anim->transform_track_insert_key(dtrack, kt - from, p, q, s); } + if (default_anim->track_get_type(j) == Animation::TYPE_VALUE) { + Variant var = default_anim->track_get_key_value(j, k); + new_anim->track_insert_key(dtrack, kt - from, var); + } } if (dtrack != -1 && kt >= to) { @@ -729,6 +737,10 @@ void ResourceImporterScene::_create_clips(Node *scene, const Array &p_clips, boo default_anim->transform_track_interpolate(j, to, &p, &q, &s); new_anim->transform_track_insert_key(dtrack, to - from, p, q, s); } + if (default_anim->track_get_type(j) == Animation::TYPE_VALUE) { + Variant var = default_anim->value_track_interpolate(j, to); + new_anim->track_insert_key(dtrack, to - from, var); + } } } @@ -746,6 +758,12 @@ void ResourceImporterScene::_create_clips(Node *scene, const Array &p_clips, boo default_anim->transform_track_interpolate(j, to, &p, &q, &s); new_anim->transform_track_insert_key(dtrack, to - from, p, q, s); } + if (default_anim->track_get_type(j) == Animation::TYPE_VALUE) { + Variant var = default_anim->value_track_interpolate(j, from); + new_anim->track_insert_key(dtrack, 0, var); + Variant to_var = default_anim->value_track_interpolate(j, to); + new_anim->track_insert_key(dtrack, to - from, to_var); + } } } -- cgit v1.2.3