BLEN-370: Find way not to modify PATH #17

Merged
Bogdan Nagirniak merged 3 commits from BLEN-370 into hydra-render 2023-03-23 12:59:22 +01:00
Showing only changes of commit 17a934fb1d - Show all commits

View File

@ -37,7 +37,6 @@ __all__ = (
)
import os
import platform
from pathlib import Path
import bpy
@ -63,9 +62,8 @@ class HydraRenderEngine(bpy.types.RenderEngine):
@classmethod
def register(cls):
_bpy_hydra.init()
mtlx_std_libs_folder = os.environ.get('PXR_MTLX_STDLIB_SEARCH_PATHS', None)
if not mtlx_std_libs_folder:
os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = str(Path(bpy.app.binary_path).parent) + '/materialx/libraries;'
os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = str(Path(bpy.app.binary_path).parent / "materialx/libraries") + \
os.pathsep + os.environ.get('PXR_MTLX_STDLIB_SEARCH_PATHS', "")
@classmethod
def unregister(cls):