mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge branch 'develop' into enhancement/OP-8157_Use-AYON-settings
This commit is contained in:
commit
312f4c2cf9
42 changed files with 257 additions and 275 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,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
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ class MaxHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost):
|
|||
rt.callbacks.addScript(rt.Name('filePostOpen'),
|
||||
lib.check_colorspace)
|
||||
|
||||
rt.callbacks.addScript(rt.Name('postWorkspaceChange'),
|
||||
self._deferred_menu_creation)
|
||||
|
||||
def has_unsaved_changes(self):
|
||||
# TODO: how to get it from 3dsmax?
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import copy
|
|||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
import re
|
||||
|
||||
import pyblish.api
|
||||
from ayon_core.lib import (
|
||||
|
|
@ -35,6 +36,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
|||
"traypublisher",
|
||||
"substancepainter",
|
||||
"nuke",
|
||||
"aftereffects"
|
||||
]
|
||||
enabled = False
|
||||
|
||||
|
|
@ -49,6 +51,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
|||
# attribute presets from settings
|
||||
oiiotool_defaults = None
|
||||
ffmpeg_args = None
|
||||
product_names = []
|
||||
|
||||
def process(self, instance):
|
||||
# run main process
|
||||
|
|
@ -103,6 +106,26 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
|||
self.log.debug("Skipping crypto passes.")
|
||||
return
|
||||
|
||||
# We only want to process the subsets needed from settings.
|
||||
def validate_string_against_patterns(input_str, patterns):
|
||||
for pattern in patterns:
|
||||
if re.match(pattern, input_str):
|
||||
return True
|
||||
return False
|
||||
|
||||
product_names = self.product_names
|
||||
if product_names:
|
||||
result = validate_string_against_patterns(
|
||||
instance.data["subset"], product_names
|
||||
)
|
||||
if not result:
|
||||
self.log.debug(
|
||||
"Product name \"{}\" did not match settings filters: {}".format(
|
||||
instance.data["subset"], product_names
|
||||
)
|
||||
)
|
||||
return
|
||||
|
||||
# first check for any explicitly marked representations for thumbnail
|
||||
explicit_repres = self._get_explicit_repres_for_thumbnail(instance)
|
||||
if explicit_repres:
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
},
|
||||
"ExtractThumbnail": {
|
||||
"enabled": true,
|
||||
"subsets": [],
|
||||
"integrate_thumbnail": false,
|
||||
"background_color": [
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -176,6 +176,10 @@ class ExtractThumbnailOIIODefaultsModel(BaseSettingsModel):
|
|||
class ExtractThumbnailModel(BaseSettingsModel):
|
||||
_isGroup = True
|
||||
enabled: bool = SettingsField(True)
|
||||
product_names: list[str] = SettingsField(
|
||||
default_factory=list,
|
||||
title="Product names"
|
||||
)
|
||||
integrate_thumbnail: bool = SettingsField(
|
||||
True,
|
||||
title="Integrate Thumbnail Representation"
|
||||
|
|
@ -844,6 +848,7 @@ DEFAULT_PUBLISH_VALUES = {
|
|||
},
|
||||
"ExtractThumbnail": {
|
||||
"enabled": True,
|
||||
"product_names": [],
|
||||
"integrate_thumbnail": True,
|
||||
"target_size": {
|
||||
"type": "source"
|
||||
|
|
|
|||
|
|
@ -306,36 +306,38 @@ class PublishPluginsModel(BaseSettingsModel):
|
|||
default_factory=ValidateExpectedFilesModel,
|
||||
title="Validate Expected Files"
|
||||
)
|
||||
MayaSubmitDeadline: MayaSubmitDeadlineModel = SettingsField(
|
||||
default_factory=MayaSubmitDeadlineModel,
|
||||
title="Maya Submit to deadline")
|
||||
MaxSubmitDeadline: MaxSubmitDeadlineModel = SettingsField(
|
||||
default_factory=MaxSubmitDeadlineModel,
|
||||
title="Max Submit to deadline")
|
||||
FusionSubmitDeadline: FusionSubmitDeadlineModel = SettingsField(
|
||||
default_factory=FusionSubmitDeadlineModel,
|
||||
title="Fusion submit to Deadline")
|
||||
NukeSubmitDeadline: NukeSubmitDeadlineModel = SettingsField(
|
||||
default_factory=NukeSubmitDeadlineModel,
|
||||
title="Nuke Submit to deadline")
|
||||
HarmonySubmitDeadline: HarmonySubmitDeadlineModel = SettingsField(
|
||||
default_factory=HarmonySubmitDeadlineModel,
|
||||
title="Harmony Submit to deadline")
|
||||
AfterEffectsSubmitDeadline: AfterEffectsSubmitDeadlineModel = (
|
||||
SettingsField(
|
||||
default_factory=AfterEffectsSubmitDeadlineModel,
|
||||
title="After Effects to deadline"
|
||||
title="After Effects to deadline",
|
||||
section="Hosts"
|
||||
)
|
||||
)
|
||||
CelactionSubmitDeadline: CelactionSubmitDeadlineModel = SettingsField(
|
||||
default_factory=CelactionSubmitDeadlineModel,
|
||||
title="Celaction Submit Deadline")
|
||||
BlenderSubmitDeadline: BlenderSubmitDeadlineModel = SettingsField(
|
||||
default_factory=BlenderSubmitDeadlineModel,
|
||||
title="Blender Submit Deadline")
|
||||
CelactionSubmitDeadline: CelactionSubmitDeadlineModel = SettingsField(
|
||||
default_factory=CelactionSubmitDeadlineModel,
|
||||
title="Celaction Submit Deadline")
|
||||
FusionSubmitDeadline: FusionSubmitDeadlineModel = SettingsField(
|
||||
default_factory=FusionSubmitDeadlineModel,
|
||||
title="Fusion submit to Deadline")
|
||||
HarmonySubmitDeadline: HarmonySubmitDeadlineModel = SettingsField(
|
||||
default_factory=HarmonySubmitDeadlineModel,
|
||||
title="Harmony Submit to deadline")
|
||||
MaxSubmitDeadline: MaxSubmitDeadlineModel = SettingsField(
|
||||
default_factory=MaxSubmitDeadlineModel,
|
||||
title="Max Submit to deadline")
|
||||
MayaSubmitDeadline: MayaSubmitDeadlineModel = SettingsField(
|
||||
default_factory=MayaSubmitDeadlineModel,
|
||||
title="Maya Submit to deadline")
|
||||
NukeSubmitDeadline: NukeSubmitDeadlineModel = SettingsField(
|
||||
default_factory=NukeSubmitDeadlineModel,
|
||||
title="Nuke Submit to deadline")
|
||||
ProcessSubmittedCacheJobOnFarm: ProcessCacheJobFarmModel = SettingsField(
|
||||
default_factory=ProcessCacheJobFarmModel,
|
||||
title="Process submitted cache Job on farm.")
|
||||
title="Process submitted cache Job on farm.",
|
||||
section="Publish Jobs")
|
||||
ProcessSubmittedJobOnFarm: ProcessSubmittedJobOnFarmModel = SettingsField(
|
||||
default_factory=ProcessSubmittedJobOnFarmModel,
|
||||
title="Process submitted job on farm.")
|
||||
|
|
@ -357,6 +359,65 @@ DEFAULT_DEADLINE_PLUGINS_SETTINGS = {
|
|||
"deadline"
|
||||
]
|
||||
},
|
||||
"AfterEffectsSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"use_published": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10000,
|
||||
"group": "",
|
||||
"department": "",
|
||||
"multiprocess": True
|
||||
},
|
||||
"BlenderSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"use_published": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10,
|
||||
"group": "none",
|
||||
"job_delay": "00:00:00:00"
|
||||
},
|
||||
"CelactionSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"deadline_department": "",
|
||||
"deadline_priority": 50,
|
||||
"deadline_pool": "",
|
||||
"deadline_pool_secondary": "",
|
||||
"deadline_group": "",
|
||||
"deadline_chunk_size": 10,
|
||||
"deadline_job_delay": "00:00:00:00"
|
||||
},
|
||||
"FusionSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10,
|
||||
"concurrent_tasks": 1,
|
||||
"group": ""
|
||||
},
|
||||
"HarmonySubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"use_published": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10000,
|
||||
"group": "",
|
||||
"department": ""
|
||||
},
|
||||
"MaxSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"use_published": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10,
|
||||
"group": "none"
|
||||
},
|
||||
"MayaSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
|
|
@ -376,24 +437,6 @@ DEFAULT_DEADLINE_PLUGINS_SETTINGS = {
|
|||
"pluginInfo": "",
|
||||
"scene_patches": []
|
||||
},
|
||||
"MaxSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"use_published": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10,
|
||||
"group": "none"
|
||||
},
|
||||
"FusionSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10,
|
||||
"concurrent_tasks": 1,
|
||||
"group": ""
|
||||
},
|
||||
"NukeSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
|
|
@ -410,47 +453,6 @@ DEFAULT_DEADLINE_PLUGINS_SETTINGS = {
|
|||
"env_search_replace_values": [],
|
||||
"limit_groups": []
|
||||
},
|
||||
"HarmonySubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"use_published": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10000,
|
||||
"group": "",
|
||||
"department": ""
|
||||
},
|
||||
"AfterEffectsSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"use_published": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10000,
|
||||
"group": "",
|
||||
"department": "",
|
||||
"multiprocess": True
|
||||
},
|
||||
"CelactionSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"deadline_department": "",
|
||||
"deadline_priority": 50,
|
||||
"deadline_pool": "",
|
||||
"deadline_pool_secondary": "",
|
||||
"deadline_group": "",
|
||||
"deadline_chunk_size": 10,
|
||||
"deadline_job_delay": "00:00:00:00"
|
||||
},
|
||||
"BlenderSubmitDeadline": {
|
||||
"enabled": True,
|
||||
"optional": False,
|
||||
"active": True,
|
||||
"use_published": True,
|
||||
"priority": 50,
|
||||
"chunk_size": 10,
|
||||
"group": "none",
|
||||
"job_delay": "00:00:00:00"
|
||||
},
|
||||
"ProcessSubmittedCacheJobOnFarm": {
|
||||
"enabled": True,
|
||||
"deadline_department": "",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.1.8"
|
||||
__version__ = "0.1.9"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue