[ui] save after drag&drop: meshroom scenes detected as separated type of file

In FilesByType, new attribute meshroomScene allowing to detected
separately the meshroom scenes from the other types of file.
This commit is contained in:
Aurore LAFAURIE 2024-03-22 10:43:36 +01:00
parent 58e9bafa45
commit b74cada8ef
4 changed files with 30 additions and 21 deletions

View file

@ -69,6 +69,7 @@ videoExtensions = (
'.mxf',
)
panoramaInfoExtensions = ('.xml')
meshroomSceneExtensions = ('.mg')
def hasExtension(filepath, extensions):
@ -81,15 +82,17 @@ class FilesByType:
self.images = []
self.videos = []
self.panoramaInfo = []
self.meshroomScene = []
self.other = []
def __bool__(self):
return self.images or self.videos or self.panoramaInfo
return self.images or self.videos or self.panoramaInfo or self.meshroomScene
def extend(self, other):
self.images.extend(other.images)
self.videos.extend(other.videos)
self.panoramaInfo.extend(other.panoramaInfo)
self.meshroomScene.extend(other.meshroomScene)
self.other.extend(other.other)
def addFile(self, file):
@ -99,6 +102,8 @@ class FilesByType:
self.videos.append(file)
elif hasExtension(file, panoramaInfoExtensions):
self.panoramaInfo.append(file)
elif hasExtension(file, meshroomSceneExtensions):
self.meshroomScene.append(file)
else:
self.other.append(file)