Fix #1984 Mesh merge undo does not track hierarchy

Fix amend edit can undo other changes after error in function
Fix issue with loading backups
This commit is contained in:
JannisX11 2023-08-27 13:54:12 +02:00
parent 376a4f4778
commit 7f3d92f46b
3 changed files with 6 additions and 2 deletions

View File

@ -517,7 +517,7 @@ onVueSetup(function() {
let model = parsed_backup_models[uuid];
setupProject(Formats[model.meta.model_format] || Formats.free, uuid);
Codecs.project.parse(model, file.path)
Codecs.project.parse(model, 'backup.bbmodel')
}
section.delete();
}},

View File

@ -1786,7 +1786,7 @@ BARS.defineActions(function() {
condition: {modes: ['edit'], features: ['meshes'], method: () => (Mesh.selected.length >= 2)},
click() {
let elements = Mesh.selected.slice();
Undo.initEdit({elements});
Undo.initEdit({elements, outliner: true});
let original = Mesh.selected[0];
let vector = new THREE.Vector3();

View File

@ -104,6 +104,10 @@ class UndoSystem {
}
}
}
if (Undo.history.length != Undo.index) {
console.error('Detected error in amending edit. Skipping this edit.');
return;
}
Undo.undo(null, true);
callback(form_values, scope.amend_edit_menu.form);
}