ayon-core/openpype/pipeline/publish
2023-05-31 15:41:02 +02:00
..
__init__.py Publisher: UI works with instances without label (#5032) 2023-05-25 11:51:44 +02:00
abstract_collect_render.py Update openpype/pipeline/publish/abstract_collect_render.py 2023-05-23 16:31:28 +02:00
abstract_expected_files.py moved render abstractions to openpype.pipeline.publish 2022-06-30 10:39:05 +02:00
constants.py added orders to publish constants 2022-08-26 12:34:32 +02:00
contants.py Global: persistent staging directory for renders (#4583) 2023-03-24 16:30:46 +01:00
lib.py General: Small code cleanups (#5034) 2023-05-26 14:44:47 +02:00
publish_plugins.py Merge remote-tracking branch 'origin/enhancement/allow_nested_settings_templates' into feature/OP-5207_Global-host-color-management-activation 2023-05-24 14:23:23 +02:00
README.md added readme to publish pipeline 2021-10-06 11:25:56 +02:00

Publish

OpenPype is using pyblish for publishing process which is a little bit extented and modified mainly for UI purposes. OpenPype's (new) publish UI does not allow to enable/disable instances or plugins that can be done during creation part. Also does support actions only for validators after validation exception.

Exceptions

OpenPype define few specific exceptions that should be used in publish plugins.

Validation exception

Validation plugins should raise PublishValidationError to show to an artist what's wrong and give him actions to fix it. The exception says that error happened in plugin can be fixed by artist himself (with or without action on plugin). Any other errors will stop publishing immediately. Exception PublishValidationError raised after validation order has same effect as any other exception.

Exception PublishValidationError 3 arguments:

  • message Which is not used in UI but for headless publishing.
  • title Short description of error (2-5 words). Title is used for grouping of exceptions per plugin.
  • description Detailed description of happened issue where markdown and html can be used.

Known errors

When there is a known error that can't be fixed by user (e.g. can't connect to deadline service, etc.) KnownPublishError should be raise. The only difference is that it's message is shown in UI to artist otherwise a neutral message without context is shown.

Plugin extension

Publish plugins can be extended by additional logic when inherits from OpenPypePyblishPluginMixin which can be used as mixin (additional inheritance of class).

import pyblish.api
from openpype.pipeline import OpenPypePyblishPluginMixin


# Example context plugin
class MyExtendedPlugin(
    pyblish.api.ContextPlugin, OpenPypePyblishPluginMixin
):
    pass

Extensions

Currently only extension is ability to define attributes for instances during creation. Method get_attribute_defs returns attribute definitions for families defined in plugin's families attribute if it's instance plugin or for whole context if it's context plugin. To convert existing values (or to remove legacy values) can be implemented convert_attribute_values. Values of publish attributes from created instance are never removed automatically so implementing of this method is best way to remove legacy data or convert them to new data structure.

Possible attribute definitions can be found in openpype/pipeline/lib/attribute_definitions.py.