mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge branch 'develop' into enhancement/remove-legacy-io
This commit is contained in:
commit
fcc9c8ab2a
39 changed files with 158 additions and 341 deletions
|
|
@ -7,3 +7,6 @@ AYON_CORE_ROOT = os.path.dirname(os.path.abspath(__file__))
|
|||
PACKAGE_DIR = AYON_CORE_ROOT
|
||||
PLUGINS_DIR = os.path.join(AYON_CORE_ROOT, "plugins")
|
||||
AYON_SERVER_ENABLED = True
|
||||
|
||||
# Indicate if AYON entities should be used instead of OpenPype entities
|
||||
USE_AYON_ENTITIES = False
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ AYON addons should contain separated logic of specific kind of implementation, s
|
|||
- addon must implement `get_plugin_paths` which must return dictionary with possible keys `"publish"`, `"load"`, `"create"` or `"actions"`
|
||||
- each key may contain list or string with a path to directory with plugins
|
||||
|
||||
## ITrayModule
|
||||
## ITrayAddon
|
||||
- addon has more logic when used in a tray
|
||||
- it is possible that addon can be used only in the tray
|
||||
- abstract methods
|
||||
|
|
@ -46,7 +46,7 @@ AYON addons should contain separated logic of specific kind of implementation, s
|
|||
- if addon has logic only in tray or for both then should be checking for `tray_initialized` attribute to decide how should handle situations
|
||||
|
||||
### ITrayService
|
||||
- inherits from `ITrayModule` and implements `tray_menu` method for you
|
||||
- inherits from `ITrayAddon` and implements `tray_menu` method for you
|
||||
- adds action to submenu "Services" in tray widget menu with icon and label
|
||||
- abstract attribute `label`
|
||||
- label shown in menu
|
||||
|
|
@ -57,7 +57,7 @@ AYON addons should contain separated logic of specific kind of implementation, s
|
|||
- these states must be set by addon itself `set_service_running` is default state on initialization
|
||||
|
||||
### ITrayAction
|
||||
- inherits from `ITrayModule` and implements `tray_menu` method for you
|
||||
- inherits from `ITrayAddon` and implements `tray_menu` method for you
|
||||
- adds action to tray widget menu with label
|
||||
- abstract attribute `label`
|
||||
- label shown in menu
|
||||
|
|
@ -89,4 +89,4 @@ AYON addons should contain separated logic of specific kind of implementation, s
|
|||
|
||||
### TrayAddonsManager
|
||||
- inherits from `AddonsManager`
|
||||
- has specific implementation for Pype Tray tool and handle `ITrayModule` methods
|
||||
- has specific implementation for Pype Tray tool and handle `ITrayAddon` methods
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ method to convert 'click_wrap' object to 'click' object.
|
|||
Before
|
||||
```python
|
||||
import click
|
||||
from ayon_core.modules import AYONAddon
|
||||
from ayon_core.addon import AYONAddon
|
||||
|
||||
|
||||
class ExampleAddon(AYONAddon):
|
||||
|
|
@ -40,7 +40,7 @@ def mycommand(arg1, arg2):
|
|||
Now
|
||||
```
|
||||
from ayon_core import click_wrap
|
||||
from ayon_core.modules import AYONAddon
|
||||
from ayon_core.addon import AYONAddon
|
||||
|
||||
|
||||
class ExampleAddon(AYONAddon):
|
||||
|
|
@ -72,7 +72,7 @@ Added small enhancements:
|
|||
Example:
|
||||
```python
|
||||
from ayon_core import click_wrap
|
||||
from ayon_core.modules import AYONAddon
|
||||
from ayon_core.addon import AYONAddon
|
||||
|
||||
|
||||
class ExampleAddon(AYONAddon):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Package for handling pype command line arguments."""
|
||||
"""Package for handling AYON command line arguments."""
|
||||
import os
|
||||
import sys
|
||||
import code
|
||||
|
|
@ -31,22 +31,14 @@ class AliasedGroup(click.Group):
|
|||
|
||||
@click.group(cls=AliasedGroup, invoke_without_command=True)
|
||||
@click.pass_context
|
||||
@click.option("--use-version",
|
||||
expose_value=False, help="use specified version")
|
||||
@click.option("--use-staging", is_flag=True,
|
||||
expose_value=False, help="use staging variants")
|
||||
@click.option("--list-versions", is_flag=True, expose_value=False,
|
||||
help="list all detected versions.")
|
||||
@click.option("--validate-version", expose_value=False,
|
||||
help="validate given version integrity")
|
||||
@click.option("--debug", is_flag=True, expose_value=False,
|
||||
help="Enable debug")
|
||||
@click.option("--verbose", expose_value=False,
|
||||
help=("Change AYON log level (debug - critical or 0-50)"))
|
||||
@click.option("--automatic-tests", is_flag=True, expose_value=False,
|
||||
help=("Run in automatic tests mode"))
|
||||
def main_cli(ctx):
|
||||
"""Pype is main command serving as entry point to pipeline system.
|
||||
"""AYON is main command serving as entry point to pipeline system.
|
||||
|
||||
It wraps different commands together.
|
||||
"""
|
||||
|
|
@ -62,10 +54,10 @@ def main_cli(ctx):
|
|||
|
||||
@main_cli.command()
|
||||
def tray():
|
||||
"""Launch pype tray.
|
||||
"""Launch AYON tray.
|
||||
|
||||
Default action of pype command is to launch tray widget to control basic
|
||||
aspects of pype. See documentation for more information.
|
||||
Default action of AYON command is to launch tray widget to control basic
|
||||
aspects of AYON. See documentation for more information.
|
||||
"""
|
||||
Commands.launch_tray()
|
||||
|
||||
|
|
@ -99,7 +91,7 @@ def extractenvironments(output_json_path, project, asset, task, app, envgroup):
|
|||
|
||||
Entered output filepath will be created if does not exists.
|
||||
|
||||
All context options must be passed otherwise only pype's global
|
||||
All context options must be passed otherwise only AYON's global
|
||||
environments will be extracted.
|
||||
|
||||
Context options are "project", "asset", "task", "app"
|
||||
|
|
@ -166,7 +158,7 @@ def contextselection(
|
|||
allow_extra_args=True))
|
||||
@click.argument("script", required=True, type=click.Path(exists=True))
|
||||
def run(script):
|
||||
"""Run python script in Pype context."""
|
||||
"""Run python script in AYON context."""
|
||||
import runpy
|
||||
|
||||
if not script:
|
||||
|
|
@ -177,58 +169,12 @@ def run(script):
|
|||
args.remove("run")
|
||||
args.remove(script)
|
||||
sys.argv = args
|
||||
|
||||
args_string = " ".join(args[1:])
|
||||
print(f"... running: {script} {args_string}")
|
||||
runpy.run_path(script, run_name="__main__", )
|
||||
|
||||
|
||||
@main_cli.command()
|
||||
@click.argument("folder", nargs=-1)
|
||||
@click.option("-m",
|
||||
"--mark",
|
||||
help="Run tests marked by",
|
||||
default=None)
|
||||
@click.option("-p",
|
||||
"--pyargs",
|
||||
help="Run tests from package",
|
||||
default=None)
|
||||
@click.option("-t",
|
||||
"--test_data_folder",
|
||||
help="Unzipped directory path of test file",
|
||||
default=None)
|
||||
@click.option("-s",
|
||||
"--persist",
|
||||
help="Persist test DB and published files after test end",
|
||||
default=None)
|
||||
@click.option("-a",
|
||||
"--app_variant",
|
||||
help="Provide specific app variant for test, empty for latest",
|
||||
default=None)
|
||||
@click.option("--app_group",
|
||||
help="Provide specific app group for test, empty for default",
|
||||
default=None)
|
||||
@click.option("-t",
|
||||
"--timeout",
|
||||
help="Provide specific timeout value for test case",
|
||||
default=None)
|
||||
@click.option("-so",
|
||||
"--setup_only",
|
||||
help="Only create dbs, do not run tests",
|
||||
default=None)
|
||||
@click.option("--mongo_url",
|
||||
help="MongoDB for testing.",
|
||||
default=None)
|
||||
@click.option("--dump_databases",
|
||||
help="Dump all databases to data folder.",
|
||||
default=None)
|
||||
def runtests(folder, mark, pyargs, test_data_folder, persist, app_variant,
|
||||
timeout, setup_only, mongo_url, app_group, dump_databases):
|
||||
"""Run all automatic tests after proper initialization via start.py"""
|
||||
Commands.run_tests(folder, mark, pyargs, test_data_folder,
|
||||
persist, app_variant, timeout, setup_only,
|
||||
mongo_url, app_group, dump_databases)
|
||||
|
||||
|
||||
@main_cli.command()
|
||||
def interactive():
|
||||
"""Interactive (Python like) console.
|
||||
|
|
@ -264,7 +210,7 @@ def _set_global_environments() -> None:
|
|||
|
||||
# first resolve general environment because merge doesn't expect
|
||||
# values to be list.
|
||||
# TODO: switch to OpenPype environment functions
|
||||
# TODO: switch to AYON environment functions
|
||||
merged_env = acre.merge(
|
||||
acre.compute(acre.parse(general_env), cleanup=False),
|
||||
dict(os.environ)
|
||||
|
|
@ -284,10 +230,7 @@ def _set_global_environments() -> None:
|
|||
|
||||
|
||||
def _set_addons_environments():
|
||||
"""Set global environments for OpenPype modules.
|
||||
|
||||
This requires to have OpenPype in `sys.path`.
|
||||
"""
|
||||
"""Set global environments for AYON addons."""
|
||||
|
||||
addons_manager = AddonsManager()
|
||||
|
||||
|
|
@ -304,9 +247,9 @@ def main(*args, **kwargs):
|
|||
split_paths = python_path.split(os.pathsep)
|
||||
|
||||
additional_paths = [
|
||||
# add OpenPype tools
|
||||
# add AYON tools for 'pyblish_pype'
|
||||
os.path.join(AYON_CORE_ROOT, "tools"),
|
||||
# add common OpenPype vendor
|
||||
# add common AYON vendor
|
||||
# (common for multiple Python interpreter versions)
|
||||
os.path.join(AYON_CORE_ROOT, "vendor", "python", "common")
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Implementation of Pype commands."""
|
||||
"""Implementation of AYON commands."""
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
|
||||
|
||||
class Commands:
|
||||
"""Class implementing commands used by Pype.
|
||||
"""Class implementing commands used by AYON.
|
||||
|
||||
Most of its methods are called by :mod:`cli` module.
|
||||
"""
|
||||
|
|
@ -171,78 +171,3 @@ class Commands:
|
|||
from ayon_core.tools.context_dialog import main
|
||||
|
||||
main(output_path, project_name, asset_name, strict)
|
||||
|
||||
@staticmethod
|
||||
def run_tests(folder, mark, pyargs,
|
||||
test_data_folder, persist, app_variant, timeout, setup_only,
|
||||
mongo_url, app_group, dump_databases):
|
||||
"""
|
||||
Runs tests from 'folder'
|
||||
|
||||
Args:
|
||||
folder (str): relative path to folder with tests
|
||||
mark (str): label to run tests marked by it (slow etc)
|
||||
pyargs (str): package path to test
|
||||
test_data_folder (str): url to unzipped folder of test data
|
||||
persist (bool): True if keep test db and published after test
|
||||
end
|
||||
app_variant (str): variant (eg 2020 for AE), empty if use
|
||||
latest installed version
|
||||
timeout (int): explicit timeout for single test
|
||||
setup_only (bool): if only preparation steps should be
|
||||
triggered, no tests (useful for debugging/development)
|
||||
mongo_url (str): url to Openpype Mongo database
|
||||
"""
|
||||
print("run_tests")
|
||||
if folder:
|
||||
folder = " ".join(list(folder))
|
||||
else:
|
||||
folder = "../tests"
|
||||
|
||||
# disable warnings and show captured stdout even if success
|
||||
args = [
|
||||
"--disable-pytest-warnings",
|
||||
"--capture=sys",
|
||||
"--print",
|
||||
"-W ignore::DeprecationWarning",
|
||||
"-rP",
|
||||
folder
|
||||
]
|
||||
|
||||
if mark:
|
||||
args.extend(["-m", mark])
|
||||
|
||||
if pyargs:
|
||||
args.extend(["--pyargs", pyargs])
|
||||
|
||||
if test_data_folder:
|
||||
args.extend(["--test_data_folder", test_data_folder])
|
||||
|
||||
if persist:
|
||||
args.extend(["--persist", persist])
|
||||
|
||||
if app_group:
|
||||
args.extend(["--app_group", app_group])
|
||||
|
||||
if app_variant:
|
||||
args.extend(["--app_variant", app_variant])
|
||||
|
||||
if timeout:
|
||||
args.extend(["--timeout", timeout])
|
||||
|
||||
if setup_only:
|
||||
args.extend(["--setup_only", setup_only])
|
||||
|
||||
if mongo_url:
|
||||
args.extend(["--mongo_url", mongo_url])
|
||||
|
||||
if dump_databases:
|
||||
msg = "dump_databases format is not recognized: {}".format(
|
||||
dump_databases
|
||||
)
|
||||
assert dump_databases in ["bson", "json"], msg
|
||||
args.extend(["--dump_databases", dump_databases])
|
||||
|
||||
print("run_tests args: {}".format(args))
|
||||
import pytest
|
||||
pytest.main(args)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
|
||||
class AfterEffectsAddon(OpenPypeModule, IHostAddon):
|
||||
class AfterEffectsAddon(AYONAddon, IHostAddon):
|
||||
name = "aftereffects"
|
||||
host_name = "aftereffects"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
"""Modify environments to contain all required for implementation."""
|
||||
defaults = {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
BLENDER_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class BlenderAddon(OpenPypeModule, IHostAddon):
|
||||
class BlenderAddon(AYONAddon, IHostAddon):
|
||||
name = "blender"
|
||||
host_name = "blender"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
"""Modify environments to contain all required for implementation."""
|
||||
# Prepare path to implementation script
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
CELACTION_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class CelactionAddon(OpenPypeModule, IHostAddon):
|
||||
class CelactionAddon(AYONAddon, IHostAddon):
|
||||
name = "celaction"
|
||||
host_name = "celaction"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def get_launch_hook_paths(self, app):
|
||||
if app.host_name != self.host_name:
|
||||
return []
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
HOST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class FlameAddon(OpenPypeModule, IHostAddon):
|
||||
class FlameAddon(AYONAddon, IHostAddon):
|
||||
name = "flame"
|
||||
host_name = "flame"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
# Add requirements to DL_PYTHON_HOOK_PATH
|
||||
env["DL_PYTHON_HOOK_PATH"] = os.path.join(HOST_DIR, "startup")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
import re
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
from ayon_core.lib import Logger
|
||||
|
||||
FUSION_HOST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
|
@ -48,13 +48,10 @@ def get_fusion_version(app_name):
|
|||
)
|
||||
|
||||
|
||||
class FusionAddon(OpenPypeModule, IHostAddon):
|
||||
class FusionAddon(AYONAddon, IHostAddon):
|
||||
name = "fusion"
|
||||
host_name = "fusion"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def get_launch_hook_paths(self, app):
|
||||
if app.host_name != self.host_name:
|
||||
return []
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
HARMONY_HOST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class HarmonyAddon(OpenPypeModule, IHostAddon):
|
||||
class HarmonyAddon(AYONAddon, IHostAddon):
|
||||
name = "harmony"
|
||||
host_name = "harmony"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
"""Modify environments to contain all required for implementation."""
|
||||
openharmony_path = os.path.join(
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
import os
|
||||
import platform
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
HIERO_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class HieroAddon(OpenPypeModule, IHostAddon):
|
||||
class HieroAddon(AYONAddon, IHostAddon):
|
||||
name = "hiero"
|
||||
host_name = "hiero"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
# Add requirements to HIERO_PLUGIN_PATH
|
||||
new_hiero_paths = [
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
HOUDINI_HOST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class HoudiniAddon(OpenPypeModule, IHostAddon):
|
||||
class HoudiniAddon(AYONAddon, IHostAddon):
|
||||
name = "houdini"
|
||||
host_name = "houdini"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
# Add requirements to HOUDINI_PATH and HOUDINI_MENU_PATH
|
||||
startup_path = os.path.join(HOUDINI_HOST_DIR, "startup")
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import re
|
|||
import uuid
|
||||
import logging
|
||||
import json
|
||||
from contextlib import contextmanager
|
||||
|
||||
import six
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
MAX_HOST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class MaxAddon(OpenPypeModule, IHostAddon):
|
||||
class MaxAddon(AYONAddon, IHostAddon):
|
||||
name = "max"
|
||||
host_name = "max"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
# Remove auto screen scale factor for Qt
|
||||
# - let 3dsmax decide it's value
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
MAYA_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class MayaAddon(OpenPypeModule, IHostAddon):
|
||||
class MayaAddon(AYONAddon, IHostAddon):
|
||||
name = "maya"
|
||||
host_name = "maya"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
# Add requirements to PYTHONPATH
|
||||
new_python_paths = [
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
import os
|
||||
import platform
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
NUKE_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class NukeAddon(OpenPypeModule, IHostAddon):
|
||||
class NukeAddon(AYONAddon, IHostAddon):
|
||||
name = "nuke"
|
||||
host_name = "nuke"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
# Add requirements to NUKE_PATH
|
||||
new_nuke_paths = [
|
||||
|
|
|
|||
|
|
@ -112,8 +112,6 @@ class AlembicCameraLoader(load.LoaderPlugin):
|
|||
project_name = get_current_project_name()
|
||||
version_doc = get_version_by_id(project_name, representation["parent"])
|
||||
|
||||
object_name = container["node"]
|
||||
|
||||
# get main variables
|
||||
version_data = version_doc.get("data", {})
|
||||
vname = version_doc.get("name", None)
|
||||
|
|
@ -139,7 +137,7 @@ class AlembicCameraLoader(load.LoaderPlugin):
|
|||
file = get_representation_path(representation).replace("\\", "/")
|
||||
|
||||
with maintained_selection():
|
||||
camera_node = nuke.toNode(object_name)
|
||||
camera_node = container["node"]
|
||||
camera_node['selected'].setValue(True)
|
||||
|
||||
# collect input output dependencies
|
||||
|
|
@ -154,9 +152,10 @@ class AlembicCameraLoader(load.LoaderPlugin):
|
|||
xpos = camera_node.xpos()
|
||||
ypos = camera_node.ypos()
|
||||
nuke.nodeCopy("%clipboard%")
|
||||
camera_name = camera_node.name()
|
||||
nuke.delete(camera_node)
|
||||
nuke.nodePaste("%clipboard%")
|
||||
camera_node = nuke.toNode(object_name)
|
||||
camera_node = nuke.toNode(camera_name)
|
||||
camera_node.setXYpos(xpos, ypos)
|
||||
|
||||
# link to original input nodes
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class ValidateNukeWriteNode(
|
|||
and key != "file"
|
||||
and key != "tile_color"
|
||||
):
|
||||
check.append([key, node_value, write_node[key].value()])
|
||||
check.append([key, fixed_values, write_node[key].value()])
|
||||
|
||||
if check:
|
||||
self._make_error(check)
|
||||
|
|
@ -137,7 +137,7 @@ class ValidateNukeWriteNode(
|
|||
def _make_error(self, check):
|
||||
# sourcery skip: merge-assign-and-aug-assign, move-assign-in-block
|
||||
dbg_msg = "Write node's knobs values are not correct!\n"
|
||||
msg_add = "Knob '{0}' > Correct: `{1}` > Wrong: `{2}`"
|
||||
msg_add = "Knob '{0}' > Expected: `{1}` > Current: `{2}`"
|
||||
|
||||
details = [
|
||||
msg_add.format(item[0], item[1], item[2])
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
PHOTOSHOP_HOST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class PhotoshopAddon(OpenPypeModule, IHostAddon):
|
||||
class PhotoshopAddon(AYONAddon, IHostAddon):
|
||||
name = "photoshop"
|
||||
host_name = "photoshop"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
"""Modify environments to contain all required for implementation."""
|
||||
defaults = {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
import os
|
||||
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
from .utils import RESOLVE_ROOT_DIR
|
||||
|
||||
|
||||
class ResolveAddon(OpenPypeModule, IHostAddon):
|
||||
class ResolveAddon(AYONAddon, IHostAddon):
|
||||
name = "resolve"
|
||||
host_name = "resolve"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def get_launch_hook_paths(self, app):
|
||||
if app.host_name != self.host_name:
|
||||
return []
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ def ensure_installed_host():
|
|||
|
||||
|
||||
def launch_menu():
|
||||
print("Launching Resolve OpenPype menu..")
|
||||
print("Launching Resolve AYON menu..")
|
||||
ensure_installed_host()
|
||||
ayon_core.hosts.resolve.api.launch_pype_menu()
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ def main():
|
|||
else:
|
||||
log.info("No last workfile set to open. Skipping..")
|
||||
|
||||
# Launch OpenPype menu
|
||||
# Launch AYON menu
|
||||
from ayon_core.settings import get_project_settings
|
||||
from ayon_core.pipeline.context_tools import get_current_project_name
|
||||
project_name = get_current_project_name()
|
||||
|
|
@ -62,7 +62,7 @@ def main():
|
|||
|
||||
settings = get_project_settings(project_name)
|
||||
if settings.get("resolve", {}).get("launch_openpype_menu_on_start", True):
|
||||
log.info("Launching OpenPype menu..")
|
||||
log.info("Launching AYON menu..")
|
||||
launch_menu()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
SUBSTANCE_HOST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class SubstanceAddon(OpenPypeModule, IHostAddon):
|
||||
class SubstanceAddon(AYONAddon, IHostAddon):
|
||||
name = "substancepainter"
|
||||
host_name = "substancepainter"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
# Add requirements to SUBSTANCE_PAINTER_PLUGINS_PATH
|
||||
plugin_path = os.path.join(SUBSTANCE_HOST_DIR, "deploy")
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import os
|
|||
|
||||
from ayon_core.lib import get_ayon_launcher_args
|
||||
from ayon_core.lib.execute import run_detached_process
|
||||
from ayon_core.modules import (
|
||||
from ayon_core.addon import (
|
||||
click_wrap,
|
||||
OpenPypeModule,
|
||||
AYONAddon,
|
||||
ITrayAction,
|
||||
IHostAddon,
|
||||
)
|
||||
|
|
@ -12,13 +12,12 @@ from ayon_core.modules import (
|
|||
TRAYPUBLISH_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class TrayPublishAddon(OpenPypeModule, IHostAddon, ITrayAction):
|
||||
class TrayPublishAddon(AYONAddon, IHostAddon, ITrayAction):
|
||||
label = "Publisher"
|
||||
name = "traypublisher"
|
||||
host_name = "traypublisher"
|
||||
|
||||
def initialize(self, modules_settings):
|
||||
self.enabled = True
|
||||
def initialize(self, settings):
|
||||
self.publish_paths = [
|
||||
os.path.join(TRAYPUBLISH_ROOT_DIR, "plugins", "publish")
|
||||
]
|
||||
|
|
@ -36,7 +35,7 @@ class TrayPublishAddon(OpenPypeModule, IHostAddon, ITrayAction):
|
|||
|
||||
def run_traypublisher(self):
|
||||
args = get_ayon_launcher_args(
|
||||
"module", self.name, "launch"
|
||||
"addon", self.name, "launch"
|
||||
)
|
||||
run_detached_process(args)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
from ayon_core.modules import OpenPypeModule, IHostAddon
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
TVPAINT_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
|
@ -12,13 +12,10 @@ def get_launch_script_path():
|
|||
)
|
||||
|
||||
|
||||
class TVPaintAddon(OpenPypeModule, IHostAddon):
|
||||
class TVPaintAddon(AYONAddon, IHostAddon):
|
||||
name = "tvpaint"
|
||||
host_name = "tvpaint"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def add_implementation_envs(self, env, _app):
|
||||
"""Modify environments to contain all required for implementation."""
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
import os
|
||||
import re
|
||||
from ayon_core.modules import IHostAddon, OpenPypeModule
|
||||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
|
||||
UNREAL_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class UnrealAddon(OpenPypeModule, IHostAddon):
|
||||
class UnrealAddon(AYONAddon, IHostAddon):
|
||||
name = "unreal"
|
||||
host_name = "unreal"
|
||||
|
||||
def initialize(self, module_settings):
|
||||
self.enabled = True
|
||||
|
||||
def get_global_environments(self):
|
||||
return {
|
||||
"AYON_UNREAL_ROOT": UNREAL_ROOT_DIR,
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ class AYONSecureRegistry:
|
|||
Registry should be used for private data that should be available only for
|
||||
user.
|
||||
|
||||
All passed registry names will have added prefix `OpenPype/` to easier
|
||||
identify which data were created by OpenPype.
|
||||
All passed registry names will have added prefix `AYON/` to easier
|
||||
identify which data were created by AYON.
|
||||
|
||||
Args:
|
||||
name(str): Name of registry used as identifier for data.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
"""Job queue OpenPype module was created for remote execution of commands.
|
||||
"""Job queue AYON addon was created for remote execution of commands.
|
||||
|
||||
## Why is needed
|
||||
Primarily created for hosts which are not easilly controlled from command line
|
||||
|
|
@ -30,7 +30,7 @@ workstations know where to send or receive jobs.
|
|||
|
||||
### start_worker
|
||||
- start worker which will process jobs
|
||||
- has required possitional argument which is application name from OpenPype
|
||||
- has required possitional argument which is application name from AYON
|
||||
settings e.g. 'tvpaint/11-5' ('tvpaint' is group '11-5' is variant)
|
||||
- it is possible to specify server url but url from settings is used when not
|
||||
passed (this is added mainly for developing purposes)
|
||||
|
|
|
|||
|
|
@ -1,19 +1,14 @@
|
|||
import os
|
||||
|
||||
from ayon_core import AYON_CORE_ROOT
|
||||
from ayon_core.modules import (
|
||||
OpenPypeModule,
|
||||
ITrayAction,
|
||||
)
|
||||
from ayon_core.addon import AYONAddon, ITrayAction
|
||||
|
||||
|
||||
class LauncherAction(OpenPypeModule, ITrayAction):
|
||||
class LauncherAction(AYONAddon, ITrayAction):
|
||||
label = "Launcher"
|
||||
name = "launcher_tool"
|
||||
|
||||
def initialize(self, _modules_settings):
|
||||
# This module is always enabled
|
||||
self.enabled = True
|
||||
def initialize(self, settings):
|
||||
|
||||
# Tray attributes
|
||||
self._window = None
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
from ayon_core.modules import AYONAddon, ITrayModule
|
||||
|
||||
|
||||
class LibraryLoaderAddon(AYONAddon, ITrayModule):
|
||||
name = "library_tool"
|
||||
|
||||
def initialize(self, modules_settings):
|
||||
# Tray attributes
|
||||
self._library_loader_imported = None
|
||||
self._library_loader_window = None
|
||||
|
||||
def tray_init(self):
|
||||
# Add library tool
|
||||
self._library_loader_imported = False
|
||||
try:
|
||||
from ayon_core.tools.loader.ui import LoaderWindow
|
||||
|
||||
self._library_loader_imported = True
|
||||
except Exception:
|
||||
self.log.warning(
|
||||
"Couldn't load Library loader tool for tray.",
|
||||
exc_info=True
|
||||
)
|
||||
|
||||
# Definition of Tray menu
|
||||
def tray_menu(self, tray_menu):
|
||||
if not self._library_loader_imported:
|
||||
return
|
||||
|
||||
from qtpy import QtWidgets
|
||||
# Actions
|
||||
action_library_loader = QtWidgets.QAction(
|
||||
"Loader", tray_menu
|
||||
)
|
||||
|
||||
action_library_loader.triggered.connect(self.show_library_loader)
|
||||
|
||||
tray_menu.addAction(action_library_loader)
|
||||
|
||||
def tray_start(self, *_a, **_kw):
|
||||
return
|
||||
|
||||
def tray_exit(self, *_a, **_kw):
|
||||
return
|
||||
|
||||
def show_library_loader(self):
|
||||
if self._library_loader_window is None:
|
||||
from ayon_core.pipeline import install_ayon_plugins
|
||||
|
||||
self._init_library_loader()
|
||||
|
||||
install_ayon_plugins()
|
||||
|
||||
self._library_loader_window.show()
|
||||
|
||||
# Raise and activate the window
|
||||
# for MacOS
|
||||
self._library_loader_window.raise_()
|
||||
# for Windows
|
||||
self._library_loader_window.activateWindow()
|
||||
|
||||
def _init_library_loader(self):
|
||||
from ayon_core.tools.loader.ui import LoaderWindow
|
||||
|
||||
libraryloader = LoaderWindow()
|
||||
|
||||
self._library_loader_window = libraryloader
|
||||
67
client/ayon_core/modules/loader_action.py
Normal file
67
client/ayon_core/modules/loader_action.py
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
from ayon_core.addon import AYONAddon, ITrayAddon
|
||||
|
||||
|
||||
class LoaderAddon(AYONAddon, ITrayAddon):
|
||||
name = "loader_tool"
|
||||
|
||||
def initialize(self, settings):
|
||||
# Tray attributes
|
||||
self._loader_imported = None
|
||||
self._loader_window = None
|
||||
|
||||
def tray_init(self):
|
||||
# Add library tool
|
||||
self._loader_imported = False
|
||||
try:
|
||||
from ayon_core.tools.loader.ui import LoaderWindow
|
||||
|
||||
self._loader_imported = True
|
||||
except Exception:
|
||||
self.log.warning(
|
||||
"Couldn't load Loader tool for tray.",
|
||||
exc_info=True
|
||||
)
|
||||
|
||||
# Definition of Tray menu
|
||||
def tray_menu(self, tray_menu):
|
||||
if not self._loader_imported:
|
||||
return
|
||||
|
||||
from qtpy import QtWidgets
|
||||
# Actions
|
||||
action_loader = QtWidgets.QAction(
|
||||
"Loader", tray_menu
|
||||
)
|
||||
|
||||
action_loader.triggered.connect(self.show_loader)
|
||||
|
||||
tray_menu.addAction(action_loader)
|
||||
|
||||
def tray_start(self, *_a, **_kw):
|
||||
return
|
||||
|
||||
def tray_exit(self, *_a, **_kw):
|
||||
return
|
||||
|
||||
def show_loader(self):
|
||||
if self._loader_window is None:
|
||||
from ayon_core.pipeline import install_ayon_plugins
|
||||
|
||||
self._init_loader()
|
||||
|
||||
install_ayon_plugins()
|
||||
|
||||
self._loader_window.show()
|
||||
|
||||
# Raise and activate the window
|
||||
# for MacOS
|
||||
self._loader_window.raise_()
|
||||
# for Windows
|
||||
self._loader_window.activateWindow()
|
||||
|
||||
def _init_loader(self):
|
||||
from ayon_core.tools.loader.ui import LoaderWindow
|
||||
|
||||
libraryloader = LoaderWindow()
|
||||
|
||||
self._loader_window = libraryloader
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
from .module import (
|
||||
from .addon import (
|
||||
PythonInterpreterAction
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
from ayon_core.modules import OpenPypeModule, ITrayAction
|
||||
from ayon_core.addon import AYONAddon, ITrayAction
|
||||
|
||||
|
||||
class PythonInterpreterAction(OpenPypeModule, ITrayAction):
|
||||
class PythonInterpreterAction(AYONAddon, ITrayAction):
|
||||
label = "Console"
|
||||
name = "python_interpreter"
|
||||
admin_action = True
|
||||
|
||||
def initialize(self, modules_settings):
|
||||
self.enabled = True
|
||||
def initialize(self, settings):
|
||||
self._interpreter_window = None
|
||||
|
||||
def tray_init(self):
|
||||
|
|
@ -22,7 +21,7 @@ class PythonInterpreterAction(OpenPypeModule, ITrayAction):
|
|||
if self._interpreter_window:
|
||||
return
|
||||
|
||||
from openpype_modules.python_console_interpreter.window import (
|
||||
from ayon_core.modules.python_console_interpreter.window import (
|
||||
PythonInterpreterWidget
|
||||
)
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ class WidgetUserIdle(QtWidgets.QWidget):
|
|||
def __init__(self, module):
|
||||
super(WidgetUserIdle, self).__init__()
|
||||
|
||||
self.setWindowTitle("OpenPype - Stop timers")
|
||||
self.setWindowTitle("AYON - Stop timers")
|
||||
|
||||
icon = QtGui.QIcon(resources.get_ayon_icon_filepath())
|
||||
self.setWindowIcon(icon)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"""WebServerAddon spawns aiohttp server in asyncio loop.
|
||||
|
||||
Main usage of the module is in OpenPype tray where make sense to add ability
|
||||
Main usage of the module is in AYON tray where make sense to add ability
|
||||
of other modules to add theirs routes. Module which would want use that
|
||||
option must have implemented method `webserver_initialization` which must
|
||||
expect `WebServerManager` object where is possible to add routes or paths
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ def match_aov_pattern(host_name, aov_patterns, render_file_name):
|
|||
that we have grabbed from `exp_files`.
|
||||
|
||||
Args:
|
||||
app (str): Host name.
|
||||
host_name (str): Host name.
|
||||
aov_patterns (dict): AOV patterns from AOV filters.
|
||||
render_file_name (str): Incoming file name to match against.
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
|||
"traypublisher",
|
||||
"substancepainter",
|
||||
"nuke",
|
||||
"aftereffects"
|
||||
]
|
||||
enabled = False
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ def _load_font():
|
|||
|
||||
|
||||
def load_stylesheet():
|
||||
"""Load and return OpenPype Qt stylesheet."""
|
||||
"""Load and return AYON Qt stylesheet."""
|
||||
|
||||
if _Cache.stylesheet is None:
|
||||
_Cache.stylesheet = _load_stylesheet()
|
||||
|
|
@ -207,7 +207,7 @@ def load_stylesheet():
|
|||
|
||||
|
||||
def get_app_icon_path():
|
||||
"""Path to OpenPype icon."""
|
||||
"""Path to AYON icon."""
|
||||
return resources.get_ayon_icon_filepath()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from qtpy import QtWidgets, QtCore
|
|||
import qtawesome
|
||||
import appdirs
|
||||
|
||||
from ayon_core.lib import JSONSettingRegistry
|
||||
from ayon_core.lib import JSONSettingRegistry, is_running_from_build
|
||||
from ayon_core.pipeline import install_host
|
||||
from ayon_core.hosts.traypublisher.api import TrayPublisherHost
|
||||
from ayon_core.tools.publisher.control_qt import QtPublisherController
|
||||
|
|
@ -35,7 +35,7 @@ class TrayPublisherController(QtPublisherController):
|
|||
|
||||
|
||||
class TrayPublisherRegistry(JSONSettingRegistry):
|
||||
"""Class handling OpenPype general settings registry.
|
||||
"""Class handling AYON general settings registry.
|
||||
|
||||
Attributes:
|
||||
vendor (str): Name used for path construction.
|
||||
|
|
@ -265,7 +265,7 @@ def main():
|
|||
|
||||
app_instance = get_ayon_qt_app()
|
||||
|
||||
if platform.system().lower() == "windows":
|
||||
if not is_running_from_build() and platform.system().lower() == "windows":
|
||||
import ctypes
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
|
||||
u"traypublisher"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue