forked from blender/blender
Fix wrong path for PXR_MTLX_STDLIB_SEARCH_PATHS #30
No reviewers
Labels
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: BogdanNagirniak/blender#30
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "BLEN-398"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix setting
PXR_MTLX_STDLIB_SEARCH_PATHS
depending on the platform.@ -66,2 +67,3 @@
_bpy_hydra.init()
os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = str(Path(bpy.app.binary_path).parent / "materialx/libraries") + \
root_folder = "blender.shared" if platform.system() == 'Windows' else "lib"
os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = str(Path(bpy.app.binary_path).parent / f"{root_folder}/materialx/libraries") + \
Isn't there a more compact way to do this in python? Seems you're going back and forth from string to path and using path separators? If it's a path you shouldn't have to use os.pathseparator.
os.pathsep
equals to ';' in windows or ':' in unix to separate different paths in env variableI understand that but doing
some_path / some_other_path
takes care of worrying about the pathsepStill think this could be cleaner, I would do
`os.pathsep.join([Path(bpy.app.binary_path).parent / f"{root_folder}/materialx/libraries"), os.environ.get('PXR_MTLX_STDLIB_SEARCH_PATHS', "")])