Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLipu Fei <lipu.fei815@gmail.com>2019-09-04 17:23:34 +0300
committerLipu Fei <lipu.fei815@gmail.com>2019-09-04 17:23:57 +0300
commit7e97bc4e17aecadd97b634afc3402f426c80ae8e (patch)
treeb82c53620599f748913af75b66a393fee1cb78b4 /cura_app.py
parent79aefa950f20cc8d30ba8e694fa2d27d6e2c306a (diff)
Add workaround for GLTF loading on OSX
CURA-6739
Diffstat (limited to 'cura_app.py')
-rwxr-xr-xcura_app.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/cura_app.py b/cura_app.py
index b2cd317243..63f107a112 100755
--- a/cura_app.py
+++ b/cura_app.py
@@ -141,5 +141,19 @@ import Arcus #@UnusedImport
import Savitar #@UnusedImport
from cura.CuraApplication import CuraApplication
+
+# WORKAROUND: CURA-6739
+# The CTM file loading module in Trimesh requires the OpenCTM library to be dynamically loaded. It uses
+# ctypes.util.find_library() to find libopenctm.dylib, but this doesn't seem to look in the ".app" application folder
+# on Mac OS X. Adding the search path to environment variables such as DYLD_LIBRARY_PATH and DYLD_FALLBACK_LIBRARY_PATH
+# makes it work. The workaround here uses DYLD_FALLBACK_LIBRARY_PATH.
+if Platform.isOSX() and getattr(sys, "frozen", False):
+ old_env = os.environ["DYLD_FALLBACK_LIBRARY_PATH"]
+ search_path = os.path.join(CuraApplication.getInstallPrefix(), "MacOS")
+ path_list = old_env.split(":")
+ if search_path not in path_list:
+ path_list.append(search_path)
+ os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = ":".join(path_list)
+
app = CuraApplication()
app.run()