-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into enhancement/fusion_launch_with_menu
- Loading branch information
Showing
74 changed files
with
2,399 additions
and
498 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,24 @@ | ||
name: 📇 Code Linting | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
pull_request: | ||
branches: [ develop ] | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number}} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: chartboost/ruff-action@v1 |
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 |
---|---|---|
|
@@ -77,6 +77,7 @@ dump.sql | |
|
||
# Poetry | ||
######## | ||
.poetry/ | ||
.python-version | ||
.editorconfig | ||
.pre-commit-config.yaml | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
flake8: | ||
enabled: true | ||
config_file: setup.cfg | ||
flake8: | ||
enabled: true | ||
config_file: setup.cfg |
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 |
---|---|---|
@@ -1,12 +1,27 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: no-commit-to-branch | ||
args: [ '--pattern', '^(?!((release|enhancement|feature|bugfix|documentation|tests|local|chore)\/[a-zA-Z0-9\-_]+)$).*' ] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: no-commit-to-branch | ||
args: [ '--pattern', '^(?!((release|enhancement|feature|bugfix|documentation|tests|local|chore)\/[a-zA-Z0-9\-_]+)$).*' ] | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.6 | ||
hooks: | ||
- id: codespell | ||
additional_dependencies: | ||
- tomli | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.3.3 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
# Run the formatter. | ||
# - id: ruff-format |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
from .addon import AfterEffectsAddon | ||
from .addon import ( | ||
AFTEREFFECTS_ADDON_ROOT, | ||
AfterEffectsAddon, | ||
get_launch_script_path, | ||
) | ||
|
||
|
||
__all__ = ( | ||
"AFTEREFFECTS_ADDON_ROOT", | ||
"AfterEffectsAddon", | ||
"get_launch_script_path", | ||
) |
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 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 |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
import functools | ||
import traceback | ||
|
||
|
||
from wsrpc_aiohttp import ( | ||
WebSocketRoute, | ||
WebSocketAsync | ||
|
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
91 changes: 91 additions & 0 deletions
91
client/ayon_core/hosts/aftereffects/hooks/pre_launch_args.py
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,91 @@ | ||
import os | ||
import platform | ||
import subprocess | ||
|
||
from ayon_core.lib import ( | ||
get_ayon_launcher_args, | ||
is_using_ayon_console, | ||
) | ||
from ayon_core.lib.applications import ( | ||
PreLaunchHook, | ||
LaunchTypes, | ||
) | ||
from ayon_core.hosts.aftereffects import get_launch_script_path | ||
|
||
|
||
def get_launch_kwargs(kwargs): | ||
"""Explicit setting of kwargs for Popen for AfterEffects. | ||
Expected behavior | ||
- ayon_console opens window with logs | ||
- ayon has stdout/stderr available for capturing | ||
Args: | ||
kwargs (Union[dict, None]): Current kwargs or None. | ||
""" | ||
if kwargs is None: | ||
kwargs = {} | ||
|
||
if platform.system().lower() != "windows": | ||
return kwargs | ||
|
||
if is_using_ayon_console(): | ||
kwargs.update({ | ||
"creationflags": subprocess.CREATE_NEW_CONSOLE | ||
}) | ||
else: | ||
kwargs.update({ | ||
"creationflags": subprocess.CREATE_NO_WINDOW, | ||
"stdout": subprocess.DEVNULL, | ||
"stderr": subprocess.DEVNULL | ||
}) | ||
return kwargs | ||
|
||
|
||
class AEPrelaunchHook(PreLaunchHook): | ||
"""Launch arguments preparation. | ||
Hook add python executable and script path to AE implementation before | ||
AE executable and add last workfile path to launch arguments. | ||
Existence of last workfile is checked. If workfile does not exists tries | ||
to copy templated workfile from predefined path. | ||
""" | ||
app_groups = {"aftereffects"} | ||
|
||
order = 20 | ||
launch_types = {LaunchTypes.local} | ||
|
||
def execute(self): | ||
# Pop executable | ||
executable_path = self.launch_context.launch_args.pop(0) | ||
|
||
# Pop rest of launch arguments - There should not be other arguments! | ||
remainders = [] | ||
while self.launch_context.launch_args: | ||
remainders.append(self.launch_context.launch_args.pop(0)) | ||
|
||
script_path = get_launch_script_path() | ||
|
||
new_launch_args = get_ayon_launcher_args( | ||
"run", script_path, executable_path | ||
) | ||
# Add workfile path if exists | ||
workfile_path = self.data["last_workfile_path"] | ||
if ( | ||
self.data.get("start_last_workfile") | ||
and workfile_path | ||
and os.path.exists(workfile_path) | ||
): | ||
new_launch_args.append(workfile_path) | ||
|
||
# Append as whole list as these arguments should not be separated | ||
self.launch_context.launch_args.append(new_launch_args) | ||
|
||
if remainders: | ||
self.launch_context.launch_args.extend(remainders) | ||
|
||
self.launch_context.kwargs = get_launch_kwargs( | ||
self.launch_context.kwargs | ||
) |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
from .addon import ( | ||
HARMONY_HOST_DIR, | ||
HARMONY_ADDON_ROOT, | ||
HarmonyAddon, | ||
get_launch_script_path, | ||
) | ||
|
||
|
||
__all__ = ( | ||
"HARMONY_HOST_DIR", | ||
"HARMONY_ADDON_ROOT", | ||
"HarmonyAddon", | ||
"get_launch_script_path", | ||
) |
Oops, something went wrong.