summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-05-06 16:58:29 +0200
committerGitHub <noreply@github.com>2019-05-06 16:58:29 +0200
commit7013607ef96c00e79a609392a020f621748a110b (patch)
treeac3d010f95f86361960f92d9d57e81bf9c2f62e3 /editor
parentfcbadd4334d4e2c11919fbe543dbd3ee825836d4 (diff)
parent342266d7824e4030e24cf6ab87d9c20d1a64800d (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.cpp18
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);
+ }
}
}