implemented collector for review instances to fix extract review issues (#4891)

This commit is contained in:
Jakub Trllo 2023-04-21 15:18:41 +02:00 committed by GitHub
parent d03200238b
commit 34b1ad105b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
import pyblish.api
class CollectReviewInfo(pyblish.api.InstancePlugin):
"""Collect data required for review instances.
ExtractReview plugin requires frame start/end, fps on instance data which
are missing on instances from TrayPublishes.
Warning:
This is temporary solution to "make it work". Contains removed changes
from https://github.com/ynput/OpenPype/pull/4383 reduced only for
review instances.
"""
label = "Collect Review Info"
order = pyblish.api.CollectorOrder + 0.491
families = ["review"]
hosts = ["traypublisher"]
def process(self, instance):
asset_entity = instance.data.get("assetEntity")
if instance.data.get("frameStart") is not None or not asset_entity:
self.log.debug("Missing required data on instance")
return
asset_data = asset_entity["data"]
# Store collected data for logging
collected_data = {}
for key in (
"fps",
"frameStart",
"frameEnd",
"handleStart",
"handleEnd",
):
if key in instance.data or key not in asset_data:
continue
value = asset_data[key]
collected_data[key] = value
instance.data[key] = value
self.log.debug("Collected data: {}".format(str(collected_data)))