ayon-core/openpype/plugins/publish/collect_anatomy_object.py
Roy Nieterau 17a38c32a4
Enhancement: Improve logging levels and messages for artist facing publish reports (#5018)
* Tweak log levels and message to be more informative to artist in report page

* Tweak levels and clarity of logs

* Tweak levels and clarity of logs + tweak grammar

* Cosmetics

* Improve logging

* Simplify logging

* Convert to debug log if it's skipping thumbnail integration if there's no thumbnail whatsoever to integrate

* Tweak to debug since they only show representation ids hardly understandable to the artist

* Match logging message across hosts + include filepath for full clarity

* Tweak message to clarify it only starts checking and not that it requires filling + to debug log

* Tweak to debug log if there's basically no thumbnail to integrate at the end

* Tweak log levels

- Artist doesn't care what's prepared, especially since afterwards it's logged what gets written to the database anyway

* Log clearly it's processing a legacy instance

* Cosmetics
2023-05-24 10:54:31 +02:00

35 lines
919 B
Python

"""Collect Anatomy object.
Requires:
context -> projectName
Provides:
context -> anatomy (openpype.pipeline.anatomy.Anatomy)
"""
import pyblish.api
from openpype.pipeline import Anatomy, KnownPublishError
class CollectAnatomyObject(pyblish.api.ContextPlugin):
"""Collect Anatomy object into Context.
Order offset could be changed to '-0.45'.
"""
order = pyblish.api.CollectorOrder - 0.4
label = "Collect Anatomy Object"
def process(self, context):
project_name = context.data.get("projectName")
if project_name is None:
raise KnownPublishError((
"Project name is not set in 'projectName'."
"Could not initialize project's Anatomy."
))
context.data["anatomy"] = Anatomy(project_name)
self.log.debug(
"Anatomy object collected for project \"{}\".".format(project_name)
)