mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Publisher: UI works with instances without label (#5032)
* implemented helper function to get instance label * use 'get_publish_instance_label' in some of existing plugins * use 'get_publish_instance_label' in publisher controller
This commit is contained in:
parent
b87012feeb
commit
124493affd
5 changed files with 44 additions and 21 deletions
|
|
@ -23,7 +23,10 @@ from openpype.lib.transcoding import (
|
|||
convert_input_paths_for_ffmpeg,
|
||||
get_transcode_temp_directory,
|
||||
)
|
||||
from openpype.pipeline.publish import KnownPublishError
|
||||
from openpype.pipeline.publish import (
|
||||
KnownPublishError,
|
||||
get_publish_instance_label,
|
||||
)
|
||||
from openpype.pipeline.publish.lib import add_repre_files_for_cleanup
|
||||
|
||||
|
||||
|
|
@ -203,17 +206,8 @@ class ExtractReview(pyblish.api.InstancePlugin):
|
|||
|
||||
return filtered_defs
|
||||
|
||||
@staticmethod
|
||||
def get_instance_label(instance):
|
||||
return (
|
||||
getattr(instance, "label", None)
|
||||
or instance.data.get("label")
|
||||
or instance.data.get("name")
|
||||
or str(instance)
|
||||
)
|
||||
|
||||
def main_process(self, instance):
|
||||
instance_label = self.get_instance_label(instance)
|
||||
instance_label = get_publish_instance_label(instance)
|
||||
self.log.debug("Processing instance \"{}\"".format(instance_label))
|
||||
profile_outputs = self._get_outputs_for_instance(instance)
|
||||
if not profile_outputs:
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import pyblish.api
|
|||
|
||||
from openpype.client import get_versions
|
||||
from openpype.client.operations import OperationsSession, new_thumbnail_doc
|
||||
from openpype.pipeline.publish import get_publish_instance_label
|
||||
|
||||
InstanceFilterResult = collections.namedtuple(
|
||||
"InstanceFilterResult",
|
||||
|
|
@ -133,7 +134,7 @@ class IntegrateThumbnails(pyblish.api.ContextPlugin):
|
|||
|
||||
filtered_instances = []
|
||||
for instance in context:
|
||||
instance_label = self._get_instance_label(instance)
|
||||
instance_label = get_publish_instance_label(instance)
|
||||
# Skip instances without published representations
|
||||
# - there is no place where to put the thumbnail
|
||||
published_repres = instance.data.get("published_representations")
|
||||
|
|
@ -248,7 +249,7 @@ class IntegrateThumbnails(pyblish.api.ContextPlugin):
|
|||
|
||||
for instance_item in filtered_instance_items:
|
||||
instance, thumbnail_path, version_id = instance_item
|
||||
instance_label = self._get_instance_label(instance)
|
||||
instance_label = get_publish_instance_label(instance)
|
||||
version_doc = version_docs_by_str_id.get(version_id)
|
||||
if not version_doc:
|
||||
self.log.warning((
|
||||
|
|
@ -339,10 +340,3 @@ class IntegrateThumbnails(pyblish.api.ContextPlugin):
|
|||
))
|
||||
|
||||
op_session.commit()
|
||||
|
||||
def _get_instance_label(self, instance):
|
||||
return (
|
||||
instance.data.get("label")
|
||||
or instance.data.get("name")
|
||||
or "N/A"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue