ayon-core/client/ayon_core/pipeline/publish
2025-12-17 10:53:43 +01:00
..
__init__.py ruff fixes 2025-12-16 18:55:35 +01:00
abstract_collect_render.py define metaclass directly 2024-07-15 15:20:06 +02:00
abstract_expected_files.py use 'ABC' instead of 'ABCMeta' 2024-07-15 15:08:55 +02:00
constants.py Merge branch 'develop' into feature/AY-971_Use-custom-staging-dir-functions 2024-12-02 15:38:22 +01:00
lib.py use correct settings 2025-12-17 10:53:43 +01:00
publish_plugins.py added option to define different help file 2025-12-08 16:39:13 +01:00
README.md Merge branch 'develop' into enhancement/exception-for-artist-error 2024-09-13 19:05:36 +02:00

Publish

AYON is using pyblish for publishing process which is a little bit extented and modified mainly for UI purposes. AYON'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

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

Publish error

Exception PublishError can be raised on known error. The message is shown to artist.

  • message Error message.
  • title Short description of error (2-5 words). Title can be used for grouping of exceptions per plugin.
  • description Override of 'message' for UI, you can add markdown and html. By default, is filled with 'message'.
  • detail Additional detail message that is hidden under collapsed component.

Arguments title, description and detail are optional. Title is filled with generic message "This is not your fault" if is not passed.

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 expect same arguments as PublishError. Value of title is filled with plugin label if is not passed.

Plugin extension

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

import pyblish.api
from ayon_core.pipeline import AYONPyblishPluginMixin


# Example context plugin
class MyExtendedPlugin(
    pyblish.api.ContextPlugin, AYONPyblishPluginMixin
):
    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 ayon_core/lib/attribute_definitions.py.