diff --git a/pype/hooks/aftereffects/pre_launch_args.py b/pype/hooks/aftereffects/pre_launch_args.py index 435893fbc0..00b3557429 100644 --- a/pype/hooks/aftereffects/pre_launch_args.py +++ b/pype/hooks/aftereffects/pre_launch_args.py @@ -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: diff --git a/pype/hosts/aftereffects/template.aep b/pype/hosts/aftereffects/template.aep new file mode 100644 index 0000000000..0857e418f3 Binary files /dev/null and b/pype/hosts/aftereffects/template.aep differ