diff options
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r-- | editor/animation_track_editor.cpp | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index f6d5312fc7..e9719f8618 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4838,40 +4838,23 @@ struct _AnimMoveRestore { void AnimationTrackEditor::_clear_key_edit() { if (key_edit) { - -#if 0 - // going back seems like the most comfortable thing to do, but it results - // in weird behaviors and crashes, because going back to animation editor - // triggers the editor setting up again itself - - bool go_back = false; + //if key edit is the object being inspected, remove it first if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit) { EditorNode::get_singleton()->push_item(NULL); - go_back = true; } + //then actually delete it memdelete(key_edit); key_edit = NULL; + } - if (go_back) { - EditorNode::get_singleton()->get_inspector_dock()->go_back(); - } -#else - //if key edit is the object being inspected, remove it first - if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit || - EditorNode::get_singleton()->get_inspector()->get_edited_object() == multi_key_edit) { + if (multi_key_edit) { + if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == multi_key_edit) { EditorNode::get_singleton()->push_item(NULL); } - //then actually delete it - if (key_edit) { - memdelete(key_edit); - key_edit = NULL; - } else if (multi_key_edit) { - memdelete(multi_key_edit); - multi_key_edit = NULL; - } -#endif + memdelete(multi_key_edit); + multi_key_edit = NULL; } } @@ -4927,7 +4910,7 @@ void AnimationTrackEditor::_update_key_edit() { if (!key_ofs_map.has(track)) { key_ofs_map[track] = List<float>(); - base_map[track] = *memnew(NodePath); + base_map[track] = NodePath(); } key_ofs_map[track].push_back(animation->track_get_key_time(track, E->key().key)); @@ -5994,6 +5977,7 @@ AnimationTrackEditor::AnimationTrackEditor() { keying = false; moving_selection = 0; key_edit = NULL; + multi_key_edit = NULL; box_selection = memnew(Control); add_child(box_selection); @@ -6105,4 +6089,7 @@ AnimationTrackEditor::~AnimationTrackEditor() { if (key_edit) { memdelete(key_edit); } + if (multi_key_edit) { + memdelete(multi_key_edit); + } } |