From f6e18fafa2c5c87f09a2e8aa8c316ce1c63f6b85 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 23 Aug 2021 10:50:23 +0200 Subject: [PATCH] added context validator --- .../publish/validate_context_with_error.py | 57 +++++++++++++++++++ .../plugins/publish/validate_with_error.py | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 openpype/hosts/testhost/plugins/publish/validate_context_with_error.py diff --git a/openpype/hosts/testhost/plugins/publish/validate_context_with_error.py b/openpype/hosts/testhost/plugins/publish/validate_context_with_error.py new file mode 100644 index 0000000000..46e996a569 --- /dev/null +++ b/openpype/hosts/testhost/plugins/publish/validate_context_with_error.py @@ -0,0 +1,57 @@ +import pyblish.api +from openpype.pipeline import PublishValidationError + + +class ValidateInstanceAssetRepair(pyblish.api.Action): + """Repair the instance asset.""" + + label = "Repair" + icon = "wrench" + on = "failed" + + def process(self, context, plugin): + pass + + +description = """ +## Publish plugins + +### Validate Scene Settings + +#### Skip Resolution Check for Tasks + +Set regex pattern(s) to look for in a Task name to skip resolution check against values from DB. + +#### Skip Timeline Check for Tasks + +Set regex pattern(s) to look for in a Task name to skip `frameStart`, `frameEnd` check against values from DB. + +### AfterEffects Submit to Deadline + +* `Use Published scene` - Set to True (green) when Deadline should take published scene as a source instead of uploaded local one. +* `Priority` - priority of job on farm +* `Primary Pool` - here is list of pool fetched from server you can select from. +* `Secondary Pool` +* `Frames Per Task` - number of sequence division between individual tasks (chunks) +making one job on farm. +""" + + +class ValidateContextWithError(pyblish.api.ContextPlugin): + """Validate the instance asset is the current selected context asset. + + As it might happen that multiple worfiles are opened, switching + between them would mess with selected context. + In that case outputs might be output under wrong asset! + + Repair action will use Context asset value (from Workfiles or Launcher) + Closing and reopening with Workfiles will refresh Context value. + """ + + label = "Validate Context With Error" + hosts = ["testhost"] + actions = [ValidateInstanceAssetRepair] + order = pyblish.api.ValidatorOrder + + def process(self, context): + raise PublishValidationError("Crashing", "Context error", description) diff --git a/openpype/hosts/testhost/plugins/publish/validate_with_error.py b/openpype/hosts/testhost/plugins/publish/validate_with_error.py index a830629cd8..5a2888a8b0 100644 --- a/openpype/hosts/testhost/plugins/publish/validate_with_error.py +++ b/openpype/hosts/testhost/plugins/publish/validate_with_error.py @@ -54,4 +54,4 @@ class ValidateWithError(pyblish.api.InstancePlugin): order = pyblish.api.ValidatorOrder def process(self, instance): - raise PublishValidationError("Crashing", "Errored out", description) + raise PublishValidationError("Crashing", "Instance error", description)