diff --git a/conanfile.py b/conanfile.py index b47c5789d9..31b741a970 100644 --- a/conanfile.py +++ b/conanfile.py @@ -67,6 +67,8 @@ class CuraConan(ConanFile): self._cura_env = Environment() self._cura_env.define("QML2_IMPORT_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "qml"))) self._cura_env.define("QT_PLUGIN_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "plugins"))) + if not self.in_local_cache: + self._cura_env.define( "CURA_DATA_ROOT", str(self._share_dir.joinpath("cura"))) if self.settings.os == "Linux": self._cura_env.define("QT_QPA_FONTDIR", "/usr/share/fonts") diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index b51fbd9d82..722a728863 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -6,6 +6,7 @@ import sys import tempfile import time import platform +from pathlib import Path from typing import cast, TYPE_CHECKING, Optional, Callable, List, Any, Dict import numpy @@ -366,6 +367,10 @@ class CuraApplication(QtApplication): Resources.addSecureSearchPath(os.path.join(self._app_install_dir, "share", "cura", "resources")) if not hasattr(sys, "frozen"): + cura_data_root = os.environ.get('CURA_DATA_ROOT', None) + if cura_data_root: + Resources.addSearchPath(str(Path(cura_data_root).joinpath("resources"))) + Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources")) # local Conan cache