summaryrefslogtreecommitdiffstats
path: root/scene/animation
diff options
context:
space:
mode:
authorSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-06-01 19:06:32 +0900
committerSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-06-01 19:06:32 +0900
commit8a90c5317b2c0c050d6c9abddde478d6221ebf46 (patch)
tree326706676213f23f20694b3e59947dabec5cd16f /scene/animation
parent705b7a0b0bd535c95e4e8fb439f3d84b3fb4f427 (diff)
downloadredot-engine-8a90c5317b2c0c050d6c9abddde478d6221ebf46.tar.gz
Add blend point check to AnimationNodeBlendSpace2D::_process()
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_blend_space_1d.cpp2
-rw-r--r--scene/animation/animation_blend_space_2d.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp
index 36343edd11..ff19eb8c12 100644
--- a/scene/animation/animation_blend_space_1d.cpp
+++ b/scene/animation/animation_blend_space_1d.cpp
@@ -278,7 +278,7 @@ void AnimationNodeBlendSpace1D::_add_blend_point(int p_index, const Ref<Animatio
}
AnimationNode::NodeTimeInfo AnimationNodeBlendSpace1D::_process(const AnimationMixer::PlaybackInfo p_playback_info, bool p_test_only) {
- if (blend_points_used == 0) {
+ if (!blend_points_used) {
return NodeTimeInfo();
}
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp
index 2634248231..8ec8203126 100644
--- a/scene/animation/animation_blend_space_2d.cpp
+++ b/scene/animation/animation_blend_space_2d.cpp
@@ -448,6 +448,10 @@ void AnimationNodeBlendSpace2D::_blend_triangle(const Vector2 &p_pos, const Vect
AnimationNode::NodeTimeInfo AnimationNodeBlendSpace2D::_process(const AnimationMixer::PlaybackInfo p_playback_info, bool p_test_only) {
_update_triangles();
+ if (!blend_points_used) {
+ return NodeTimeInfo();
+ }
+
Vector2 blend_pos = get_parameter(blend_position);
int cur_closest = get_parameter(closest);
NodeTimeInfo mind; //time of min distance point
@@ -455,7 +459,7 @@ AnimationNode::NodeTimeInfo AnimationNodeBlendSpace2D::_process(const AnimationM
AnimationMixer::PlaybackInfo pi = p_playback_info;
if (blend_mode == BLEND_MODE_INTERPOLATED) {
- if (triangles.size() == 0) {
+ if (triangles.is_empty()) {
return NodeTimeInfo();
}