Merge pull request #119061 from Ryan-000/fix-animation-1
Fix undo crash when animation editor is not active
This commit is contained in:
@@ -408,7 +408,8 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_draw() {
|
||||
}
|
||||
|
||||
void AnimationNodeBlendSpace1DEditor::_update_space() {
|
||||
if (updating) {
|
||||
// edge case when undoing action after editor has changed
|
||||
if (updating || blend_space.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -587,7 +588,7 @@ void AnimationNodeBlendSpace1DEditor::_tool_switch(int p_tool) {
|
||||
}
|
||||
|
||||
void AnimationNodeBlendSpace1DEditor::_update_edited_point_pos() {
|
||||
if (updating) {
|
||||
if (updating || blend_space.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -716,6 +717,9 @@ void AnimationNodeBlendSpace1DEditor::_edit_point_index(double p_index) {
|
||||
|
||||
void AnimationNodeBlendSpace1DEditor::_set_selected_point(int p_index) {
|
||||
selected_point = p_index;
|
||||
if (blend_space.is_null()) {
|
||||
return;
|
||||
}
|
||||
_update_tool_erase();
|
||||
if (p_index != -1) {
|
||||
_update_edited_point_pos();
|
||||
|
||||
@@ -747,7 +747,7 @@ void AnimationNodeBlendSpace2DEditor::_snap_toggled() {
|
||||
}
|
||||
|
||||
void AnimationNodeBlendSpace2DEditor::_update_space() {
|
||||
if (updating) {
|
||||
if (updating || blend_space.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -891,7 +891,7 @@ void AnimationNodeBlendSpace2DEditor::_erase_selected() {
|
||||
}
|
||||
|
||||
void AnimationNodeBlendSpace2DEditor::_update_edited_point_pos() {
|
||||
if (updating) {
|
||||
if (updating || blend_space.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -968,6 +968,9 @@ void AnimationNodeBlendSpace2DEditor::_edit_point_index(double p_index) {
|
||||
|
||||
void AnimationNodeBlendSpace2DEditor::_set_selected_point(int p_index) {
|
||||
selected_point = p_index;
|
||||
if (blend_space.is_null()) {
|
||||
return;
|
||||
}
|
||||
_update_tool_erase();
|
||||
if (p_index != -1) {
|
||||
_update_edited_point_pos();
|
||||
|
||||
Reference in New Issue
Block a user