From 23f90ec355ff4d2ce58cad7d4185ec38fcd9efc0 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Mon, 17 Apr 2023 12:24:42 +0200 Subject: [PATCH] :construction: wip on skeleton instance --- openpype/pipeline/farm/pyblish.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/openpype/pipeline/farm/pyblish.py b/openpype/pipeline/farm/pyblish.py index 436ad7f195..3ad62962d2 100644 --- a/openpype/pipeline/farm/pyblish.py +++ b/openpype/pipeline/farm/pyblish.py @@ -1,5 +1,6 @@ from openpype.lib import Logger import attr +import pyblish.api @attr.s @@ -23,10 +24,27 @@ def remap_source(source, anatomy): return source -def get_skeleton_instance(): +def create_skeleton_instance(instance): + # type: (pyblish.api.Instance) -> dict + """Create skelenton instance from original instance data. + + This will create dictionary containing skeleton + - common - data used for publishing rendered instances. + This skeleton instance is then extended with additional data + and serialized to be processed by farm job. + + Args: + instance (pyblish.api.Instance): Original instance to + be used as a source of data. + + Returns: + dict: Dictionary with skeleton instance data. + """ - instance_skeleton_data = { - "family": family, + context = instance.context + + return { + "family": "render" if "prerender" not in instance.data["families"] else "prerender", # noqa: E401 "subset": subset, "families": families, "asset": asset, @@ -50,5 +68,3 @@ def get_skeleton_instance(): # map inputVersions `ObjectId` -> `str` so json supports it "inputVersions": list(map(str, data.get("inputVersions", []))) } - """ - pass