From 9940ff2fa9ec5dfa2435f364b5543e726999bed7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 24 Nov 2020 20:02:18 +0100 Subject: [PATCH] added maya --- pype/hooks/maya/pre_launch_args.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pype/hooks/maya/pre_launch_args.py diff --git a/pype/hooks/maya/pre_launch_args.py b/pype/hooks/maya/pre_launch_args.py new file mode 100644 index 0000000000..6aed54a3c3 --- /dev/null +++ b/pype/hooks/maya/pre_launch_args.py @@ -0,0 +1,17 @@ +import os +from pype.lib import PreLaunchHook + + +class MayaLaunchArguments(PreLaunchHook): + """Add path to last workfile to launch arguments.""" + order = 0 + hosts = ["maya"] + + def execute(self): + """Prepare suprocess launch arguments for NukeX.""" + if self.data.get("start_last_workfile"): + last_workfile = self.data.get("last_workfile_path") + if os.path.exists(last_workfile): + self.launch_context.launch_args.append( + "\"{}\"".format(last_workfile) + )