diff options
author | Thomas Herzog <therzog@mail.de> | 2018-06-22 21:52:13 +0200 |
---|---|---|
committer | Thomas Herzog <therzog@mail.de> | 2018-06-25 21:46:12 +0200 |
commit | 0f7c35f95561c41648415c370005093827e5e445 (patch) | |
tree | 4add152241bc0af4bfb34a4bab8654f6b16be1e2 /scene/animation | |
parent | 84252f2ec48380840284b097f6bbfedf86040e44 (diff) |
added BlendSpace1D editor plugin
This commit also fixes a crash in the BlendSpace2D as well as correct
the drawing of the x-zero indicator in the BlendSpace2D editor plugin.
Diffstat (limited to 'scene/animation')
-rw-r--r-- | scene/animation/animation_blend_space_1d.cpp (renamed from scene/animation/animation_blend_space1d.cpp) | 6 | ||||
-rw-r--r-- | scene/animation/animation_blend_space_1d.h (renamed from scene/animation/animation_blend_space1d.h) | 6 | ||||
-rw-r--r-- | scene/animation/animation_blend_space_2d.cpp (renamed from scene/animation/animation_blend_space2d.cpp) | 4 | ||||
-rw-r--r-- | scene/animation/animation_blend_space_2d.h (renamed from scene/animation/animation_blend_space2d.h) | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/scene/animation/animation_blend_space1d.cpp b/scene/animation/animation_blend_space_1d.cpp index 28555e41bb..6f659cc2bb 100644 --- a/scene/animation/animation_blend_space1d.cpp +++ b/scene/animation/animation_blend_space_1d.cpp @@ -1,9 +1,9 @@ -#include "animation_blend_space1d.h" +#include "animation_blend_space_1d.h" void AnimationNodeBlendSpace1D::_validate_property(PropertyInfo &property) const { if (property.name.begins_with("blend_point_")) { String left = property.name.get_slicec('/', 0); - int idx = left.get_slicec('_', 1).to_int(); + int idx = left.get_slicec('_', 2).to_int(); if (idx >= blend_points_used) { property.usage = 0; } @@ -58,7 +58,7 @@ void AnimationNodeBlendSpace1D::add_blend_point(const Ref<AnimationRootNode> &p_ if (p_at_index == -1 || p_at_index == blend_points_used) { p_at_index = blend_points_used; } else { - for (int i = blend_points_used; i > p_at_index; i++) { + for (int i = blend_points_used - 1; i > p_at_index; i++) { blend_points[i] = blend_points[i - 1]; } } diff --git a/scene/animation/animation_blend_space1d.h b/scene/animation/animation_blend_space_1d.h index 9db8f53594..447c948e93 100644 --- a/scene/animation/animation_blend_space1d.h +++ b/scene/animation/animation_blend_space_1d.h @@ -1,5 +1,5 @@ -#ifndef ANIMATION_BLEND_SPACE1D_H -#define ANIMATION_BLEND_SPACE1D_H +#ifndef ANIMATION_BLEND_SPACE_1D_H +#define ANIMATION_BLEND_SPACE_1D_H #include "scene/animation/animation_graph_player.h" @@ -65,4 +65,4 @@ public: ~AnimationNodeBlendSpace1D(); }; -#endif // ANIMATION_BLEND_SPACE1D_H +#endif // ANIMATION_BLEND_SPACE_1D_H diff --git a/scene/animation/animation_blend_space2d.cpp b/scene/animation/animation_blend_space_2d.cpp index 6db4a6976c..675285b075 100644 --- a/scene/animation/animation_blend_space2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -1,4 +1,4 @@ -#include "animation_blend_space2d.h" +#include "animation_blend_space_2d.h" #include "math/delaunay.h" void AnimationNodeBlendSpace2D::add_blend_point(const Ref<AnimationRootNode> &p_node, const Vector2 &p_position, int p_at_index) { @@ -10,7 +10,7 @@ void AnimationNodeBlendSpace2D::add_blend_point(const Ref<AnimationRootNode> &p_ if (p_at_index == -1 || p_at_index == blend_points_used) { p_at_index = blend_points_used; } else { - for (int i = blend_points_used; i > p_at_index; i--) { + for (int i = blend_points_used - 1; i > p_at_index; i--) { blend_points[i] = blend_points[i - 1]; } for (int i = 0; i < triangles.size(); i++) { diff --git a/scene/animation/animation_blend_space2d.h b/scene/animation/animation_blend_space_2d.h index 9c992578d6..f8f2440088 100644 --- a/scene/animation/animation_blend_space2d.h +++ b/scene/animation/animation_blend_space_2d.h @@ -1,5 +1,5 @@ -#ifndef ANIMATION_BLEND_SPACE2D_H -#define ANIMATION_BLEND_SPACE2D_H +#ifndef ANIMATION_BLEND_SPACE_2D_H +#define ANIMATION_BLEND_SPACE_2D_H #include "scene/animation/animation_graph_player.h" @@ -91,4 +91,4 @@ public: ~AnimationNodeBlendSpace2D(); }; -#endif // ANIMATION_BLEND_SPACE_H +#endif // ANIMATION_BLEND_SPACE_2D_H |