Merge pull request #586 from ynput/enhancement/AY-4915_Move-Hiero-client-code

Chore: Move hiero client code
This commit is contained in:
Jakub Ježek 2024-06-04 15:31:27 +02:00 committed by GitHub
commit 00f19a4bd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
133 changed files with 63 additions and 84 deletions

View file

@ -54,6 +54,7 @@ MOVED_ADDON_MILESTONE_VERSIONS = {
"clockify": VersionInfo(0, 2, 0), "clockify": VersionInfo(0, 2, 0),
"flame": VersionInfo(0, 2, 0), "flame": VersionInfo(0, 2, 0),
"fusion": VersionInfo(0, 2, 0), "fusion": VersionInfo(0, 2, 0),
"hiero": VersionInfo(0, 2, 0),
"max": VersionInfo(0, 2, 0), "max": VersionInfo(0, 2, 0),
"photoshop": VersionInfo(0, 2, 0), "photoshop": VersionInfo(0, 2, 0),
"traypublisher": VersionInfo(0, 2, 0), "traypublisher": VersionInfo(0, 2, 0),

View file

@ -1,10 +0,0 @@
from .addon import (
HIERO_ROOT_DIR,
HieroAddon,
)
__all__ = (
"HIERO_ROOT_DIR",
"HieroAddon",
)

View file

@ -80,11 +80,11 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
exclude = [ exclude = [
"client/ayon_core/hosts/unreal/integration/*", "client/ayon_core/hosts/unreal/integration/*",
"client/ayon_core/hosts/aftereffects/api/extension/js/libs/*", "client/ayon_core/hosts/aftereffects/api/extension/js/libs/*",
"client/ayon_core/hosts/hiero/api/startup/*",
"client/ayon_core/modules/deadline/repository/custom/plugins/CelAction/*", "client/ayon_core/modules/deadline/repository/custom/plugins/CelAction/*",
"client/ayon_core/modules/deadline/repository/custom/plugins/HarmonyAYON/*", "client/ayon_core/modules/deadline/repository/custom/plugins/HarmonyAYON/*",
"client/ayon_core/modules/click_wrap.py", "client/ayon_core/modules/click_wrap.py",
"client/ayon_core/scripts/slates/__init__.py" "client/ayon_core/scripts/slates/__init__.py",
"server_addon/hiero/client/ayon_hiero/api/startup/*"
] ]
[tool.ruff.lint.per-file-ignores] [tool.ruff.lint.per-file-ignores]

View file

@ -0,0 +1,13 @@
from .version import __version__
from .addon import (
HIERO_ADDON_ROOT,
HieroAddon,
)
__all__ = (
"__version__",
"HIERO_ADDON_ROOT",
"HieroAddon",
)

View file

@ -2,17 +2,20 @@ import os
import platform import platform
from ayon_core.addon import AYONAddon, IHostAddon from ayon_core.addon import AYONAddon, IHostAddon
HIERO_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) from .version import __version__
HIERO_ADDON_ROOT = os.path.dirname(os.path.abspath(__file__))
class HieroAddon(AYONAddon, IHostAddon): class HieroAddon(AYONAddon, IHostAddon):
name = "hiero" name = "hiero"
version = __version__
host_name = "hiero" host_name = "hiero"
def add_implementation_envs(self, env, _app): def add_implementation_envs(self, env, _app):
# Add requirements to HIERO_PLUGIN_PATH # Add requirements to HIERO_PLUGIN_PATH
new_hiero_paths = [ new_hiero_paths = [
os.path.join(HIERO_ROOT_DIR, "api", "startup") os.path.join(HIERO_ADDON_ROOT, "api", "startup")
] ]
old_hiero_path = env.get("HIERO_PLUGIN_PATH") or "" old_hiero_path = env.get("HIERO_PLUGIN_PATH") or ""
for path in old_hiero_path.split(os.pathsep): for path in old_hiero_path.split(os.pathsep):
@ -36,7 +39,7 @@ class HieroAddon(AYONAddon, IHostAddon):
python_path_parts = [] python_path_parts = []
if python_path: if python_path:
python_path_parts = python_path.split(os.pathsep) python_path_parts = python_path.split(os.pathsep)
vendor_path = os.path.join(HIERO_ROOT_DIR, "vendor") vendor_path = os.path.join(HIERO_ADDON_ROOT, "vendor")
python_path_parts.insert(0, vendor_path) python_path_parts.insert(0, vendor_path)
env["PYTHONPATH"] = os.pathsep.join(python_path_parts) env["PYTHONPATH"] = os.pathsep.join(python_path_parts)

View file

@ -453,19 +453,19 @@ def get_track_openpype_data(track, container_name=None):
) )
@deprecated("ayon_core.hosts.hiero.api.lib.get_trackitem_openpype_tag") @deprecated("ayon_hiero.api.lib.get_trackitem_openpype_tag")
def get_track_item_pype_tag(track_item): def get_track_item_pype_tag(track_item):
# backward compatibility alias # backward compatibility alias
return get_trackitem_openpype_tag(track_item) return get_trackitem_openpype_tag(track_item)
@deprecated("ayon_core.hosts.hiero.api.lib.set_trackitem_openpype_tag") @deprecated("ayon_hiero.api.lib.set_trackitem_openpype_tag")
def set_track_item_pype_tag(track_item, data=None): def set_track_item_pype_tag(track_item, data=None):
# backward compatibility alias # backward compatibility alias
return set_trackitem_openpype_tag(track_item, data) return set_trackitem_openpype_tag(track_item, data)
@deprecated("ayon_core.hosts.hiero.api.lib.get_trackitem_openpype_data") @deprecated("ayon_hiero.api.lib.get_trackitem_openpype_data")
def get_track_item_pype_data(track_item): def get_track_item_pype_data(track_item):
# backward compatibility alias # backward compatibility alias
return get_trackitem_openpype_data(track_item) return get_trackitem_openpype_data(track_item)
@ -802,7 +802,7 @@ class PublishAction(QtWidgets.QAction):
# #
# ''' # '''
# import hiero.core # import hiero.core
# from ayon_core.hosts.nuke.api.lib import ( # from ayon_nuke.api.lib import (
# BuildWorkfile, # BuildWorkfile,
# imprint # imprint
# ) # )

View file

@ -6,7 +6,9 @@ import os
import contextlib import contextlib
from collections import OrderedDict from collections import OrderedDict
import hiero
from pyblish import api as pyblish from pyblish import api as pyblish
from ayon_core.lib import Logger from ayon_core.lib import Logger
from ayon_core.pipeline import ( from ayon_core.pipeline import (
schema, schema,
@ -18,15 +20,14 @@ from ayon_core.pipeline import (
AYON_CONTAINER_ID, AYON_CONTAINER_ID,
) )
from ayon_core.tools.utils import host_tools from ayon_core.tools.utils import host_tools
from ayon_hiero import HIERO_ADDON_ROOT
from . import lib, menu, events from . import lib, menu, events
import hiero
log = Logger.get_logger(__name__) log = Logger.get_logger(__name__)
# plugin paths # plugin paths
API_DIR = os.path.dirname(os.path.abspath(__file__)) PLUGINS_DIR = os.path.join(HIERO_ADDON_ROOT, "plugins")
HOST_DIR = os.path.dirname(API_DIR)
PLUGINS_DIR = os.path.join(HOST_DIR, "plugins")
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish").replace("\\", "/") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish").replace("\\", "/")
LOAD_PATH = os.path.join(PLUGINS_DIR, "load").replace("\\", "/") LOAD_PATH = os.path.join(PLUGINS_DIR, "load").replace("\\", "/")
CREATE_PATH = os.path.join(PLUGINS_DIR, "create").replace("\\", "/") CREATE_PATH = os.path.join(PLUGINS_DIR, "create").replace("\\", "/")
@ -308,9 +309,9 @@ def reload_config():
import importlib import importlib
for module in ( for module in (
"ayon_core.hosts.hiero.lib", "ayon_hiero.lib",
"ayon_core.hosts.hiero.menu", "ayon_hiero.menu",
"ayon_core.hosts.hiero.tags" "ayon_hiero.tags"
): ):
log.info("Reloading module: {}...".format(module)) log.info("Reloading module: {}...".format(module))
try: try:
@ -328,7 +329,7 @@ def on_pyblish_instance_toggled(instance, old_value, new_value):
log.info("instance toggle: {}, old_value: {}, new_value:{} ".format( log.info("instance toggle: {}, old_value: {}, new_value:{} ".format(
instance, old_value, new_value)) instance, old_value, new_value))
from ayon_core.hosts.hiero.api import ( from ayon_hiero.api import (
get_trackitem_openpype_tag, get_trackitem_openpype_tag,
set_publish_attribute set_publish_attribute
) )

View file

@ -550,7 +550,8 @@ class ClipLoader:
log.debug("__ self.timeline_out: {}".format(self.timeline_out)) log.debug("__ self.timeline_out: {}".format(self.timeline_out))
# check if slate is included # check if slate is included
slate_on = "slate" in self.context["version"]["data"]["families"] slate_on = "slate" in self.context["version"]["data"].get(
"families", [])
log.debug("__ slate_on: {}".format(slate_on)) log.debug("__ slate_on: {}".format(slate_on))
# if slate is on then remove the slate frame from beginning # if slate is on then remove the slate frame from beginning
@ -600,7 +601,7 @@ class Creator(LegacyCreator):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(Creator, self).__init__(*args, **kwargs) super(Creator, self).__init__(*args, **kwargs)
import ayon_core.hosts.hiero.api as phiero import ayon_hiero.api as phiero
self.presets = get_current_project_settings()[ self.presets = get_current_project_settings()[
"hiero"]["create"].get(self.__class__.__name__, {}) "hiero"]["create"].get(self.__class__.__name__, {})

View file

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8 KiB

After

Width:  |  Height:  |  Size: 8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Before After
Before After

View file

