Merge pull request #851 from pypeclub/feature/deadline_self_contained_module

Deadline as Pype Module
This commit is contained in:
Milan Kolar 2021-01-04 17:46:56 +01:00 committed by GitHub
commit e5d39665d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 10 deletions

View file

@ -35,6 +35,7 @@ from .ftrack import (
from .clockify import ClockifyModule
from .log_viewer import LogViewModule
from .muster import MusterModule
from .deadline import DeadlineModule
from .standalonepublish_action import StandAlonePublishAction
from .websocket_server import WebsocketModule
from .sync_server import SyncServer
@ -74,6 +75,7 @@ __all__ = (
"IdleManager",
"LogViewModule",
"MusterModule",
"DeadlineModule",
"StandAlonePublishAction",
"WebsocketModule",

View file

@ -1,7 +1,9 @@
from .. import PypeModule
import os
from pype.modules import (
PypeModule, IPluginPaths)
class DeadlineModule(PypeModule):
class DeadlineModule(PypeModule, IPluginPaths):
name = "deadline"
def initialize(self, modules_settings):
@ -18,3 +20,10 @@ class DeadlineModule(PypeModule):
def connect_with_modules(self, *_a, **_kw):
return
def get_plugin_paths(self):
"""Deadline plugin paths."""
current_dir = os.path.dirname(os.path.abspath(__file__))
return {
"publish": [os.path.join(current_dir, "plugins", "publish")]
}

View file

@ -10,7 +10,7 @@ class ValidateDeadlineConnection(pyblish.api.ContextPlugin):
label = "Validate Deadline Web Service"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
hosts = ["maya", "nuke"]
families = ["renderlayer"]
def process(self, context):

View file

@ -127,18 +127,18 @@ class CreateRender(avalon.maya.Creator):
system_settings = get_system_settings()["modules"]
deadline_enabled = system_settings["deadline"]["enabled"]
muster_enabled = system_settings["muster"]["enabled"]
deadline_url = system_settings["deadline"]["DEADLINE_REST_URL"]
muster_url = system_settings["muster"]["MUSTER_REST_URL"]
if deadline_url and muster_url:
if deadline_enabled and muster_enabled:
self.log.error(
"Both Deadline and Muster are enabled. " "Cannot support both."
)
raise RuntimeError("Both Deadline and Muster are enabled")
if deadline_url is None:
self.log.warning("Deadline REST API url not found.")
else:
if deadline_enabled:
argument = "{}/api/pools?NamesOnly=true".format(deadline_url)
try:
response = self._requests_get(argument)
@ -155,9 +155,7 @@ class CreateRender(avalon.maya.Creator):
# set any secondary pools
self.data["secondaryPool"] = ["-"] + pools
if muster_url is None:
self.log.warning("Muster REST API URL not found.")
else:
if muster_enabled:
self.log.info(">>> Loading Muster credentials ...")
self._load_credentials()
self.log.info(">>> Getting pools ...")

View file

@ -24,6 +24,7 @@ pytest-cov
pytest-print
pyqt5
Qt.py
scandir
speedcopy
six
Sphinx