mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-03 12:16:51 +02:00
[ui] Cosmetic modifications
Cosmetic modifications such as missing spaces.
This commit is contained in:
parent
b74cada8ef
commit
9f96f68a95
5 changed files with 26 additions and 24 deletions
|
@ -82,17 +82,17 @@ class FilesByType:
|
||||||
self.images = []
|
self.images = []
|
||||||
self.videos = []
|
self.videos = []
|
||||||
self.panoramaInfo = []
|
self.panoramaInfo = []
|
||||||
self.meshroomScene = []
|
self.meshroomScenes = []
|
||||||
self.other = []
|
self.other = []
|
||||||
|
|
||||||
def __bool__(self):
|
def __bool__(self):
|
||||||
return self.images or self.videos or self.panoramaInfo or self.meshroomScene
|
return self.images or self.videos or self.panoramaInfo or self.meshroomScenes
|
||||||
|
|
||||||
def extend(self, other):
|
def extend(self, other):
|
||||||
self.images.extend(other.images)
|
self.images.extend(other.images)
|
||||||
self.videos.extend(other.videos)
|
self.videos.extend(other.videos)
|
||||||
self.panoramaInfo.extend(other.panoramaInfo)
|
self.panoramaInfo.extend(other.panoramaInfo)
|
||||||
self.meshroomScene.extend(other.meshroomScene)
|
self.meshroomScenes.extend(other.meshroomScenes)
|
||||||
self.other.extend(other.other)
|
self.other.extend(other.other)
|
||||||
|
|
||||||
def addFile(self, file):
|
def addFile(self, file):
|
||||||
|
@ -103,7 +103,7 @@ class FilesByType:
|
||||||
elif hasExtension(file, panoramaInfoExtensions):
|
elif hasExtension(file, panoramaInfoExtensions):
|
||||||
self.panoramaInfo.append(file)
|
self.panoramaInfo.append(file)
|
||||||
elif hasExtension(file, meshroomSceneExtensions):
|
elif hasExtension(file, meshroomSceneExtensions):
|
||||||
self.meshroomScene.append(file)
|
self.meshroomScenes.append(file)
|
||||||
else:
|
else:
|
||||||
self.other.append(file)
|
self.other.append(file)
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ Panel {
|
||||||
property bool readOnly: false
|
property bool readOnly: false
|
||||||
|
|
||||||
property bool isMeshroomScene : false
|
property bool isMeshroomScene : false
|
||||||
property int nbFilesDropped: 0
|
property int nbDraggedFiles: 0
|
||||||
|
|
||||||
signal removeImageRequest(var attribute)
|
signal removeImageRequest(var attribute)
|
||||||
signal allViewpointsCleared()
|
signal allViewpointsCleared()
|
||||||
|
@ -443,10 +443,10 @@ Panel {
|
||||||
keys: ["text/uri-list"]
|
keys: ["text/uri-list"]
|
||||||
onEntered: {
|
onEntered: {
|
||||||
isMeshroomScene = false
|
isMeshroomScene = false
|
||||||
nbFilesDropped = drag.urls.length
|
nbDraggedFiles = drag.urls.length
|
||||||
if (nbFilesDropped == 1){
|
if (nbDraggedFiles == 1) {
|
||||||
var url = drag.urls[0]
|
var url = drag.urls[0]
|
||||||
if (url.endsWith(".mg")){
|
if (url.endsWith(".mg")) {
|
||||||
isMeshroomScene = true
|
isMeshroomScene = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -477,12 +477,12 @@ Panel {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
text: {
|
text: {
|
||||||
if (isMeshroomScene) {
|
if (isMeshroomScene) {
|
||||||
if(nbFilesDropped == 1) {
|
if (nbDraggedFiles == 1) {
|
||||||
return "Load Project"
|
return "Load Project"
|
||||||
} else {
|
} else {
|
||||||
return "Only one project"
|
return "Only one project"
|
||||||
}
|
}
|
||||||
}else if (!isMeshroomScene){
|
} else {
|
||||||
return "Add Images"
|
return "Add Images"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -506,11 +506,13 @@ Panel {
|
||||||
font.bold: true
|
font.bold: true
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
visible: {
|
visible: {
|
||||||
if(isMeshroomScene)
|
if (isMeshroomScene) {
|
||||||
return false
|
return false
|
||||||
if(m.viewpoints){
|
}
|
||||||
|
|
||||||
|
if (m.viewpoints) {
|
||||||
return m.viewpoints.count > 0
|
return m.viewpoints.count > 0
|
||||||
}else{
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ Item {
|
||||||
onAllViewpointsCleared: { reconstruction.removeAllImages(); reconstruction.selectedViewId = "-1" }
|
onAllViewpointsCleared: { reconstruction.removeAllImages(); reconstruction.selectedViewId = "-1" }
|
||||||
onFilesDropped: {
|
onFilesDropped: {
|
||||||
var filesByType = _reconstruction.getFilesByTypeFromDrop(drop.urls)
|
var filesByType = _reconstruction.getFilesByTypeFromDrop(drop.urls)
|
||||||
if (filesByType["meshroomScene"].length == 1) {
|
if (filesByType["meshroomScenes"].length == 1) {
|
||||||
ensureSaved(function() {
|
ensureSaved(function() {
|
||||||
reconstruction.handleFilesUrl(filesByType, augmentSfm ? null : cameraInit)
|
reconstruction.handleFilesUrl(filesByType, augmentSfm ? null : cameraInit)
|
||||||
})
|
})
|
||||||
|
|
|
@ -1188,7 +1188,7 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
onFilesDropped: {
|
onFilesDropped: {
|
||||||
var filesByType = _reconstruction.getFilesByTypeFromDrop(drop.urls)
|
var filesByType = _reconstruction.getFilesByTypeFromDrop(drop.urls)
|
||||||
if (filesByType["meshroomScene"].length == 1) {
|
if (filesByType["meshroomScenes"].length == 1) {
|
||||||
ensureSaved(function() {
|
ensureSaved(function() {
|
||||||
_reconstruction.handleFilesUrl(filesByType, null, mousePosition)
|
_reconstruction.handleFilesUrl(filesByType, null, mousePosition)
|
||||||
})
|
})
|
||||||
|
|
|
@ -724,7 +724,7 @@ class Reconstruction(UIGraph):
|
||||||
This method allows to reduce process time by doing it on Python side.
|
This method allows to reduce process time by doing it on Python side.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
{images, videos, panoramaInfo, otherFiles}: Map of paths of recognized images and list of other files
|
{images, videos, panoramaInfo, meshroomScenes, otherFiles}: Map containing the lists of paths for recognized images, videos, Meshroom scenes and other files.
|
||||||
Node: cameraInit node used to add new images to it
|
Node: cameraInit node used to add new images to it
|
||||||
QPoint: position to locate the node (usually the mouse position)
|
QPoint: position to locate the node (usually the mouse position)
|
||||||
"""
|
"""
|
||||||
|
@ -785,19 +785,19 @@ class Reconstruction(UIGraph):
|
||||||
"",
|
"",
|
||||||
))
|
))
|
||||||
|
|
||||||
if filesByType["meshroomScene"]:
|
if filesByType["meshroomScenes"]:
|
||||||
if len(filesByType["meshroomScene"]) > 1:
|
if len(filesByType["meshroomScenes"]) > 1:
|
||||||
self.error.emit(
|
self.error.emit(
|
||||||
Message(
|
Message(
|
||||||
"Too much Meshroom Scenes",
|
"Too many Meshroom Scenes",
|
||||||
"You should only import 1 .mg file"
|
"A single Meshroom scene (.mg file) can be imported at once."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.loadUrl(filesByType["meshroomScene"][0])
|
self.loadUrl(filesByType["meshroomScenes"][0])
|
||||||
|
|
||||||
|
|
||||||
if not filesByType["images"] and not filesByType["videos"] and not filesByType["panoramaInfo"] and not filesByType["meshroomScene"]:
|
if not filesByType["images"] and not filesByType["videos"] and not filesByType["panoramaInfo"] and not filesByType["meshroomScenes"]:
|
||||||
if filesByType["other"]:
|
if filesByType["other"]:
|
||||||
extensions = set([os.path.splitext(url)[1] for url in filesByType["other"]])
|
extensions = set([os.path.splitext(url)[1] for url in filesByType["other"]])
|
||||||
self.error.emit(
|
self.error.emit(
|
||||||
|
@ -816,7 +816,7 @@ class Reconstruction(UIGraph):
|
||||||
urls: list of filepaths
|
urls: list of filepaths
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
{images, otherFiles}: Map of recognized images and list of other files
|
{images, videos, panoramaInfo, meshroomScenes, otherFiles}: Map containing the lists of paths for recognized images, videos, Meshroom scenes and other files.
|
||||||
"""
|
"""
|
||||||
# Build the list of images paths
|
# Build the list of images paths
|
||||||
filesByType = multiview.FilesByType()
|
filesByType = multiview.FilesByType()
|
||||||
|
@ -826,7 +826,7 @@ class Reconstruction(UIGraph):
|
||||||
filesByType.extend(multiview.findFilesByTypeInFolder(localFile))
|
filesByType.extend(multiview.findFilesByTypeInFolder(localFile))
|
||||||
else:
|
else:
|
||||||
filesByType.addFile(localFile)
|
filesByType.addFile(localFile)
|
||||||
return {"images": filesByType.images, "videos": filesByType.videos, "panoramaInfo": filesByType.panoramaInfo, "meshroomScene": filesByType.meshroomScene, "other": filesByType.other}
|
return {"images": filesByType.images, "videos": filesByType.videos, "panoramaInfo": filesByType.panoramaInfo, "meshroomScenes": filesByType.meshroomScenes, "other": filesByType.other}
|
||||||
|
|
||||||
def importImagesFromFolder(self, path, recursive=False):
|
def importImagesFromFolder(self, path, recursive=False):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue