From 1cfdbcb2a14d36cef5bb920b5ae20f74cc476623 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 21 Feb 2022 15:55:32 +0100 Subject: [PATCH] Use pythonrc.py file for Houdini start instead of 123.py/houdinicore.py --- .../123.py => python2.7libs/pythonrc.py} | 0 .../pythonrc.py} | 0 .../startup/scripts/openpype_launch.py | 40 ------------------- 3 files changed, 40 deletions(-) rename openpype/hosts/houdini/startup/{scripts/123.py => python2.7libs/pythonrc.py} (100%) rename openpype/hosts/houdini/startup/{scripts/houdinicore.py => python3.7libs/pythonrc.py} (100%) delete mode 100644 openpype/hosts/houdini/startup/scripts/openpype_launch.py diff --git a/openpype/hosts/houdini/startup/scripts/123.py b/openpype/hosts/houdini/startup/python2.7libs/pythonrc.py similarity index 100% rename from openpype/hosts/houdini/startup/scripts/123.py rename to openpype/hosts/houdini/startup/python2.7libs/pythonrc.py diff --git a/openpype/hosts/houdini/startup/scripts/houdinicore.py b/openpype/hosts/houdini/startup/python3.7libs/pythonrc.py similarity index 100% rename from openpype/hosts/houdini/startup/scripts/houdinicore.py rename to openpype/hosts/houdini/startup/python3.7libs/pythonrc.py diff --git a/openpype/hosts/houdini/startup/scripts/openpype_launch.py b/openpype/hosts/houdini/startup/scripts/openpype_launch.py deleted file mode 100644 index 1a9069dbc6..0000000000 --- a/openpype/hosts/houdini/startup/scripts/openpype_launch.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -import sys -import avalon.api -from openpype.hosts.houdini import api -import openpype.hosts.houdini.api.workio - -import hou - - -def is_workfile(path): - if not path: - return - - if not os.path.exists(path): - return False - - _, ext = os.path.splitext(path) - if ext in openpype.hosts.houdini.api.workio.file_extensions(): - return True - - -def main(): - print("Installing OpenPype ...") - avalon.api.install(api) - - args = sys.argv - if args and is_workfile(args[-1]): - # If the last argument is a Houdini file open it directly - workfile_path = args[-1].replace("\\", "/") - print("Opening workfile on launch: {}".format(workfile_path)) - - # We don't use `workio.open_file` because we want to explicitly ignore - # load warnings. Otherwise Houdini will fail to start if a scene load - # produces e.g. errors on missing plug-ins - hou.hipFile.load(workfile_path, - suppress_save_prompt=True, - ignore_load_warnings=True) - - -main()