diff --git a/openpype/hooks/pre_add_last_workfile_arg.py b/openpype/hooks/pre_add_last_workfile_arg.py index 4797b61580..caebd7d034 100644 --- a/openpype/hooks/pre_add_last_workfile_arg.py +++ b/openpype/hooks/pre_add_last_workfile_arg.py @@ -17,6 +17,7 @@ class AddLastWorkfileToLaunchArgs(PreLaunchHook): "nuke", "nukex", "hiero", + "houdini", "nukestudio", "blender", "photoshop", @@ -24,7 +25,7 @@ class AddLastWorkfileToLaunchArgs(PreLaunchHook): "afftereffects" ] - def get_last_workfile(self): + def execute(self): if not self.data.get("start_last_workfile"): self.log.info("It is set to not start last workfile on start.") return @@ -38,38 +39,6 @@ class AddLastWorkfileToLaunchArgs(PreLaunchHook): self.log.info("Current context does not have any workfile yet.") return - return last_workfile - - def execute(self): - - last_workfile = self.get_last_workfile() if last_workfile: # Add path to workfile to arguments self.launch_context.launch_args.append(last_workfile) - - -class AddLastWorkfileToLaunchArgsHoudini(AddLastWorkfileToLaunchArgs): - """Add last workfile path to launch arguments - Houdini specific""" - app_groups = ["houdini"] - - def execute(self): - - last_workfile = self.get_last_workfile() - if last_workfile: - # Whenever a filepath is passed to Houdini then the startup - # scripts 123.py and houdinicore.py won't be triggered. Thus - # OpenPype will not initialize correctly. As such, whenever - # we pass a workfile we first explicitly pass a startup - # script to enforce it to run - which will load the last passed - # argument as workfile directly. - pype_root = os.environ["OPENPYPE_REPOS_ROOT"] - startup_path = os.path.join( - pype_root, "openpype", "hosts", "houdini", "startup" - ) - startup_script = os.path.join(startup_path, - "scripts", - "openpype_launch.py") - self.launch_context.launch_args.append(startup_script) - - # Add path to workfile to arguments - self.launch_context.launch_args.append(last_workfile)