From ce4cfdc8e4e7c93c0dc555c38d3ecd8fc25b7013 Mon Sep 17 00:00:00 2001 From: Max de Groot <7687218+MaximumFX@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:36:32 +0100 Subject: [PATCH 1/2] Add default HOUDINI_OTLSCAN_PATH if it doesn't exist --- hooks/tk-multi-launchapp/before_app_launch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hooks/tk-multi-launchapp/before_app_launch.py b/hooks/tk-multi-launchapp/before_app_launch.py index 7a9083c66..53f04bea6 100755 --- a/hooks/tk-multi-launchapp/before_app_launch.py +++ b/hooks/tk-multi-launchapp/before_app_launch.py @@ -79,7 +79,11 @@ def execute(self, app_path, app_args, version, engine_name, **kwargs): houdini_otls_template = tk.templates["houdini_otls"] otls_path = houdini_otls_template.apply_fields(current_context).replace(os.sep, '/') - # Add environment + # Check if HOUDINI_OTLDSCAN_PATH exists in environment, if it's empty add the default value back + if os.environ.get("HOUDINI_OTLDSCAN_PATH") == "": + sgtk.util.append_path_to_env_var("HOUDINI_OTLSCAN_PATH", "@/otls") + + # Add the project otls path to the environment sgtk.util.append_path_to_env_var("HOUDINI_OTLSCAN_PATH", otls_path) self.parent.log_info("Added otlscan path %s" % otls_path) From 3573ca1eca398aed653e7a0266f3b4c6bbb5e3e8 Mon Sep 17 00:00:00 2001 From: Max de Groot <7687218+MaximumFX@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:45:41 +0100 Subject: [PATCH 2/2] Fix spelling and type checking for otl scan path --- hooks/tk-multi-launchapp/before_app_launch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hooks/tk-multi-launchapp/before_app_launch.py b/hooks/tk-multi-launchapp/before_app_launch.py index 53f04bea6..91fb58832 100755 --- a/hooks/tk-multi-launchapp/before_app_launch.py +++ b/hooks/tk-multi-launchapp/before_app_launch.py @@ -79,8 +79,9 @@ def execute(self, app_path, app_args, version, engine_name, **kwargs): houdini_otls_template = tk.templates["houdini_otls"] otls_path = houdini_otls_template.apply_fields(current_context).replace(os.sep, '/') - # Check if HOUDINI_OTLDSCAN_PATH exists in environment, if it's empty add the default value back - if os.environ.get("HOUDINI_OTLDSCAN_PATH") == "": + # Check if HOUDINI_OTLSCAN_PATH exists in environment, if it's empty add the default value back + HOUDINI_OTLSCAN_PATH = os.environ.get("HOUDINI_OTLSCAN_PATH") + if HOUDINI_OTLSCAN_PATH is None or HOUDINI_OTLSCAN_PATH == "": sgtk.util.append_path_to_env_var("HOUDINI_OTLSCAN_PATH", "@/otls") # Add the project otls path to the environment