From fba9477b3459dde6c87c343358d5134bc3e4f3a7 Mon Sep 17 00:00:00 2001 From: "georgiy.m.markelov@gmail.com" Date: Mon, 20 Mar 2023 23:24:54 +0300 Subject: [PATCH 1/2] BLEN-370: Find way not to modify PATH --- hydra_storm/engine.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hydra_storm/engine.py b/hydra_storm/engine.py index 909908c7e..21cdc1c68 100644 --- a/hydra_storm/engine.py +++ b/hydra_storm/engine.py @@ -2,6 +2,8 @@ # Copyright 2011-2022 Blender Foundation # +import os +from pathlib import Path import bpy from bpy_hydra import HydraRenderEngine @@ -17,6 +19,12 @@ class StormHydraRenderEngine(HydraRenderEngine): delegate_id = 'HdStormRendererPlugin' + @classmethod + def register(cls): + super().register() + os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = os.environ.get('PXR_MTLX_STDLIB_SEARCH_PATHS', '') + ';' + \ + str(Path(bpy.app.binary_path).parent) + '/materialx/libraries;' + def get_delegate_settings(self, engine_type): settings = bpy.context.scene.hydra_storm return { -- 2.30.2 From 1af1b21f76821bae4d7fc06caaa3829b0c4fe194 Mon Sep 17 00:00:00 2001 From: "georgiy.m.markelov@gmail.com" Date: Tue, 21 Mar 2023 10:50:47 +0300 Subject: [PATCH 2/2] added separator --- hydra_storm/engine.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hydra_storm/engine.py b/hydra_storm/engine.py index 21cdc1c68..fada9a110 100644 --- a/hydra_storm/engine.py +++ b/hydra_storm/engine.py @@ -3,6 +3,7 @@ # import os +import platform from pathlib import Path import bpy @@ -22,7 +23,8 @@ class StormHydraRenderEngine(HydraRenderEngine): @classmethod def register(cls): super().register() - os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = os.environ.get('PXR_MTLX_STDLIB_SEARCH_PATHS', '') + ';' + \ + separator = ';' if platform.system() == 'Windows' else ':' + os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = os.environ.get('PXR_MTLX_STDLIB_SEARCH_PATHS', '') + separator + \ str(Path(bpy.app.binary_path).parent) + '/materialx/libraries;' def get_delegate_settings(self, engine_type): -- 2.30.2