From 1819eacbdb6f16adcdd00adaeb372bf448e824e9 Mon Sep 17 00:00:00 2001 From: mugulmd Date: Thu, 5 Jan 2023 08:59:26 -0800 Subject: [PATCH] [ui] override default thumbnail directory with environment variable --- meshroom/ui/app.py | 5 +++++ meshroom/ui/components/thumbnail.py | 1 + 2 files changed, 6 insertions(+) diff --git a/meshroom/ui/app.py b/meshroom/ui/app.py index 982e8e43..66fbd278 100644 --- a/meshroom/ui/app.py +++ b/meshroom/ui/app.py @@ -116,6 +116,11 @@ class MeshroomApp(QApplication): pwd = os.path.dirname(__file__) self.setWindowIcon(QIcon(os.path.join(pwd, "img/meshroom.svg"))) + # User specified thumbnail directory + thumbnailDir = os.getenv('MESHROOM_THUMBNAIL_DIR') + if thumbnailDir is not None: + ThumbnailCache.thumbnailDir = thumbnailDir + # QML engine setup qmlDir = os.path.join(pwd, "qml") url = os.path.join(qmlDir, "main.qml") diff --git a/meshroom/ui/components/thumbnail.py b/meshroom/ui/components/thumbnail.py index 6cacbe3d..17ee29c4 100644 --- a/meshroom/ui/components/thumbnail.py +++ b/meshroom/ui/components/thumbnail.py @@ -15,6 +15,7 @@ class ThumbnailCache(QObject): The default cache location is a subdirectory of the user's home directory: ~/Meshroom/thumbnails. + This location can be overriden with the MESHROOM_THUMBNAIL_DIR environment variable. The main use case for thumbnails in Meshroom is in the ImageGallery. """