ayon-core/pype/hooks/maya/pre_launch_args.py
2020-11-24 20:02:18 +01:00

17 lines
549 B
Python

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)
)