diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-05-06 16:58:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-06 16:58:29 +0200 |
commit | 7013607ef96c00e79a609392a020f621748a110b (patch) | |
tree | ac3d010f95f86361960f92d9d57e81bf9c2f62e3 /editor | |
parent | fcbadd4334d4e2c11919fbe543dbd3ee825836d4 (diff) | |
parent | 342266d7824e4030e24cf6ab87d9c20d1a64800d (diff) |
Merge pull request #28365 from fire/split_clip_blend_shapes
Modify ResourceImporterScene to split animations with blendshapes.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 1de276b940..5ac7bc3bc8 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); + } } } |