Skip to content

Commit

Permalink
[ui] Add a clear images button in the file menu
Browse files Browse the repository at this point in the history
Add a button to clear all viewpoints and intrinsics of all camera inits present in the project.
  • Loading branch information
N0Ls committed Jul 7, 2021
1 parent d675f75 commit 8c6d5a8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions meshroom/ui/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,25 @@ ApplicationWindow {
shortcut: "Ctrl+I"
onTriggered: importFilesDialog.open()
}

Action {
id: clearActionItem
text: "Clear Images"
onTriggered: {
//Loop through all the camera inits
for(var i = 0 ; i < _reconstruction.cameraInits.count; i++){
//Delete all viewpoints
for(var y = _reconstruction.cameraInits.at(i).attribute('viewpoints').value.count - 1 ; y >= 0 ; y--){
_reconstruction.removeAttribute(_reconstruction.cameraInits.at(i).attribute('viewpoints').value.at(y))
}
//Delete all intrinsics
for(var y = _reconstruction.cameraInits.at(i).attribute('intrinsics').value.count - 1 ; y >= 0 ; y--){
_reconstruction.removeAttribute(_reconstruction.cameraInits.at(i).attribute('intrinsics').value.at(y))
}
}
}
}

Action {
id: saveAction
text: "Save"
Expand Down

0 comments on commit 8c6d5a8

Please sign in to comment.