mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge branch 'develop' into enhancement/1470-yn-0067-publisher-crashed-plugins
This commit is contained in:
commit
f2e014b3f8
17 changed files with 526 additions and 231 deletions
|
|
@ -158,6 +158,46 @@ def _convert_publish_plugins(overrides):
|
|||
_convert_oiio_transcode_0_4_5(overrides["publish"])
|
||||
|
||||
|
||||
def _convert_extract_thumbnail(overrides):
|
||||
"""ExtractThumbnail config settings did change to profiles."""
|
||||
extract_thumbnail_overrides = (
|
||||
overrides.get("publish", {}).get("ExtractThumbnail")
|
||||
)
|
||||
if extract_thumbnail_overrides is None:
|
||||
return
|
||||
|
||||
base_value = {
|
||||
"product_types": [],
|
||||
"host_names": [],
|
||||
"task_types": [],
|
||||
"task_names": [],
|
||||
"product_names": [],
|
||||
"integrate_thumbnail": True,
|
||||
"target_size": {"type": "source"},
|
||||
"duration_split": 0.5,
|
||||
"oiiotool_defaults": {
|
||||
"type": "colorspace",
|
||||
"colorspace": "color_picking",
|
||||
},
|
||||
"ffmpeg_args": {"input": ["-apply_trc gamma22"], "output": []},
|
||||
}
|
||||
for key in (
|
||||
"product_names",
|
||||
"integrate_thumbnail",
|
||||
"target_size",
|
||||
"duration_split",
|
||||
"oiiotool_defaults",
|
||||
"ffmpeg_args",
|
||||
):
|
||||
if key in extract_thumbnail_overrides:
|
||||
base_value[key] = extract_thumbnail_overrides.pop(key)
|
||||
|
||||
extract_thumbnail_profiles = extract_thumbnail_overrides.setdefault(
|
||||
"profiles", []
|
||||
)
|
||||
extract_thumbnail_profiles.append(base_value)
|
||||
|
||||
|
||||
def convert_settings_overrides(
|
||||
source_version: str,
|
||||
overrides: dict[str, Any],
|
||||
|
|
@ -166,4 +206,5 @@ def convert_settings_overrides(
|
|||
_convert_imageio_configs_0_4_5(overrides)
|
||||
_convert_imageio_configs_1_6_5(overrides)
|
||||
_convert_publish_plugins(overrides)
|
||||
_convert_extract_thumbnail(overrides)
|
||||
return overrides
|
||||
|
|
|
|||
|
|
@ -422,24 +422,30 @@ class ExtractThumbnailOIIODefaultsModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class ExtractThumbnailModel(BaseSettingsModel):
|
||||
_isGroup = True
|
||||
enabled: bool = SettingsField(True)
|
||||
class ExtractThumbnailProfileModel(BaseSettingsModel):
|
||||
product_types: list[str] = SettingsField(
|
||||
default_factory=list, title="Product types"
|
||||
)
|
||||
host_names: list[str] = SettingsField(
|
||||
default_factory=list, title="Host names"
|
||||
)
|
||||
task_types: list[str] = SettingsField(
|
||||
default_factory=list, title="Task types", enum_resolver=task_types_enum
|
||||
)
|
||||
task_names: list[str] = SettingsField(
|
||||
default_factory=list, title="Task names"
|
||||
)
|
||||
product_names: list[str] = SettingsField(
|
||||
default_factory=list,
|
||||
title="Product names"
|
||||
default_factory=list, title="Product names"
|
||||
)
|
||||
integrate_thumbnail: bool = SettingsField(
|
||||
True,
|
||||
title="Integrate Thumbnail Representation"
|
||||
True, title="Integrate Thumbnail Representation"
|
||||
)
|
||||
target_size: ResizeModel = SettingsField(
|
||||
default_factory=ResizeModel,
|
||||
title="Target size"
|
||||
default_factory=ResizeModel, title="Target size"
|
||||
)
|
||||
background_color: ColorRGBA_uint8 = SettingsField(
|
||||
(0, 0, 0, 0.0),
|
||||
title="Background color"
|
||||
(0, 0, 0, 0.0), title="Background color"
|
||||
)
|
||||
duration_split: float = SettingsField(
|
||||
0.5,
|
||||
|
|
@ -456,6 +462,15 @@ class ExtractThumbnailModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class ExtractThumbnailModel(BaseSettingsModel):
|
||||
_isGroup = True
|
||||
enabled: bool = SettingsField(True)
|
||||
|
||||
profiles: list[ExtractThumbnailProfileModel] = SettingsField(
|
||||
default_factory=list, title="Profiles"
|
||||
)
|
||||
|
||||
|
||||
def _extract_oiio_transcoding_type():
|
||||
return [
|
||||
{"value": "colorspace", "label": "Use Colorspace"},
|
||||
|
|
@ -491,6 +506,18 @@ class UseDisplayViewModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class ExtractThumbnailFromSourceModel(BaseSettingsModel):
|
||||
"""Thumbnail extraction from source files using ffmpeg and oiiotool."""
|
||||
enabled: bool = SettingsField(True)
|
||||
|
||||
target_size: ResizeModel = SettingsField(
|
||||
default_factory=ResizeModel, title="Target size"
|
||||
)
|
||||
background_color: ColorRGBA_uint8 = SettingsField(
|
||||
(0, 0, 0, 0.0), title="Background color"
|
||||
)
|
||||
|
||||
|
||||
class ExtractOIIOTranscodeOutputModel(BaseSettingsModel):
|
||||
_layout = "expanded"
|
||||
name: str = SettingsField(
|
||||
|
|
@ -1271,6 +1298,16 @@ class PublishPuginsModel(BaseSettingsModel):
|
|||
default_factory=ExtractThumbnailModel,
|
||||
title="Extract Thumbnail"
|
||||
)
|
||||
ExtractThumbnailFromSource: ExtractThumbnailFromSourceModel = SettingsField( # noqa: E501
|
||||
default_factory=ExtractThumbnailFromSourceModel,
|
||||
title="Extract Thumbnail from source",
|
||||
description=(
|
||||
"Extract thumbnails from explicit file set in "
|
||||
"instance.data['thumbnailSource'] using oiiotool"
|
||||
" or ffmpeg."
|
||||
"Used when artist provided thumbnail source."
|
||||
)
|
||||
)
|
||||
ExtractOIIOTranscode: ExtractOIIOTranscodeModel = SettingsField(
|
||||
default_factory=ExtractOIIOTranscodeModel,
|
||||
title="Extract OIIO Transcode"
|
||||
|
|
@ -1489,22 +1526,40 @@ DEFAULT_PUBLISH_VALUES = {
|
|||
},
|
||||
"ExtractThumbnail": {
|
||||
"enabled": True,
|
||||
"product_names": [],
|
||||
"integrate_thumbnail": True,
|
||||
"profiles": [
|
||||
{
|
||||
"product_types": [],
|
||||
"host_names": [],
|
||||
"task_types": [],
|
||||
"task_names": [],
|
||||
"product_names": [],
|
||||
"integrate_thumbnail": True,
|
||||
"target_size": {
|
||||
"type": "source"
|
||||
},
|
||||
"duration_split": 0.5,
|
||||
"oiiotool_defaults": {
|
||||
"type": "colorspace",
|
||||
"colorspace": "color_picking"
|
||||
},
|
||||
"ffmpeg_args": {
|
||||
"input": [
|
||||
"-apply_trc gamma22"
|
||||
],
|
||||
"output": []
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"ExtractThumbnailFromSource": {
|
||||
"enabled": True,
|
||||
"target_size": {
|
||||
"type": "source"
|
||||
"type": "resize",
|
||||
"resize": {
|
||||
"width": 300,
|
||||
"height": 170
|
||||
}
|
||||
},
|
||||
"duration_split": 0.5,
|
||||
"oiiotool_defaults": {
|
||||
"type": "colorspace",
|
||||
"colorspace": "color_picking"
|
||||
},
|
||||
"ffmpeg_args": {
|
||||
"input": [
|
||||
"-apply_trc gamma22"
|
||||
],
|
||||
"output": []
|
||||
}
|
||||
},
|
||||
"ExtractOIIOTranscode": {
|
||||
"enabled": True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue