mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge pull request #577 from ynput/enhancement/AY-4913_Move-Fusion-client-code
Chore: Move fusion client code
This commit is contained in:
commit
e08e398e25
117 changed files with 73 additions and 57 deletions
|
|
@ -54,6 +54,7 @@ MOVED_ADDON_MILESTONE_VERSIONS = {
|
|||
"celaction": VersionInfo(0, 2, 0),
|
||||
"clockify": VersionInfo(0, 2, 0),
|
||||
"flame": VersionInfo(0, 2, 0),
|
||||
"fusion": VersionInfo(0, 2, 0),
|
||||
"max": VersionInfo(0, 2, 0),
|
||||
"photoshop": VersionInfo(0, 2, 0),
|
||||
"traypublisher": VersionInfo(0, 2, 0),
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class FusionSubmitDeadline(
|
|||
else:
|
||||
context.data[key] = True
|
||||
|
||||
from ayon_core.hosts.fusion.api.lib import get_frame_path
|
||||
from ayon_fusion.api.lib import get_frame_path
|
||||
|
||||
deadline_url = instance.data["deadline"]["url"]
|
||||
assert deadline_url, "Requires Deadline Webservice URL"
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
from .version import __version__
|
||||
from .addon import (
|
||||
get_fusion_version,
|
||||
FusionAddon,
|
||||
FUSION_HOST_DIR,
|
||||
FUSION_ADDON_ROOT,
|
||||
FUSION_VERSIONS_DICT,
|
||||
)
|
||||
|
||||
|
||||
__all__ = (
|
||||
"__version__",
|
||||
|
||||
"get_fusion_version",
|
||||
"FusionAddon",
|
||||
"FUSION_HOST_DIR",
|
||||
"FUSION_ADDON_ROOT",
|
||||
"FUSION_VERSIONS_DICT",
|
||||
)
|
||||
|
|
@ -3,7 +3,9 @@ import re
|
|||
from ayon_core.addon import AYONAddon, IHostAddon
|
||||
from ayon_core.lib import Logger
|
||||
|
||||
FUSION_HOST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
from .version import __version__
|
||||
|
||||
FUSION_ADDON_ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
# FUSION_VERSIONS_DICT is used by the pre-launch hooks
|
||||
# The keys correspond to all currently supported Fusion versions
|
||||
|
|
@ -50,12 +52,13 @@ def get_fusion_version(app_name):
|
|||
|
||||
class FusionAddon(AYONAddon, IHostAddon):
|
||||
name = "fusion"
|
||||
version = __version__
|
||||
host_name = "fusion"
|
||||
|
||||
def get_launch_hook_paths(self, app):
|
||||
if app.host_name != self.host_name:
|
||||
return []
|
||||
return [os.path.join(FUSION_HOST_DIR, "hooks")]
|
||||
return [os.path.join(FUSION_ADDON_ROOT, "hooks")]
|
||||
|
||||
def add_implementation_envs(self, env, app):
|
||||
# Set default values if are not already set via settings
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import pyblish.api
|
||||
|
||||
|
||||
from ayon_core.hosts.fusion.api.lib import get_current_comp
|
||||
from ayon_fusion.api.lib import get_current_comp
|
||||
from ayon_core.pipeline.publish import get_errored_instances_from_context
|
||||
|
||||
|
||||
|
|
@ -6,10 +6,10 @@ from qtpy import QtWidgets, QtCore, QtGui
|
|||
from ayon_core.tools.utils import host_tools
|
||||
from ayon_core.style import load_stylesheet
|
||||
from ayon_core.lib import register_event_callback
|
||||
from ayon_core.hosts.fusion.scripts import (
|
||||
from ayon_fusion.scripts import (
|
||||
duplicate_with_inputs,
|
||||
)
|
||||
from ayon_core.hosts.fusion.api.lib import (
|
||||
from ayon_fusion.api.lib import (
|
||||
set_current_context_framerange,
|
||||
set_current_context_resolution,
|
||||
)
|
||||
|
|
@ -22,9 +22,9 @@ from ayon_core.pipeline import (
|
|||
AVALON_CONTAINER_ID,
|
||||
)
|
||||
from ayon_core.pipeline.load import any_outdated_containers
|
||||
from ayon_core.hosts.fusion import FUSION_HOST_DIR
|
||||
from ayon_core.host import HostBase, IWorkfileHost, ILoadHost, IPublishHost
|
||||
from ayon_core.tools.utils import host_tools
|
||||
from ayon_fusion import FUSION_ADDON_ROOT
|
||||
|
||||
|
||||
from .lib import (
|
||||
|
|
@ -35,7 +35,7 @@ from .lib import (
|
|||
|
||||
log = Logger.get_logger(__name__)
|
||||
|
||||
PLUGINS_DIR = os.path.join(FUSION_HOST_DIR, "plugins")
|
||||
PLUGINS_DIR = os.path.join(FUSION_ADDON_ROOT, "plugins")
|
||||
|
||||
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish")
|
||||
LOAD_PATH = os.path.join(PLUGINS_DIR, "load")
|
||||
|
|
@ -80,7 +80,7 @@ class FusionHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost):
|
|||
and loaders into fusion.
|
||||
|
||||
It is called automatically when installing via
|
||||
`ayon_core.pipeline.install_host(ayon_core.hosts.fusion.api)`
|
||||
`ayon_core.pipeline.install_host(ayon_fusion.api)`
|
||||
|
||||
See the Maya equivalent for inspiration on how to implement this.
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ class FusionHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost):
|
|||
|
||||
def open_workfile(self, filepath):
|
||||
# Hack to get fusion, see
|
||||
# ayon_core.hosts.fusion.api.pipeline.get_current_comp()
|
||||
# ayon_fusion.api.pipeline.get_current_comp()
|
||||
fusion = getattr(sys.modules["__main__"], "fusion", None)
|
||||
|
||||
return fusion.LoadComp(filepath)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
from copy import deepcopy
|
||||
import os
|
||||
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
get_current_comp,
|
||||
comp_lock_and_undo_chunk,
|
||||
)
|
||||
|
|
@ -5,10 +5,9 @@ if sys.version_info < (3, 7):
|
|||
# hack to handle discrepancy between distributed libraries and Python 3.6
|
||||
# mostly because wrong version of urllib3
|
||||
# TODO remove when not necessary
|
||||
from ayon_core import AYON_CORE_ROOT
|
||||
FUSION_HOST_DIR = os.path.join(AYON_CORE_ROOT, "hosts", "fusion")
|
||||
from ayon_fusion import FUSION_ADDON_ROOT
|
||||
|
||||
vendor_path = os.path.join(FUSION_HOST_DIR, "vendor")
|
||||
vendor_path = os.path.join(FUSION_ADDON_ROOT, "vendor")
|
||||
if vendor_path not in sys.path:
|
||||
sys.path.insert(0, vendor_path)
|
||||
|
||||
|
|
@ -26,8 +25,8 @@ def main(env):
|
|||
# However the contents of that folder can conflict with Qt library dlls
|
||||
# so we make sure to move out of it to avoid DLL Load Failed errors.
|
||||
os.chdir("..")
|
||||
from ayon_core.hosts.fusion.api import FusionHost
|
||||
from ayon_core.hosts.fusion.api import menu
|
||||
from ayon_fusion.api import FusionHost
|
||||
from ayon_fusion.api import menu
|
||||
|
||||
# activate resolve from pype
|
||||
install_host(FusionHost())
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
from ayon_applications import PreLaunchHook
|
||||
from ayon_core.hosts.fusion import FUSION_HOST_DIR
|
||||
from ayon_fusion import FUSION_ADDON_ROOT
|
||||
|
||||
|
||||
class FusionLaunchMenuHook(PreLaunchHook):
|
||||
|
|
@ -28,7 +28,7 @@ class FusionLaunchMenuHook(PreLaunchHook):
|
|||
"Validation for Fusion version 18+ for /execute "
|
||||
"prelaunch argument skipped.")
|
||||
|
||||
path = os.path.join(FUSION_HOST_DIR,
|
||||
path = os.path.join(FUSION_ADDON_ROOT,
|
||||
"deploy",
|
||||
"MenuScripts",
|
||||
"launch_menu.py").replace("\\", "/")
|
||||
|
|
@ -2,8 +2,8 @@ import os
|
|||
import shutil
|
||||
import platform
|
||||
from pathlib import Path
|
||||
from ayon_core.hosts.fusion import (
|
||||
FUSION_HOST_DIR,
|
||||
from ayon_fusion import (
|
||||
FUSION_ADDON_ROOT,
|
||||
FUSION_VERSIONS_DICT,
|
||||
get_fusion_version,
|
||||
)
|
||||
|
|
@ -163,7 +163,7 @@ class FusionCopyPrefsPrelaunch(PreLaunchHook):
|
|||
master_prefs_variable = f"FUSION{profile_version}_MasterPrefs"
|
||||
|
||||
master_prefs = Path(
|
||||
FUSION_HOST_DIR, "deploy", "ayon", "fusion_shared.prefs")
|
||||
FUSION_ADDON_ROOT, "deploy", "ayon", "fusion_shared.prefs")
|
||||
|
||||
self.log.info(f"Setting {master_prefs_variable}: {master_prefs}")
|
||||
self.launch_context.env[master_prefs_variable] = str(master_prefs)
|
||||
|
|
@ -4,8 +4,8 @@ from ayon_applications import (
|
|||
LaunchTypes,
|
||||
ApplicationLaunchFailed,
|
||||
)
|
||||
from ayon_core.hosts.fusion import (
|
||||
FUSION_HOST_DIR,
|
||||
from ayon_fusion import (
|
||||
FUSION_ADDON_ROOT,
|
||||
FUSION_VERSIONS_DICT,
|
||||
get_fusion_version,
|
||||
)
|
||||
|
|
@ -67,5 +67,5 @@ class FusionPrelaunch(PreLaunchHook):
|
|||
# for hook installing PySide2
|
||||
self.data["fusion_python3_home"] = py3_dir
|
||||
|
||||
self.log.info(f"Setting AYON_FUSION_ROOT: {FUSION_HOST_DIR}")
|
||||
self.launch_context.env["AYON_FUSION_ROOT"] = FUSION_HOST_DIR
|
||||
self.log.info(f"Setting AYON_FUSION_ROOT: {FUSION_ADDON_ROOT}")
|
||||
self.launch_context.env["AYON_FUSION_ROOT"] = FUSION_ADDON_ROOT
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from ayon_core.lib import NumberDef
|
||||
|
||||
from ayon_core.hosts.fusion.api.plugin import GenericCreateSaver
|
||||
from ayon_fusion.api.plugin import GenericCreateSaver
|
||||
|
||||
|
||||
class CreateImageSaver(GenericCreateSaver):
|
||||
|
|
@ -4,8 +4,8 @@ from ayon_core.lib import (
|
|||
EnumDef
|
||||
)
|
||||
|
||||
from ayon_core.hosts.fusion.api.plugin import GenericCreateSaver
|
||||
from ayon_core.hosts.fusion.api.lib import get_current_comp
|
||||
from ayon_fusion.api.plugin import GenericCreateSaver
|
||||
from ayon_fusion.api.lib import get_current_comp
|
||||
|
||||
|
||||
class CreateSaver(GenericCreateSaver):
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import ayon_api
|
||||
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
get_current_comp
|
||||
)
|
||||
from ayon_core.pipeline import (
|
||||
|
|
@ -8,7 +8,7 @@ class FusionSelectContainers(InventoryAction):
|
|||
color = "#d8d8d8"
|
||||
|
||||
def process(self, containers):
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
get_current_comp,
|
||||
comp_lock_and_undo_chunk
|
||||
)
|
||||
|
|
@ -2,7 +2,7 @@ from qtpy import QtGui, QtWidgets
|
|||
|
||||
from ayon_core.pipeline import InventoryAction
|
||||
from ayon_core import style
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
get_current_comp,
|
||||
comp_lock_and_undo_chunk
|
||||
)
|
||||
|
|
@ -27,7 +27,7 @@ class FusionSetFrameRangeLoader(load.LoaderPlugin):
|
|||
|
||||
def load(self, context, name, namespace, data):
|
||||
|
||||
from ayon_core.hosts.fusion.api import lib
|
||||
from ayon_fusion.api import lib
|
||||
|
||||
version_attributes = context["version"]["attrib"]
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ class FusionSetFrameRangeWithHandlesLoader(load.LoaderPlugin):
|
|||
|
||||
def load(self, context, name, namespace, data):
|
||||
|
||||
from ayon_core.hosts.fusion.api import lib
|
||||
from ayon_fusion.api import lib
|
||||
|
||||
version_attributes = context["version"]["attrib"]
|
||||
start = version_attributes.get("frameStart", None)
|
||||
|
|
@ -2,7 +2,7 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
imprint_container,
|
||||
get_current_comp,
|
||||
comp_lock_and_undo_chunk
|
||||
|
|
@ -2,7 +2,7 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
imprint_container,
|
||||
get_current_comp,
|
||||
comp_lock_and_undo_chunk,
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import contextlib
|
||||
|
||||
import ayon_core.pipeline.load as load
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
imprint_container,
|
||||
get_current_comp,
|
||||
comp_lock_and_undo_chunk,
|
||||
|
|
@ -2,12 +2,12 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
imprint_container,
|
||||
get_current_comp,
|
||||
comp_lock_and_undo_chunk
|
||||
)
|
||||
from ayon_core.hosts.fusion.api.lib import get_fusion_module
|
||||
from ayon_fusion.api.lib import get_fusion_module
|
||||
|
||||
|
||||
class FusionLoadUSD(load.LoaderPlugin):
|
||||
|
|
@ -5,7 +5,7 @@ is no update or reload function added for this plugin
|
|||
|
||||
from ayon_core.pipeline import load
|
||||
|
||||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
get_current_comp,
|
||||
get_bmd_library,
|
||||
)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.hosts.fusion.api import get_current_comp
|
||||
from ayon_fusion.api import get_current_comp
|
||||
|
||||
|
||||
class CollectCurrentCompFusion(pyblish.api.ContextPlugin):
|
||||
|
|
@ -4,7 +4,7 @@ import pyblish.api
|
|||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.pipeline.publish import RenderInstance
|
||||
from ayon_core.hosts.fusion.api.lib import get_frame_path
|
||||
from ayon_fusion.api.lib import get_frame_path
|
||||
|
||||
|
||||
@attr.s
|
||||
|
|
@ -5,8 +5,8 @@ import collections
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.fusion.api import comp_lock_and_undo_chunk
|
||||
from ayon_core.hosts.fusion.api.lib import get_frame_path, maintained_comp_range
|
||||
from ayon_fusion.api import comp_lock_and_undo_chunk
|
||||
from ayon_fusion.api.lib import get_frame_path, maintained_comp_range
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ from ayon_core.pipeline import (
|
|||
PublishValidationError,
|
||||
)
|
||||
|
||||
from ayon_core.hosts.fusion.api.action import SelectInvalidAction
|
||||
from ayon_fusion.api.action import SelectInvalidAction
|
||||
|
||||
|
||||
class ValidateBackgroundDepth(
|
||||
|
|
@ -3,7 +3,7 @@ import pyblish.api
|
|||
from ayon_core.pipeline.publish import RepairAction
|
||||
from ayon_core.pipeline import PublishValidationError
|
||||
|
||||
from ayon_core.hosts.fusion.api.action import SelectInvalidAction
|
||||
from ayon_fusion.api.action import SelectInvalidAction
|
||||
|
||||
|
||||
class ValidateCreateFolderChecked(pyblish.api.InstancePlugin):
|
||||
|
|
@ -4,7 +4,7 @@ import pyblish.api
|
|||
from ayon_core.pipeline.publish import RepairAction
|
||||
from ayon_core.pipeline import PublishValidationError
|
||||
|
||||
from ayon_core.hosts.fusion.api.action import SelectInvalidAction
|
||||
from ayon_fusion.api.action import SelectInvalidAction
|
||||
|
||||
|
||||
class ValidateLocalFramesExistence(pyblish.api.InstancePlugin):
|
||||
|
|
@ -3,7 +3,7 @@ import os
|
|||
import pyblish.api
|
||||
from ayon_core.pipeline import PublishValidationError
|
||||
|
||||
from ayon_core.hosts.fusion.api.action import SelectInvalidAction
|
||||
from ayon_fusion.api.action import SelectInvalidAction
|
||||
|
||||
|
||||
class ValidateFilenameHasExtension(pyblish.api.InstancePlugin):
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"""Validate if instance context is the same as publish context."""
|
||||
|
||||
import pyblish.api
|
||||
from ayon_core.hosts.fusion.api.action import SelectToolAction
|
||||
from ayon_fusion.api.action import SelectToolAction
|
||||
from ayon_core.pipeline.publish import (
|
||||
RepairAction,
|
||||
ValidateContentsOrder,
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import pyblish.api
|
||||
from ayon_core.pipeline import PublishValidationError
|
||||
|
||||
from ayon_core.hosts.fusion.api.action import SelectInvalidAction
|
||||
from ayon_fusion.api.action import SelectInvalidAction
|
||||
|
||||
|
||||
class ValidateSaverHasInput(pyblish.api.InstancePlugin):
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import pyblish.api
|
||||
from ayon_core.pipeline import PublishValidationError
|
||||
|
||||
from ayon_core.hosts.fusion.api.action import SelectInvalidAction
|
||||
from ayon_fusion.api.action import SelectInvalidAction
|
||||
|
||||
|
||||
class ValidateSaverPassthrough(pyblish.api.ContextPlugin):
|
||||
|
|
@ -4,8 +4,8 @@ from ayon_core.pipeline import (
|
|||
OptionalPyblishPluginMixin,
|
||||
)
|
||||
|
||||
from ayon_core.hosts.fusion.api.action import SelectInvalidAction
|
||||
from ayon_core.hosts.fusion.api import comp_lock_and_undo_chunk
|
||||
from ayon_fusion.api.action import SelectInvalidAction
|
||||
from ayon_fusion.api import comp_lock_and_undo_chunk
|
||||
|
||||
|
||||
class ValidateSaverResolution(
|
||||
|
|
@ -3,7 +3,7 @@ from collections import defaultdict
|
|||
import pyblish.api
|
||||
from ayon_core.pipeline import PublishValidationError
|
||||
|
||||
from ayon_core.hosts.fusion.api.action import SelectInvalidAction
|
||||
from ayon_fusion.api.action import SelectInvalidAction
|
||||
|
||||
|
||||
class ValidateUniqueSubsets(pyblish.api.ContextPlugin):
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
from ayon_core.hosts.fusion.api import (
|
||||
from ayon_fusion.api import (
|
||||
comp_lock_and_undo_chunk,
|
||||
get_current_comp
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue