Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocate unique track_blends vector for animation states #51448

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scene/animation/animation_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void AnimationNode::blend_animation(const StringName &p_animation, double p_time

AnimationState anim_state;
anim_state.blend = p_blend;
anim_state.track_blends = &blends;
anim_state.track_blends = blends;
anim_state.delta = p_delta;
anim_state.time = p_time;
anim_state.animation = animation;
Expand Down Expand Up @@ -1124,7 +1124,7 @@ void AnimationTree::_process_graph(double p_delta) {
ERR_CONTINUE(!state.track_map.has(path));
int blend_idx = state.track_map[path];
ERR_CONTINUE(blend_idx < 0 || blend_idx >= state.track_count);
real_t blend = (*as.track_blends)[blend_idx] * weight;
real_t blend = (as.track_blends)[blend_idx] * weight;

Animation::TrackType ttype = a->track_get_type(i);
if (ttype != Animation::TYPE_POSITION_3D && ttype != Animation::TYPE_ROTATION_3D && ttype != Animation::TYPE_SCALE_3D && track->type != ttype) {
Expand Down
2 changes: 1 addition & 1 deletion scene/animation/animation_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AnimationNode : public Resource {
Ref<Animation> animation;
double time = 0.0;
double delta = 0.0;
const Vector<real_t> *track_blends = nullptr;
Vector<real_t> track_blends;
real_t blend = 0.0;
bool seeked = false;
bool is_external_seeking = false;
Expand Down