summaryrefslogtreecommitdiffstats
path: root/editor/plugins/animation_blend_space_1d_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/animation_blend_space_1d_editor.cpp')
-rw-r--r--editor/plugins/animation_blend_space_1d_editor.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp
index 1106464edf..5373015654 100644
--- a/editor/plugins/animation_blend_space_1d_editor.cpp
+++ b/editor/plugins/animation_blend_space_1d_editor.cpp
@@ -4,11 +4,10 @@
#include "scene/animation/animation_blend_tree.h"
StringName AnimationNodeBlendSpace1DEditor::get_blend_position_path() const {
- StringName path = AnimationTreeEditor::get_singleton()->get_base_path()+"blend_position";
+ StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + "blend_position";
return path;
}
-
void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> k = p_event;
@@ -55,7 +54,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
continue;
int idx = menu->get_item_count();
- menu->add_item(vformat("Add %s", name),idx);
+ menu->add_item(vformat("Add %s", name), idx);
menu->set_item_metadata(idx, E->get());
}
@@ -136,7 +135,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
blend_pos *= blend_space->get_max_space() - blend_space->get_min_space();
blend_pos += blend_space->get_min_space();
- AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(),blend_pos);
+ AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(), blend_pos);
blend_space_draw->update();
}
@@ -159,7 +158,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
blend_pos *= blend_space->get_max_space() - blend_space->get_min_space();
blend_pos += blend_space->get_min_space();
- AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(),blend_pos);
+ AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(), blend_pos);
blend_space_draw->update();
}
@@ -258,7 +257,6 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_draw() {
float point = AnimationTreeEditor::get_singleton()->get_tree()->get(get_blend_position_path());
-
point = (point - blend_space->get_min_space()) / (blend_space->get_max_space() - blend_space->get_min_space());
point *= s.width;
@@ -501,8 +499,6 @@ void AnimationNodeBlendSpace1DEditor::_open_editor() {
}
}
-
-
void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
error_panel->add_style_override("panel", get_stylebox("bg", "Tree"));
@@ -514,7 +510,6 @@ void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
tool_erase->set_icon(get_icon("Remove", "EditorIcons"));
snap->set_icon(get_icon("SnapGrid", "EditorIcons"));
open_editor->set_icon(get_icon("Edit", "EditorIcons"));
-
}
if (p_what == NOTIFICATION_PROCESS) {
@@ -536,7 +531,7 @@ void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
}
}
- if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
+ if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
set_process(is_visible_in_tree());
}
}
@@ -561,22 +556,17 @@ void AnimationNodeBlendSpace1DEditor::_bind_methods() {
ClassDB::bind_method("_open_editor", &AnimationNodeBlendSpace1DEditor::_open_editor);
ClassDB::bind_method("_file_opened", &AnimationNodeBlendSpace1DEditor::_file_opened);
-
-
-
}
bool AnimationNodeBlendSpace1DEditor::can_edit(const Ref<AnimationNode> &p_node) {
- Ref<AnimationNodeBlendSpace1D> b1d=p_node;
+ Ref<AnimationNodeBlendSpace1D> b1d = p_node;
return b1d.is_valid();
}
void AnimationNodeBlendSpace1DEditor::edit(const Ref<AnimationNode> &p_node) {
-
-
- blend_space=p_node;
+ blend_space = p_node;
if (!blend_space.is_null()) {
_update_space();
@@ -595,7 +585,6 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
Ref<ButtonGroup> bg;
bg.instance();
-
tool_blend = memnew(ToolButton);
tool_blend->set_toggle_mode(true);
tool_blend->set_button_group(bg);