mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-06 12:51:57 +02:00
[ui] Fix drag and drop of heavy number of frames
This commit is contained in:
parent
dea82607cd
commit
f43b6e3461
2 changed files with 7 additions and 12 deletions
|
@ -28,6 +28,7 @@ Panel {
|
||||||
property int defaultCellSize: 160
|
property int defaultCellSize: 160
|
||||||
property bool readOnly: false
|
property bool readOnly: false
|
||||||
|
|
||||||
|
property var filesByType: {}
|
||||||
property int nbMeshroomScenes: 0
|
property int nbMeshroomScenes: 0
|
||||||
property int nbDraggedFiles: 0
|
property int nbDraggedFiles: 0
|
||||||
|
|
||||||
|
@ -442,19 +443,14 @@ Panel {
|
||||||
enabled: !m.readOnly && !intrinsicsFilterButton.checked
|
enabled: !m.readOnly && !intrinsicsFilterButton.checked
|
||||||
keys: ["text/uri-list"]
|
keys: ["text/uri-list"]
|
||||||
onEntered: {
|
onEntered: {
|
||||||
nbMeshroomScenes = 0
|
|
||||||
nbDraggedFiles = drag.urls.length
|
nbDraggedFiles = drag.urls.length
|
||||||
|
filesByType = _reconstruction.getFilesByTypeFromDrop(drag.urls)
|
||||||
drag.urls.forEach(function(file) {
|
nbMeshroomScenes = filesByType["meshroomScenes"].length
|
||||||
if (file.endsWith(".mg")) {
|
|
||||||
nbMeshroomScenes++
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
onDropped: {
|
onDropped: {
|
||||||
var augmentSfm = augmentArea.hovered
|
var augmentSfm = augmentArea.hovered
|
||||||
if (nbMeshroomScenes == nbDraggedFiles || nbMeshroomScenes == 0) {
|
if (nbMeshroomScenes == nbDraggedFiles || nbMeshroomScenes == 0) {
|
||||||
root.filesDropped(drop, augmentSfm)
|
root.filesDropped(filesByType, augmentSfm)
|
||||||
} else {
|
} else {
|
||||||
errorDialog.open()
|
errorDialog.open()
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,13 +81,12 @@ Item {
|
||||||
onRemoveImageRequest: reconstruction.removeAttribute(attribute)
|
onRemoveImageRequest: reconstruction.removeAttribute(attribute)
|
||||||
onAllViewpointsCleared: { reconstruction.removeAllImages(); reconstruction.selectedViewId = "-1" }
|
onAllViewpointsCleared: { reconstruction.removeAllImages(); reconstruction.selectedViewId = "-1" }
|
||||||
onFilesDropped: {
|
onFilesDropped: {
|
||||||
var filesByType = _reconstruction.getFilesByTypeFromDrop(drop.urls)
|
if (drop["meshroomScenes"].length == 1) {
|
||||||
if (filesByType["meshroomScenes"].length == 1) {
|
|
||||||
ensureSaved(function() {
|
ensureSaved(function() {
|
||||||
reconstruction.handleFilesUrl(filesByType, augmentSfm ? null : cameraInit)
|
reconstruction.handleFilesUrl(drop, augmentSfm ? null : cameraInit)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
reconstruction.handleFilesUrl(filesByType, augmentSfm ? null : cameraInit)
|
reconstruction.handleFilesUrl(drop, augmentSfm ? null : cameraInit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue