From 86c2aaff37b336ed3f11498dc46db51dcef4ec24 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Wed, 4 Aug 2021 10:47:30 +0100 Subject: [PATCH] Get data from context with defined keys. --- openpype/plugins/publish/extract_burnin.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openpype/plugins/publish/extract_burnin.py b/openpype/plugins/publish/extract_burnin.py index ef52d51325..88ccbdda1c 100644 --- a/openpype/plugins/publish/extract_burnin.py +++ b/openpype/plugins/publish/extract_burnin.py @@ -156,6 +156,16 @@ class ExtractBurnin(openpype.api.Extractor): filled_anatomy = anatomy.format_all(burnin_data) burnin_data["anatomy"] = filled_anatomy.get_solved() + # Add context data burnin_data. + burnin_data["context"] = {} + for item in repre_burnin_defs: + for field, setting in repre_burnin_defs[item].items(): + if "context" in setting: + key = setting.split("[")[1].split("]")[0] + burnin_data["context"][key] = ( + setting.format(context=instance.context.data) + ) + # Add source camera name to burnin data camera_name = repre.get("camera_name") if camera_name: