Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing LD_LIBRARY_PATH startup error if LD_LIBRARY_PATH has not been set before. #8

Closed
17 changes: 8 additions & 9 deletions client/ayon_usd/hooks/pre_resolver_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,14 @@ def execute(self):

self.launch_context.env["PYTHONPATH"] += os.pathsep.join(python_path)

if system().lower() == "windows":
self.launch_context.env["PATH"] += os.pathsep.join(ld_path)
else:
self.launch_context.env["LD_LIBRARY_PATH"] += \
os.pathsep.join(ld_path)

# is there used in the application? Can it hold multiple values?
# self.launch_context.env["USD_ASSET_RESOLVER"] = \
# resolver_dir.as_posix()
if ld_path:
env_key = "LD_LIBRARY_PATH"
if system().lower() == "windows":
env_key = "PATH"
existing_path = self.launch_context.env.get(env_key)
if existing_path:
ld_path.insert(0, existing_path)
self.launch_context.env[env_key] = os.pathsep.join(ld_path)

# TODO: move debug options to AYON settings
self.launch_context.env["TF_DEBUG"] = "1"
Expand Down
2 changes: 2 additions & 0 deletions client/ayon_usd/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def is_usd_download_needed(addon_settings=None):

"""
if _USDOptions.download_needed is not None:

return _USDOptions.download_needed

if addon_settings is None:
Expand All @@ -212,6 +213,7 @@ def is_usd_download_needed(addon_settings=None):
download_needed = not bool(usd_root)

_USDOptions.download_needed = download_needed

return _USDOptions.download_needed


Expand Down