Fix wrong path for PXR_MTLX_STDLIB_SEARCH_PATHS #30

Merged
Bogdan Nagirniak merged 3 commits from BLEN-398 into hydra-render 2023-04-28 11:44:03 +02:00
Collaborator

Fix setting PXR_MTLX_STDLIB_SEARCH_PATHS depending on the platform.

Fix setting `PXR_MTLX_STDLIB_SEARCH_PATHS` depending on the platform.
Georgiy Markelov added 1 commit 2023-04-25 10:36:38 +02:00
Georgiy Markelov requested review from Brian Savery (AMD) 2023-04-25 10:36:45 +02:00
Brian Savery (AMD) was assigned by Georgiy Markelov 2023-04-25 10:36:49 +02:00
Georgiy Markelov self-assigned this 2023-04-25 10:36:49 +02:00
Bogdan Nagirniak was assigned by Georgiy Markelov 2023-04-25 10:36:49 +02:00
Bogdan Nagirniak approved these changes 2023-04-25 11:17:04 +02:00
Brian Savery (AMD) requested changes 2023-04-27 00:45:28 +02:00
@ -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") + \
Collaborator

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.

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 variable

`os.pathsep` equals to ';' in windows or ':' in unix to separate different paths in env variable
Collaborator

I understand that but doing some_path / some_other_path takes care of worrying about the pathsep

I understand that but doing `some_path / some_other_path` takes care of worrying about the pathsep
BrianSavery marked this conversation as resolved
Brian Savery (AMD) approved these changes 2023-04-27 23:09:50 +02:00
Brian Savery (AMD) left a comment
Collaborator

Still 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', "")])

Still 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', "")])
Georgiy Markelov added 1 commit 2023-04-28 11:08:54 +02:00
Georgiy Markelov added 1 commit 2023-04-28 11:14:01 +02:00
Bogdan Nagirniak merged commit 486b6ea406 into hydra-render 2023-04-28 11:44:03 +02:00
Sign in to join this conversation.
No Label
No Milestone
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: BogdanNagirniak/blender#30
No description provided.