mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
flame Loaders can use AYON settings
This commit is contained in:
parent
85526b41ad
commit
f19d8762df
2 changed files with 15 additions and 31 deletions
|
|
@ -50,17 +50,28 @@ class LoadClipBatch(opfapi.ClipLoader):
|
|||
version_name = version.get("name", None)
|
||||
colorspace = self.get_colorspace(context)
|
||||
|
||||
# TODO remove '{folder[name]}' and '{product[name]}' replacement
|
||||
clip_name_template = (
|
||||
self.clip_name_template
|
||||
.replace("{folder[name]}", "{asset}")
|
||||
.replace("{product[name]}", "{subset}")
|
||||
)
|
||||
layer_rename_template = (
|
||||
self.layer_rename_template
|
||||
.replace("{folder[name]}", "{asset}")
|
||||
.replace("{product[name]}", "{subset}")
|
||||
)
|
||||
# in case output is not in context replace key to representation
|
||||
if not context["representation"]["context"].get("output"):
|
||||
self.clip_name_template = self.clip_name_template.replace(
|
||||
clip_name_template = clip_name_template.replace(
|
||||
"output", "representation")
|
||||
self.layer_rename_template = self.layer_rename_template.replace(
|
||||
layer_rename_template = layer_rename_template.replace(
|
||||
"output", "representation")
|
||||
|
||||
formatting_data = deepcopy(context["representation"]["context"])
|
||||
formatting_data["batch"] = self.batch.name.get_value()
|
||||
|
||||
clip_name = StringTemplate(self.clip_name_template).format(
|
||||
clip_name = StringTemplate(clip_name_template).format(
|
||||
formatting_data)
|
||||
|
||||
# convert colorspace with ocio to flame mapping
|
||||
|
|
@ -86,7 +97,7 @@ class LoadClipBatch(opfapi.ClipLoader):
|
|||
"path": path.replace("\\", "/"),
|
||||
"colorspace": colorspace,
|
||||
"version": "v{:0>3}".format(version_name),
|
||||
"layer_rename_template": self.layer_rename_template,
|
||||
"layer_rename_template": layer_rename_template,
|
||||
"layer_rename_patterns": self.layer_rename_patterns,
|
||||
"context_data": formatting_data
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,34 +267,7 @@ def _convert_flame_project_settings(ayon_settings, output):
|
|||
|
||||
ayon_flame = ayon_settings["flame"]
|
||||
|
||||
ayon_publish_flame = ayon_flame["publish"]
|
||||
|
||||
# 'imageio' changed model
|
||||
# - missing subkey 'project' which is in root of 'imageio' model
|
||||
_convert_host_imageio(ayon_flame)
|
||||
ayon_imageio_flame = ayon_flame["imageio"]
|
||||
if "project" not in ayon_imageio_flame:
|
||||
profile_mapping = ayon_imageio_flame.pop("profilesMapping")
|
||||
ayon_flame["imageio"] = {
|
||||
"project": ayon_imageio_flame,
|
||||
"profilesMapping": profile_mapping
|
||||
}
|
||||
|
||||
ayon_load_flame = ayon_flame["load"]
|
||||
for plugin_name in ("LoadClip", "LoadClipBatch"):
|
||||
plugin_settings = ayon_load_flame[plugin_name]
|
||||
plugin_settings["families"] = plugin_settings.pop("product_types")
|
||||
plugin_settings["clip_name_template"] = (
|
||||
plugin_settings["clip_name_template"]
|
||||
.replace("{folder[name]}", "{asset}")
|
||||
.replace("{product[name]}", "{subset}")
|
||||
)
|
||||
plugin_settings["layer_rename_template"] = (
|
||||
plugin_settings["layer_rename_template"]
|
||||
.replace("{folder[name]}", "{asset}")
|
||||
.replace("{product[name]}", "{subset}")
|
||||
)
|
||||
|
||||
output["flame"] = ayon_flame
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue