From 614957a471de71d8ce31b80230786943f3f35fcd Mon Sep 17 00:00:00 2001 From: Dominik Winkelbauer Date: Sat, 26 Aug 2023 14:21:36 +0200 Subject: [PATCH] fix(pyrender): Only enables headless pyrender under linux --- blenderproc/python/writer/BopWriterUtility.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blenderproc/python/writer/BopWriterUtility.py b/blenderproc/python/writer/BopWriterUtility.py index 60f0b6694..b6ec492cb 100644 --- a/blenderproc/python/writer/BopWriterUtility.py +++ b/blenderproc/python/writer/BopWriterUtility.py @@ -13,6 +13,7 @@ import cv2 import bpy from mathutils import Matrix +import sys from blenderproc.python.types.MeshObjectUtility import MeshObject, get_all_mesh_objects from blenderproc.python.utility.Utility import Utility, resolve_path @@ -22,7 +23,9 @@ from blenderproc.python.utility.SetupUtility import SetupUtility from blenderproc.python.utility.MathUtility import change_target_coordinate_frame_of_transformation_matrix -os.environ['PYOPENGL_PLATFORM'] = 'egl' +# EGL is not available under windows +if sys.platform in ["linux", "linux2"]: + os.environ['PYOPENGL_PLATFORM'] = 'egl' # pylint: disable=wrong-import-position import pyrender # pylint: enable=wrong-import-position