@ -2,11 +2,11 @@ import traceback
# activate hiero from pype # activate hiero from pype
from ayon_core.pipeline import install_host from ayon_core.pipeline import install_host
import ayon_core.hosts.hiero.api as phiero import ayon_hiero.api as phiero
install_host(phiero) install_host(phiero)
try: try:
__import__("ayon_core.hosts.hiero.api") __import__("ayon_hiero.api")
__import__("pyblish") __import__("pyblish")
except ImportError as e: except ImportError as e:
@ -15,5 +15,5 @@ except ImportError as e:
else: else:
# Setup integration # Setup integration
import ayon_core.hosts.hiero.api as phiero import ayon_hiero.api as phiero
phiero.lib.setup() phiero.lib.setup()

View file

@ -8,7 +8,7 @@ import hiero.core
from hiero.core import util from hiero.core import util
import opentimelineio as otio import opentimelineio as otio
from ayon_core.hosts.hiero.api.otio import hiero_export from ayon_hiero.api.otio import hiero_export
class OTIOExportTask(hiero.core.TaskBase): class OTIOExportTask(hiero.core.TaskBase):

View file

@ -22,7 +22,7 @@ except ImportError:
FormLayout = QFormLayout # lint:ok FormLayout = QFormLayout # lint:ok
from ayon_core.hosts.hiero.api.otio import hiero_export from ayon_hiero.api.otio import hiero_export
class OTIOExportUI(hiero.ui.TaskUIBase): class OTIOExportUI(hiero.ui.TaskUIBase):
def __init__(self, preset): def __init__(self, preset):

View file

@ -9,7 +9,7 @@ import hiero.core
import PySide2.QtWidgets as qw import PySide2.QtWidgets as qw
from ayon_core.hosts.hiero.api.otio.hiero_import import load_otio from ayon_hiero.api.otio.hiero_import import load_otio
class OTIOProjectSelect(qw.QDialog): class OTIOProjectSelect(qw.QDialog):

View file

@ -1,6 +1,6 @@
from copy import deepcopy from copy import deepcopy
import ayon_core.hosts.hiero.api as phiero import ayon_hiero.api as phiero
# from ayon_core.hosts.hiero.api import plugin, lib # from ayon_hiero.api import plugin, lib
# reload(lib) # reload(lib)
# reload(plugin) # reload(plugin)
# reload(phiero) # reload(phiero)

View file

@ -5,7 +5,7 @@ from ayon_core.lib.transcoding import (
VIDEO_EXTENSIONS, VIDEO_EXTENSIONS,
IMAGE_EXTENSIONS IMAGE_EXTENSIONS
) )
import ayon_core.hosts.hiero.api as phiero import ayon_hiero.api as phiero
class LoadClip(phiero.SequenceLoader): class LoadClip(phiero.SequenceLoader):

View file

@ -7,7 +7,7 @@ from ayon_core.pipeline import (
load, load,
get_representation_path, get_representation_path,
) )
from ayon_core.hosts.hiero import api as phiero from ayon_hiero import api as phiero
from ayon_core.lib import Logger from ayon_core.lib import Logger

View file

@ -9,6 +9,7 @@ class CollectClipEffects(pyblish.api.InstancePlugin):
order = pyblish.api.CollectorOrder - 0.078 order = pyblish.api.CollectorOrder - 0.078
label = "Collect Clip Effects Instances" label = "Collect Clip Effects Instances"
families = ["clip"] families = ["clip"]
settings_category = "hiero"
effect_categories = [] effect_categories = []

View file

@ -1,4 +1,3 @@
# from ayon_core import plugins
import os import os
import json import json
import pyblish.api import pyblish.api

View file

@ -3,8 +3,8 @@ import pyblish
from ayon_core.pipeline import AYON_INSTANCE_ID, AVALON_INSTANCE_ID from ayon_core.pipeline import AYON_INSTANCE_ID, AVALON_INSTANCE_ID
from ayon_core.pipeline.editorial import is_overlapping_otio_ranges from ayon_core.pipeline.editorial import is_overlapping_otio_ranges
from ayon_core.hosts.hiero import api as phiero from ayon_hiero import api as phiero
from ayon_core.hosts.hiero.api.otio import hiero_export from ayon_hiero.api.otio import hiero_export
import hiero import hiero
# # developer reload modules # # developer reload modules

View file

@ -7,7 +7,7 @@ from qtpy.QtGui import QPixmap
import hiero.ui import hiero.ui
from ayon_core.hosts.hiero.api.otio import hiero_export from ayon_hiero.api.otio import hiero_export
class PrecollectWorkfile(pyblish.api.ContextPlugin): class PrecollectWorkfile(pyblish.api.ContextPlugin):

View file

@ -1,7 +1,7 @@
from pyblish import api from pyblish import api
import hiero import hiero
import math import math
from ayon_core.hosts.hiero.api.otio.hiero_export import create_otio_time_range from ayon_hiero.api.otio.hiero_export import create_otio_time_range
class PrecollectRetime(api.InstancePlugin): class PrecollectRetime(api.InstancePlugin):
"""Calculate Retiming of selected track items.""" """Calculate Retiming of selected track items."""

Some files were not shown because too many files have changed in this diff Show more