mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
refactor settings names
This commit is contained in:
parent
6b07c8cfb1
commit
d90310079c
2 changed files with 14 additions and 19 deletions
|
|
@ -123,15 +123,18 @@ class ExtractOIIOTranscode(publish.Extractor):
|
|||
|
||||
target_colorspace = view = display = None
|
||||
# NOTE: we use colorspace_data as the fallback values for the target colorspace.
|
||||
if transcoding_type == "use_colorspace":
|
||||
if transcoding_type == "colorspace":
|
||||
# TODO: Should we fallback to the colorspace (which used as source above) ?
|
||||
# or should we compute the target colorspace from current view and display ?
|
||||
target_colorspace = (output_def["use_colorspace"]["colorspace"] or
|
||||
target_colorspace = (output_def["colorspace"] or
|
||||
colorspace_data.get("colorspace"))
|
||||
elif transcoding_type == "use_display_view":
|
||||
view = output_def["use_display_view"]["view"] or colorspace_data.get("view")
|
||||
display = (output_def["use_display_view"]["display"] or
|
||||
colorspace_data.get("display"))
|
||||
elif transcoding_type == "display_view":
|
||||
display_view = output_def["display_view"]
|
||||
view = display_view["view"] or colorspace_data.get("view")
|
||||
display = (
|
||||
display_view["display"]
|
||||
or colorspace_data.get("display")
|
||||
)
|
||||
|
||||
# both could be already collected by DCC,
|
||||
# but could be overwritten when transcoding
|
||||
|
|
|
|||
|
|
@ -267,8 +267,8 @@ class ExtractThumbnailModel(BaseSettingsModel):
|
|||
|
||||
def _extract_oiio_transcoding_type():
|
||||
return [
|
||||
{"value": "use_colorspace", "label": "Use Colorspace"},
|
||||
{"value": "use_display_view", "label": "Use Display&View"}
|
||||
{"value": "colorspace", "label": "Use Colorspace"},
|
||||
{"value": "display_view", "label": "Use Display&View"}
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -277,11 +277,6 @@ class OIIOToolArgumentsModel(BaseSettingsModel):
|
|||
default_factory=list, title="Arguments")
|
||||
|
||||
|
||||
class UseColorspaceModel(BaseSettingsModel):
|
||||
_layout = "expanded"
|
||||
colorspace: str = SettingsField("", title="Target Colorspace")
|
||||
|
||||
|
||||
class UseDisplayViewModel(BaseSettingsModel):
|
||||
_layout = "expanded"
|
||||
display: str = SettingsField("", title="Target Display")
|
||||
|
|
@ -298,16 +293,13 @@ class ExtractOIIOTranscodeOutputModel(BaseSettingsModel):
|
|||
)
|
||||
extension: str = SettingsField("", title="Extension")
|
||||
transcoding_type: str = SettingsField(
|
||||
"use_colorspace",
|
||||
"colorspace",
|
||||
title="Transcoding type",
|
||||
enum_resolver=_extract_oiio_transcoding_type,
|
||||
conditionalEnum=True
|
||||
)
|
||||
use_colorspace: UseColorspaceModel = SettingsField(
|
||||
title="Use Colorspace",
|
||||
default_factory=UseColorspaceModel
|
||||
)
|
||||
use_display_view: UseDisplayViewModel = SettingsField(
|
||||
colorspace: str = SettingsField("", title="Target Colorspace")
|
||||
display_view: UseDisplayViewModel = SettingsField(
|
||||
title="Use Display&View",
|
||||
default_factory=UseDisplayViewModel
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue