mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 17:35:56 +08:00
Allow sideloading of resources via env
`CURA_DATA_ROOT` and `URANIUM_DATA_ROOT` This allows the conanfile.py to point to `venv/share/cura` This functionality is disabled in sys.frozen Contributes to CURA-10561
This commit is contained in:
parent
94eb9e1a21
commit
16249e490e
@ -67,6 +67,8 @@ class CuraConan(ConanFile):
|
|||||||
self._cura_env = Environment()
|
self._cura_env = Environment()
|
||||||
self._cura_env.define("QML2_IMPORT_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "qml")))
|
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")))
|
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":
|
if self.settings.os == "Linux":
|
||||||
self._cura_env.define("QT_QPA_FONTDIR", "/usr/share/fonts")
|
self._cura_env.define("QT_QPA_FONTDIR", "/usr/share/fonts")
|
||||||
|
@ -6,6 +6,7 @@ import sys
|
|||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
import platform
|
import platform
|
||||||
|
from pathlib import Path
|
||||||
from typing import cast, TYPE_CHECKING, Optional, Callable, List, Any, Dict
|
from typing import cast, TYPE_CHECKING, Optional, Callable, List, Any, Dict
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
@ -366,6 +367,10 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
Resources.addSecureSearchPath(os.path.join(self._app_install_dir, "share", "cura", "resources"))
|
Resources.addSecureSearchPath(os.path.join(self._app_install_dir, "share", "cura", "resources"))
|
||||||
if not hasattr(sys, "frozen"):
|
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"))
|
Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources"))
|
||||||
|
|
||||||
# local Conan cache
|
# local Conan cache
|
||||||
|
Loading…
x
Reference in New Issue
Block a user