From 3365919d966b7ddfd687d12e53153e9d3a9205fd Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:31:54 +0100 Subject: [PATCH 1/5] host addons inherit from AYONAddon --- client/ayon_core/hosts/aftereffects/addon.py | 7 ++----- client/ayon_core/hosts/blender/addon.py | 7 ++----- client/ayon_core/hosts/celaction/addon.py | 7 ++----- client/ayon_core/hosts/flame/addon.py | 7 ++----- client/ayon_core/hosts/fusion/addon.py | 7 ++----- client/ayon_core/hosts/harmony/addon.py | 7 ++----- client/ayon_core/hosts/hiero/addon.py | 7 ++----- client/ayon_core/hosts/houdini/addon.py | 7 ++----- client/ayon_core/hosts/max/addon.py | 7 ++----- client/ayon_core/hosts/maya/addon.py | 7 ++----- client/ayon_core/hosts/nuke/addon.py | 7 ++----- client/ayon_core/hosts/photoshop/addon.py | 7 ++----- client/ayon_core/hosts/resolve/addon.py | 7 ++----- client/ayon_core/hosts/substancepainter/addon.py | 7 ++----- client/ayon_core/hosts/traypublisher/addon.py | 11 +++++------ client/ayon_core/hosts/tvpaint/addon.py | 7 ++----- client/ayon_core/hosts/unreal/addon.py | 7 ++----- 17 files changed, 37 insertions(+), 86 deletions(-) diff --git a/client/ayon_core/hosts/aftereffects/addon.py b/client/ayon_core/hosts/aftereffects/addon.py index 278f836a72..46d0818247 100644 --- a/client/ayon_core/hosts/aftereffects/addon.py +++ b/client/ayon_core/hosts/aftereffects/addon.py @@ -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 = { diff --git a/client/ayon_core/hosts/blender/addon.py b/client/ayon_core/hosts/blender/addon.py index c3804382e5..b7484de243 100644 --- a/client/ayon_core/hosts/blender/addon.py +++ b/client/ayon_core/hosts/blender/addon.py @@ -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 diff --git a/client/ayon_core/hosts/celaction/addon.py b/client/ayon_core/hosts/celaction/addon.py index 4573ee7e56..d00401a2e0 100644 --- a/client/ayon_core/hosts/celaction/addon.py +++ b/client/ayon_core/hosts/celaction/addon.py @@ -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 [] diff --git a/client/ayon_core/hosts/flame/addon.py b/client/ayon_core/hosts/flame/addon.py index e30d7cab08..f5560cde7a 100644 --- a/client/ayon_core/hosts/flame/addon.py +++ b/client/ayon_core/hosts/flame/addon.py @@ -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") diff --git a/client/ayon_core/hosts/fusion/addon.py b/client/ayon_core/hosts/fusion/addon.py index 7eff2d93c8..391ee770c4 100644 --- a/client/ayon_core/hosts/fusion/addon.py +++ b/client/ayon_core/hosts/fusion/addon.py @@ -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 [] diff --git a/client/ayon_core/hosts/harmony/addon.py b/client/ayon_core/hosts/harmony/addon.py index 172a1f104f..476d569415 100644 --- a/client/ayon_core/hosts/harmony/addon.py +++ b/client/ayon_core/hosts/harmony/addon.py @@ -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( diff --git a/client/ayon_core/hosts/hiero/addon.py b/client/ayon_core/hosts/hiero/addon.py index 447700e2e1..f612493ca1 100644 --- a/client/ayon_core/hosts/hiero/addon.py +++ b/client/ayon_core/hosts/hiero/addon.py @@ -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 = [ diff --git a/client/ayon_core/hosts/houdini/addon.py b/client/ayon_core/hosts/houdini/addon.py index 34d140db3c..95d714aea1 100644 --- a/client/ayon_core/hosts/houdini/addon.py +++ b/client/ayon_core/hosts/houdini/addon.py @@ -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") diff --git a/client/ayon_core/hosts/max/addon.py b/client/ayon_core/hosts/max/addon.py index 416014025c..12f5f7eca0 100644 --- a/client/ayon_core/hosts/max/addon.py +++ b/client/ayon_core/hosts/max/addon.py @@ -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 diff --git a/client/ayon_core/hosts/maya/addon.py b/client/ayon_core/hosts/maya/addon.py index 745850f6a8..c68aa4c911 100644 --- a/client/ayon_core/hosts/maya/addon.py +++ b/client/ayon_core/hosts/maya/addon.py @@ -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 = [ diff --git a/client/ayon_core/hosts/nuke/addon.py b/client/ayon_core/hosts/nuke/addon.py index 4ca4408271..8e640624f0 100644 --- a/client/ayon_core/hosts/nuke/addon.py +++ b/client/ayon_core/hosts/nuke/addon.py @@ -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 = [ diff --git a/client/ayon_core/hosts/photoshop/addon.py b/client/ayon_core/hosts/photoshop/addon.py index 0c7efdb317..3016912960 100644 --- a/client/ayon_core/hosts/photoshop/addon.py +++ b/client/ayon_core/hosts/photoshop/addon.py @@ -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 = { diff --git a/client/ayon_core/hosts/resolve/addon.py b/client/ayon_core/hosts/resolve/addon.py index 9c9932826b..1354caabb2 100644 --- a/client/ayon_core/hosts/resolve/addon.py +++ b/client/ayon_core/hosts/resolve/addon.py @@ -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 [] diff --git a/client/ayon_core/hosts/substancepainter/addon.py b/client/ayon_core/hosts/substancepainter/addon.py index a7f21c2288..26829d3153 100644 --- a/client/ayon_core/hosts/substancepainter/addon.py +++ b/client/ayon_core/hosts/substancepainter/addon.py @@ -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") diff --git a/client/ayon_core/hosts/traypublisher/addon.py b/client/ayon_core/hosts/traypublisher/addon.py index d8fc5ed105..70bdfe9a64 100644 --- a/client/ayon_core/hosts/traypublisher/addon.py +++ b/client/ayon_core/hosts/traypublisher/addon.py @@ -2,9 +2,9 @@ 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 @@ 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 @@ def connect_with_addons(self, enabled_modules): def run_traypublisher(self): args = get_ayon_launcher_args( - "module", self.name, "launch" + "addon", self.name, "launch" ) run_detached_process(args) diff --git a/client/ayon_core/hosts/tvpaint/addon.py b/client/ayon_core/hosts/tvpaint/addon.py index 375f7266ae..6756b274f9 100644 --- a/client/ayon_core/hosts/tvpaint/addon.py +++ b/client/ayon_core/hosts/tvpaint/addon.py @@ -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.""" diff --git a/client/ayon_core/hosts/unreal/addon.py b/client/ayon_core/hosts/unreal/addon.py index 745df951c1..c65490bd8c 100644 --- a/client/ayon_core/hosts/unreal/addon.py +++ b/client/ayon_core/hosts/unreal/addon.py @@ -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, From 4e3fd869875a30347740f405a85efce14447654c Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:32:27 +0100 Subject: [PATCH 2/5] console interpreter inherits from AYONaddon --- .../modules/python_console_interpreter/__init__.py | 2 +- .../python_console_interpreter/{module.py => addon.py} | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) rename client/ayon_core/modules/python_console_interpreter/{module.py => addon.py} (77%) diff --git a/client/ayon_core/modules/python_console_interpreter/__init__.py b/client/ayon_core/modules/python_console_interpreter/__init__.py index 5f54ac497b..8d5c23bdba 100644 --- a/client/ayon_core/modules/python_console_interpreter/__init__.py +++ b/client/ayon_core/modules/python_console_interpreter/__init__.py @@ -1,4 +1,4 @@ -from .module import ( +from .addon import ( PythonInterpreterAction ) diff --git a/client/ayon_core/modules/python_console_interpreter/module.py b/client/ayon_core/modules/python_console_interpreter/addon.py similarity index 77% rename from client/ayon_core/modules/python_console_interpreter/module.py rename to client/ayon_core/modules/python_console_interpreter/addon.py index 7819c9cbf3..ffad3ce707 100644 --- a/client/ayon_core/modules/python_console_interpreter/module.py +++ b/client/ayon_core/modules/python_console_interpreter/addon.py @@ -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 @@ def create_interpreter_window(self): if self._interpreter_window: return - from openpype_modules.python_console_interpreter.window import ( + from ayon_core.modules.python_console_interpreter.window import ( PythonInterpreterWidget ) From 5c294300246b0379e68ed38603fffd7a2e33986b Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:32:39 +0100 Subject: [PATCH 3/5] launcher action addon inherits from AYONaddon --- client/ayon_core/modules/launcher_action.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/modules/launcher_action.py b/client/ayon_core/modules/launcher_action.py index c0266e3a57..1faf6ef4b1 100644 --- a/client/ayon_core/modules/launcher_action.py +++ b/client/ayon_core/modules/launcher_action.py @@ -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 From b7d86bee3fb67ee4321de3ef5807fdbaa5949d12 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:34:42 +0100 Subject: [PATCH 4/5] renamed libray loader action to loader action --- .../modules/library_loader_action.py | 67 ------------------- client/ayon_core/modules/loader_action.py | 67 +++++++++++++++++++ 2 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 client/ayon_core/modules/library_loader_action.py create mode 100644 client/ayon_core/modules/loader_action.py diff --git a/client/ayon_core/modules/library_loader_action.py b/client/ayon_core/modules/library_loader_action.py deleted file mode 100644 index 524c4f7144..0000000000 --- a/client/ayon_core/modules/library_loader_action.py +++ /dev/null @@ -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 diff --git a/client/ayon_core/modules/loader_action.py b/client/ayon_core/modules/loader_action.py new file mode 100644 index 0000000000..a0cc417b66 --- /dev/null +++ b/client/ayon_core/modules/loader_action.py @@ -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 From 3484a3d79b2b8966f78fd7c49c2aa4a72d8978d8 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:35:49 +0100 Subject: [PATCH 5/5] modified click_wrap examples and readme --- client/ayon_core/addon/README.md | 8 ++++---- client/ayon_core/addon/click_wrap.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/addon/README.md b/client/ayon_core/addon/README.md index b793b0ffb4..a15e8bdc69 100644 --- a/client/ayon_core/addon/README.md +++ b/client/ayon_core/addon/README.md @@ -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 diff --git a/client/ayon_core/addon/click_wrap.py b/client/ayon_core/addon/click_wrap.py index d49188312d..911a5a5707 100644 --- a/client/ayon_core/addon/click_wrap.py +++ b/client/ayon_core/addon/click_wrap.py @@ -15,7 +15,7 @@ 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 @@ def mycommand(arg1, arg2): Example: ```python from ayon_core import click_wrap - from ayon_core.modules import AYONAddon + from ayon_core.addon import AYONAddon class ExampleAddon(AYONAddon):