mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
AYON settings: Extract OIIO transcode settings (#5639)
* added name to ExtractOIIOTranscode output definition * convert outputs of 'ExtractOIIOTranscode' to 'dict'
This commit is contained in:
parent
9624887096
commit
3cf203e465
2 changed files with 29 additions and 1 deletions
|
|
@ -1102,7 +1102,7 @@ def _convert_global_project_settings(ayon_settings, output, default_settings):
|
|||
"studio_name",
|
||||
"studio_code",
|
||||
):
|
||||
ayon_core.pop(key)
|
||||
ayon_core.pop(key, None)
|
||||
|
||||
# Publish conversion
|
||||
ayon_publish = ayon_core["publish"]
|
||||
|
|
@ -1140,6 +1140,27 @@ def _convert_global_project_settings(ayon_settings, output, default_settings):
|
|||
|
||||
profile["outputs"] = new_outputs
|
||||
|
||||
# ExtractOIIOTranscode plugin
|
||||
extract_oiio_transcode = ayon_publish["ExtractOIIOTranscode"]
|
||||
extract_oiio_transcode_profiles = extract_oiio_transcode["profiles"]
|
||||
for profile in extract_oiio_transcode_profiles:
|
||||
new_outputs = {}
|
||||
name_counter = {}
|
||||
for output in profile["outputs"]:
|
||||
if "name" in output:
|
||||
name = output.pop("name")
|
||||
else:
|
||||
# Backwards compatibility for setting without 'name' in model
|
||||
name = output["extension"]
|
||||
if name in new_outputs:
|
||||
name_counter[name] += 1
|
||||
name = "{}_{}".format(name, name_counter[name])
|
||||
else:
|
||||
name_counter[name] = 0
|
||||
|
||||
new_outputs[name] = output
|
||||
profile["outputs"] = new_outputs
|
||||
|
||||
# Extract Burnin plugin
|
||||
extract_burnin = ayon_publish["ExtractBurnin"]
|
||||
extract_burnin_options = extract_burnin["options"]
|
||||
|
|
|
|||
|
|
@ -116,6 +116,8 @@ class OIIOToolArgumentsModel(BaseSettingsModel):
|
|||
|
||||
|
||||
class ExtractOIIOTranscodeOutputModel(BaseSettingsModel):
|
||||
_layout = "expanded"
|
||||
name: str = Field("", title="Name")
|
||||
extension: str = Field("", title="Extension")
|
||||
transcoding_type: str = Field(
|
||||
"colorspace",
|
||||
|
|
@ -164,6 +166,11 @@ class ExtractOIIOTranscodeProfileModel(BaseSettingsModel):
|
|||
title="Output Definitions",
|
||||
)
|
||||
|
||||
@validator("outputs")
|
||||
def validate_unique_outputs(cls, value):
|
||||
ensure_unique_names(value)
|
||||
return value
|
||||
|
||||
|
||||
class ExtractOIIOTranscodeModel(BaseSettingsModel):
|
||||
enabled: bool = Field(True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue