diff --git a/openpype/hooks/pre_non_python_host_launch.py b/openpype/hooks/pre_non_python_host_launch.py index c16a72c5e5..7a04f02d5a 100644 --- a/openpype/hooks/pre_non_python_host_launch.py +++ b/openpype/hooks/pre_non_python_host_launch.py @@ -17,6 +17,8 @@ class NonPythonHostHook(PreLaunchHook): """ app_groups = ["harmony", "photoshop", "aftereffects"] + order = 20 + def execute(self): # Pop executable executable_path = self.launch_context.launch_args.pop(0) diff --git a/openpype/hooks/pre_with_windows_shell.py b/openpype/hooks/pre_with_windows_shell.py index 0c10583b99..720b285ad4 100644 --- a/openpype/hooks/pre_with_windows_shell.py +++ b/openpype/hooks/pre_with_windows_shell.py @@ -1,6 +1,7 @@ import os import subprocess from openpype.lib import PreLaunchHook +from openpype.lib.applications import ApplicationLaunchContext class LaunchWithWindowsShell(PreLaunchHook): @@ -11,12 +12,15 @@ class LaunchWithWindowsShell(PreLaunchHook): instead. """ - # Should be as last hook becuase must change launch arguments to string + # Should be as last hook because must change launch arguments to string order = 1000 - app_groups = ["nuke", "nukex", "hiero", "nukestudio"] + app_groups = ["nuke", "nukex", "hiero", "nukestudio", + "photoshop", "aftereffects", "harmony"] platforms = ["windows"] def execute(self): + launch_args = self.launch_context.clear_launch_args( + self.launch_context.launch_args) new_args = [ # Get comspec which is cmd.exe in most cases. os.environ.get("COMSPEC", "cmd.exe"), @@ -24,7 +28,7 @@ class LaunchWithWindowsShell(PreLaunchHook): "/c", # Convert arguments to command line arguments (as string) "\"{}\"".format( - subprocess.list2cmdline(self.launch_context.launch_args) + subprocess.list2cmdline(launch_args) ) ] # Convert list to string