Fix AnimationTree crash & rename get_tree() to get_animation_tree()
This commit is contained in:
parent
895428c805
commit
d595b27467
6 changed files with 56 additions and 43 deletions
|
|
@ -69,7 +69,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
|
||||
menu->add_submenu_item(TTR("Add Animation"), "animations");
|
||||
|
||||
AnimationTree *gp = AnimationTreeEditor::get_singleton()->get_tree();
|
||||
AnimationTree *gp = AnimationTreeEditor::get_singleton()->get_animation_tree();
|
||||
ERR_FAIL_COND(!gp);
|
||||
|
||||
if (gp->has_node(gp->get_animation_player())) {
|
||||
|
|
@ -177,7 +177,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_animation_tree()->set(get_blend_position_path(), blend_pos);
|
||||
blend_space_draw->queue_redraw();
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +200,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_animation_tree()->set(get_blend_position_path(), blend_pos);
|
||||
|
||||
blend_space_draw->queue_redraw();
|
||||
}
|
||||
|
|
@ -298,7 +298,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_draw() {
|
|||
color.a *= 0.5;
|
||||
}
|
||||
|
||||
float point = AnimationTreeEditor::get_singleton()->get_tree()->get(get_blend_position_path());
|
||||
float point = AnimationTreeEditor::get_singleton()->get_animation_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;
|
||||
|
|
@ -568,10 +568,10 @@ void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
|
|||
case NOTIFICATION_PROCESS: {
|
||||
String error;
|
||||
|
||||
if (!AnimationTreeEditor::get_singleton()->get_tree()->is_active()) {
|
||||
if (!AnimationTreeEditor::get_singleton()->get_animation_tree()->is_active()) {
|
||||
error = TTR("AnimationTree is inactive.\nActivate to enable playback, check node warnings if activation fails.");
|
||||
} else if (AnimationTreeEditor::get_singleton()->get_tree()->is_state_invalid()) {
|
||||
error = AnimationTreeEditor::get_singleton()->get_tree()->get_invalid_state_reason();
|
||||
} else if (AnimationTreeEditor::get_singleton()->get_animation_tree()->is_state_invalid()) {
|
||||
error = AnimationTreeEditor::get_singleton()->get_animation_tree()->get_invalid_state_reason();
|
||||
}
|
||||
|
||||
if (error != error_label->get_text()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue