This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1684 from pypeclub/bugfix/stdout_stderr_applicati…
…on_launch Application launch stdout/stderr in GUI build
- Loading branch information
Showing
4 changed files
with
36 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import subprocess | ||
from openpype.lib import PreLaunchHook | ||
|
||
|
||
class LaunchFoundryAppsWindows(PreLaunchHook): | ||
"""Foundry applications have specific way how to launch them. | ||
Nuke is executed "like" python process so it is required to pass | ||
`CREATE_NEW_CONSOLE` flag on windows to trigger creation of new console. | ||
At the same time the newly created console won't create it's own stdout | ||
and stderr handlers so they should not be redirected to DEVNULL. | ||
""" | ||
|
||
# Should be as last hook because must change launch arguments to string | ||
order = 1000 | ||
app_groups = ["nuke", "nukex", "hiero", "nukestudio"] | ||
platforms = ["windows"] | ||
|
||
def execute(self): | ||
# Change `creationflags` to CREATE_NEW_CONSOLE | ||
# - on Windows will nuke create new window using it's console | ||
# Set `stdout` and `stderr` to None so new created console does not | ||
# have redirected output to DEVNULL in build | ||
self.launch_context.kwargs.update({ | ||
"creationflags": subprocess.CREATE_NEW_CONSOLE, | ||
"stdout": None, | ||
"stderr": None | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters