Merge pull request #21882 from DualMatrix/animation_track

Fixed animation_player errors displaying wrong property.
This commit is contained in:
Rémi Verschelde 2018-09-10 19:01:18 +02:00 committed by GitHub
commit 497853c383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -263,11 +263,7 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) {
key.id = id; key.id = id;
key.bone_idx = bone_idx; key.bone_idx = bone_idx;
if (node_cache_map.has(key)) { if (!node_cache_map.has(key))
p_anim->node_cache.write[i] = &node_cache_map[key];
} else {
node_cache_map[key] = TrackNodeCache(); node_cache_map[key] = TrackNodeCache();
p_anim->node_cache.write[i] = &node_cache_map[key]; p_anim->node_cache.write[i] = &node_cache_map[key];
@ -283,7 +279,6 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) {
// cache skeleton // cache skeleton
p_anim->node_cache[i]->skeleton = Object::cast_to<Skeleton>(child); p_anim->node_cache[i]->skeleton = Object::cast_to<Skeleton>(child);
if (p_anim->node_cache[i]->skeleton) { if (p_anim->node_cache[i]->skeleton) {
if (a->track_get_path(i).get_subname_count() == 1) { if (a->track_get_path(i).get_subname_count() == 1) {
StringName bone_name = a->track_get_path(i).get_subname(0); StringName bone_name = a->track_get_path(i).get_subname(0);
@ -294,7 +289,6 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) {
p_anim->node_cache[i]->spatial = NULL; p_anim->node_cache[i]->spatial = NULL;
printf("bone is %ls\n", String(bone_name).c_str()); printf("bone is %ls\n", String(bone_name).c_str());
ERR_CONTINUE(p_anim->node_cache[i]->bone_idx < 0); ERR_CONTINUE(p_anim->node_cache[i]->bone_idx < 0);
} else {
} }
} else { } else {
// no property, just use spatialnode // no property, just use spatialnode
@ -302,7 +296,6 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) {
} }
} }
} }
}
if (a->track_get_type(i) == Animation::TYPE_VALUE) { if (a->track_get_type(i) == Animation::TYPE_VALUE) {