flame: adding extract review data to bypass baking

This commit is contained in:
Jakub Jezek 2022-03-31 15:47:37 +02:00
parent 6108c34d20
commit 8c213809ef
No known key found for this signature in database
GPG key ID: D8548FBF690B100A
3 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,41 @@
import os
import pyblish.api
import openpype
from pprint import pformat
class ExtractReviewData(openpype.api.Extractor):
"""Extracts review tag into available representation
"""
order = pyblish.api.ExtractorOrder + 0.01
# order = pyblish.api.CollectorOrder + 0.499
label = "Extract Review Data"
families = ["review"]
hosts = ["nuke"]
def process(self, instance):
fpath = instance.data["path"]
ext = os.path.splitext(fpath)[-1][1:]
representations = instance.data.get("representations", [])
if "render.farm" in instance.data["families"]:
instance.data["families"].remove("review")
for repre in representations:
if ext not in repre["ext"]:
continue
if not repre.get("tags"):
repre["tags"] = []
if "review" not in repre["tags"]:
repre["tags"].append("review")
self.log.debug("Matching representation: {}".format(
pformat(repre)
))
instance.data["representations"] = representations

View file

@ -106,6 +106,9 @@
]
}
},
"ExtractReviewData": {
"enabled": false
},
"ExtractReviewDataLut": {
"enabled": false
},

View file

@ -138,6 +138,21 @@
}
]
},
{
"type": "dict",
"collapsible": true,
"checkbox_key": "enabled",
"key": "ExtractReviewData",
"label": "ExtractReviewData",
"is_group": true,
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
}
]
},
{
"type": "dict",
"collapsible": true,