.aep file argument support added

This commit is contained in:
Andrew
2025-11-08 03:50:34 +03:00
parent 969ecd7884
commit 83c077a54d
3 changed files with 33 additions and 1 deletions

2
run.sh
View File

@@ -2,4 +2,4 @@
cd "$(dirname "$0")"
python main.py
python main.py "$@"

View File

@@ -1,5 +1,6 @@
import os
import subprocess
import sys
from ui.mainwindow import MainWindowUI
from translations import gls
from PySide6.QtCore import Slot
@@ -23,6 +24,8 @@ class MainWindow(MainWindowUI):
def __init__(self):
super().__init__()
self.ran_from_aep_file = False
self.setWindowTitle(gls('welcome_win_title'))
self.install_button.clicked.connect(self.install_button_clicked)
self.run_button.clicked.connect(self.run_ae_button_clicked)
@@ -72,6 +75,26 @@ class MainWindow(MainWindowUI):
self.aeg_action.triggered.connect(self.aegnux_folder_clicked)
self.cep_action.triggered.connect(self.cep_folder_clicked)
def try_autoopen_aep(self):
self.run_ae_thread.clear_aep_file_arg()
if self.ran_from_aep_file:
return
self.ran_from_aep_file = True
aep_file = ''
for arg in sys.argv:
if '.aep' in arg:
aep_file = arg
break
if aep_file == '':
return
self.run_ae_thread.add_aep_file_arg(aep_file)
self.run_ae_button_clicked()
def init_installation(self):
if check_aegnux_installed():
self.install_button.hide()
@@ -83,6 +106,7 @@ class MainWindow(MainWindowUI):
self.kill_action.setEnabled(True)
self.plugininst_action.setEnabled(True)
self.term_action.setEnabled(True)
self.try_autoopen_aep()
else:
self.install_button.show()

View File

@@ -6,5 +6,13 @@ class RunAEThread(RunExeThread):
def __init__(self):
super().__init__(['AfterFX.exe'])
def add_aep_file_arg(self, aep_file: str):
self.exe_args.append('Z:' + aep_file)
def clear_aep_file_arg(self):
for arg in self.exe_args:
if '.aep' in arg:
self.exe_args.remove(arg)
def run(self):
super().run()