diff --git a/hooks/tk-multi-launchapp/before_app_launch.py b/hooks/tk-multi-launchapp/before_app_launch.py index 7a9083c66..91fb58832 100755 --- a/hooks/tk-multi-launchapp/before_app_launch.py +++ b/hooks/tk-multi-launchapp/before_app_launch.py @@ -79,7 +79,12 @@ 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_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 sgtk.util.append_path_to_env_var("HOUDINI_OTLSCAN_PATH", otls_path) self.parent.log_info("Added otlscan path %s" % otls_path)