AE - modified pre launch hook to open last workfile

TODO - opening from template, opening AE from frozen dist
This commit is contained in:
Petr Kalis 2021-01-29 18:24:45 +01:00
parent 1d940f8b8b
commit 9523ab586c
2 changed files with 10 additions and 3 deletions

View file

@ -20,16 +20,23 @@ class AfterEffectsPrelaunchHook(PreLaunchHook):
while self.launch_context.launch_args:
remainders.append(self.launch_context.launch_args.pop(0))
workfile_path = self.data["last_workfile_path"]
if not os.path.exists(workfile_path):
workfile_path = ""
new_launch_args = [
self.python_executable(),
"-c",
(
"import avalon.aftereffects;"
"avalon.aftereffects.launch(\"{}\")"
).format(aftereffects_executable.replace("\\", "\\\\"))
"avalon.aftereffects.launch(\"{}\", \"{}\")"
).format(
aftereffects_executable.replace("\\", "\\\\"),
workfile_path.replace("\\", "\\\\")
)
]
# Append as whole list as these areguments should not be separated
# Append as whole list as these arguments should not be separated
self.launch_context.launch_args.append(new_launch_args)
if remainders:

Binary file not shown.