Fix crash on reimport scene with animations

This commit is contained in:
Hilderin 2024-08-02 16:50:22 -04:00
parent 3978628c6c
commit 769424388e
4 changed files with 35 additions and 0 deletions

View file

@ -141,6 +141,16 @@ void EditorSelectionHistory::add_object(ObjectID p_object, const String &p_prope
current_elem_idx++;
}
void EditorSelectionHistory::replace_object(ObjectID p_old_object, ObjectID p_new_object) {
for (HistoryElement &element : history) {
for (int index = 0; index < element.path.size(); index++) {
if (element.path[index].object == p_old_object) {
element.path.write[index].object = p_new_object;
}
}
}
}
int EditorSelectionHistory::get_history_len() {
return history.size();
}