From 3084c7268a3e7022d0cc0085d5f62b52e9a972cb Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 6 Dec 2024 16:49:43 +0100 Subject: [PATCH] Alert user when dracopy is not installed --- moderngl_window/loaders/scene/gltf2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/moderngl_window/loaders/scene/gltf2.py b/moderngl_window/loaders/scene/gltf2.py index 36c0b0b..0b1470d 100644 --- a/moderngl_window/loaders/scene/gltf2.py +++ b/moderngl_window/loaders/scene/gltf2.py @@ -471,7 +471,10 @@ def load(self, materials: list[Material]) -> list[Mesh]: if primitive.extensions.get("KHR_draco_mesh_compression"): buffer_view = primitive.extensions["KHR_draco_mesh_compression"]["bufferView"] data = buffer_view.read_raw() - import DracoPy + try: + import DracoPy + except ImportError: + raise ImportError("DracoPy is required to load draco compressed meshes") mesh = DracoPy.decode(data) attributes = {