Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing: Use new create system with new publisher #1

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions client/ayon_hiero/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
)

from .pipeline import (
HieroHost,
launch_workfiles_app,
ls,
install,
uninstall,
reload_config,
containerise,
publish,
Expand Down Expand Up @@ -66,11 +65,10 @@
)

__all__ = [
# avalon pipeline module
# pipeline module
"HieroHost",
"launch_workfiles_app",
"ls",
"install",
"uninstall",
"reload_config",
"containerise",
"publish",
Expand Down
4 changes: 2 additions & 2 deletions client/ayon_hiero/api/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ def menu_install():
creator_action = menu.addAction("Create...")
creator_action.setIcon(QtGui.QIcon("icons:CopyRectangle.png"))
creator_action.triggered.connect(
lambda: host_tools.show_creator(parent=main_window)
lambda: host_tools.show_publisher(tab="create")
)

publish_action = menu.addAction("Publish...")
publish_action.setIcon(QtGui.QIcon("icons:Output.png"))
publish_action.triggered.connect(
lambda *args: publish(hiero.ui.mainWindow())
lambda *args: host_tools.show_publisher(tab="publish")
)

loader_action = menu.addAction("Load...")
Expand Down
110 changes: 82 additions & 28 deletions client/ayon_hiero/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
import hiero
from pyblish import api as pyblish

from ayon_core.host import (
HostBase,
IWorkfileHost,
ILoadHost,
IPublishHost
)
from ayon_core.lib import Logger
from ayon_core.pipeline import (
schema,
Expand All @@ -19,10 +25,20 @@
AVALON_CONTAINER_ID,
AYON_CONTAINER_ID,
)

from ayon_core.tools.utils import host_tools

from ayon_hiero import HIERO_ADDON_ROOT

from . import lib, menu, events
from .workio import (
open_file,
save_file,
file_extensions,
has_unsaved_changes,
work_root,
current_file
)

log = Logger.get_logger(__name__)

Expand All @@ -35,42 +51,80 @@
AVALON_CONTAINERS = ":AVALON_CONTAINERS"


def install():
"""Installing Hiero integration."""

# adding all events
events.register_events()
class HieroHost(
HostBase, IWorkfileHost, ILoadHost, IPublishHost
):
name = "hiero"

log.info("Registering Hiero plug-ins..")
pyblish.register_host("hiero")
pyblish.register_plugin_path(PUBLISH_PATH)
register_loader_plugin_path(LOAD_PATH)
register_creator_plugin_path(CREATE_PATH)
def open_workfile(self, filepath):
return open_file(filepath)

# register callback for switching publishable
pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled)
def save_workfile(self, filepath=None):
return save_file(filepath)

# install menu
menu.menu_install()
menu.add_scripts_menu()
def work_root(self, session):
return work_root(session)

# register hiero events
events.register_hiero_events()
def get_current_workfile(self):
return current_file()

def workfile_has_unsaved_changes(self):
return has_unsaved_changes()

def uninstall():
"""
Uninstalling Hiero integration for avalon
def get_workfile_extensions(self):
return file_extensions()

"""
log.info("Deregistering Hiero plug-ins..")
pyblish.deregister_host("hiero")
pyblish.deregister_plugin_path(PUBLISH_PATH)
deregister_loader_plugin_path(LOAD_PATH)
deregister_creator_plugin_path(CREATE_PATH)

# register callback for switching publishable
pyblish.deregister_callback("instanceToggled", on_pyblish_instance_toggled)
def get_containers(self):
return ls()

def install(self):
''' Installing all requarements for hiero host
'''

# adding all events
events.register_events()

log.info("Registering Hiero plug-ins..")
pyblish.register_host("hiero")
pyblish.register_plugin_path(PUBLISH_PATH)
register_loader_plugin_path(LOAD_PATH)
register_creator_plugin_path(CREATE_PATH)

# register callback for switching publishable
pyblish.register_callback(
"instanceToggled", on_pyblish_instance_toggled)

# install menu
menu.menu_install()
menu.add_scripts_menu()

# register hiero events
events.register_hiero_events()

def uninstall(self):
"""
Uninstalling Hiero integration for avalon

"""
log.info("Deregistering Hiero plug-ins..")
pyblish.deregister_host("hiero")
pyblish.deregister_plugin_path(PUBLISH_PATH)
deregister_loader_plugin_path(LOAD_PATH)
deregister_creator_plugin_path(CREATE_PATH)

# register callback for switching publishable
pyblish.deregister_callback("instanceToggled", on_pyblish_instance_toggled)

def get_context_data(self):
# root_node = nuke.root()
# return get_node_data(root_node, ROOT_DATA_KNOB)
pass

def update_context_data(self, data, changes):
# root_node = nuke.root()
# set_node_data(root_node, ROOT_DATA_KNOB, data)
pass


def containerise(track_item,
Expand Down
Loading
Loading