mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-07 21:31:56 +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 bool readOnly: false
|
||||
|
||||
property var filesByType: {}
|
||||
property int nbMeshroomScenes: 0
|
||||
property int nbDraggedFiles: 0
|
||||
|
||||
|
@ -442,19 +443,14 @@ Panel {
|
|||
enabled: !m.readOnly && !intrinsicsFilterButton.checked
|
||||
keys: ["text/uri-list"]
|
||||
onEntered: {
|
||||
nbMeshroomScenes = 0
|
||||
nbDraggedFiles = drag.urls.length
|
||||
|
||||
drag.urls.forEach(function(file) {
|
||||
if (file.endsWith(".mg")) {
|
||||
nbMeshroomScenes++
|
||||
}
|
||||
})
|
||||
filesByType = _reconstruction.getFilesByTypeFromDrop(drag.urls)
|
||||
nbMeshroomScenes = filesByType["meshroomScenes"].length
|
||||
}
|
||||
onDropped: {
|
||||
var augmentSfm = augmentArea.hovered
|
||||
if (nbMeshroomScenes == nbDraggedFiles || nbMeshroomScenes == 0) {
|
||||
root.filesDropped(drop, augmentSfm)
|
||||
root.filesDropped(filesByType, augmentSfm)
|
||||
} else {
|
||||
errorDialog.open()
|
||||
}
|
||||
|
|
|
@ -81,13 +81,12 @@ Item {
|
|||
onRemoveImageRequest: reconstruction.removeAttribute(attribute)
|
||||
onAllViewpointsCleared: { reconstruction.removeAllImages(); reconstruction.selectedViewId = "-1" }
|
||||
onFilesDropped: {
|
||||
var filesByType = _reconstruction.getFilesByTypeFromDrop(drop.urls)
|
||||
if (filesByType["meshroomScenes"].length == 1) {
|
||||
if (drop["meshroomScenes"].length == 1) {
|
||||
ensureSaved(function() {
|
||||
reconstruction.handleFilesUrl(filesByType, augmentSfm ? null : cameraInit)
|
||||
reconstruction.handleFilesUrl(drop, augmentSfm ? null : cameraInit)
|
||||
})
|
||||
} else {
|
||||
reconstruction.handleFilesUrl(filesByType, augmentSfm ? null : cameraInit)
|
||||
reconstruction.handleFilesUrl(drop, augmentSfm ? null : cameraInit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue