Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6173 from ynput/enhancement/use-settings-field-in…
Browse files Browse the repository at this point in the history
…-ayon-settings

AYON: Use `SettingsField` from ayon server
  • Loading branch information
iLLiCiTiT authored Jan 26, 2024
2 parents 8651775 + 7de54c6 commit f3b1570
Show file tree
Hide file tree
Showing 98 changed files with 2,293 additions and 2,163 deletions.
10 changes: 4 additions & 6 deletions server_addon/aftereffects/server/settings/creator_plugins.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
from pydantic import Field

from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField


class CreateRenderPlugin(BaseSettingsModel):
mark_for_review: bool = Field(True, title="Review")
default_variants: list[str] = Field(
mark_for_review: bool = SettingsField(True, title="Review")
default_variants: list[str] = SettingsField(
default_factory=list,
title="Default Variants"
)


class AfterEffectsCreatorPlugins(BaseSettingsModel):
RenderCreator: CreateRenderPlugin = Field(
RenderCreator: CreateRenderPlugin = SettingsField(
title="Create Render",
default_factory=CreateRenderPlugin,
)
26 changes: 13 additions & 13 deletions server_addon/aftereffects/server/settings/imageio.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
from pydantic import Field, validator
from ayon_server.settings import BaseSettingsModel
from pydantic import validator
from ayon_server.settings import BaseSettingsModel, SettingsField
from ayon_server.settings.validators import ensure_unique_names


class ImageIOConfigModel(BaseSettingsModel):
override_global_config: bool = Field(
override_global_config: bool = SettingsField(
False,
title="Override global OCIO config"
)
filepath: list[str] = Field(
filepath: list[str] = SettingsField(
default_factory=list,
title="Config path"
)


class ImageIOFileRuleModel(BaseSettingsModel):
name: str = Field("", title="Rule name")
pattern: str = Field("", title="Regex pattern")
colorspace: str = Field("", title="Colorspace name")
ext: str = Field("", title="File extension")
name: str = SettingsField("", title="Rule name")
pattern: str = SettingsField("", title="Regex pattern")
colorspace: str = SettingsField("", title="Colorspace name")
ext: str = SettingsField("", title="File extension")


class ImageIOFileRulesModel(BaseSettingsModel):
activate_host_rules: bool = Field(False)
rules: list[ImageIOFileRuleModel] = Field(
activate_host_rules: bool = SettingsField(False)
rules: list[ImageIOFileRuleModel] = SettingsField(
default_factory=list,
title="Rules"
)
Expand All @@ -35,14 +35,14 @@ def validate_unique_outputs(cls, value):


class AfterEffectsImageIOModel(BaseSettingsModel):
activate_host_color_management: bool = Field(
activate_host_color_management: bool = SettingsField(
True, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
ocio_config: ImageIOConfigModel = SettingsField(
default_factory=ImageIOConfigModel,
title="OCIO config"
)
file_rules: ImageIOFileRulesModel = Field(
file_rules: ImageIOFileRulesModel = SettingsField(
default_factory=ImageIOFileRulesModel,
title="File Rules"
)
13 changes: 6 additions & 7 deletions server_addon/aftereffects/server/settings/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from pydantic import Field
from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField

from .imageio import AfterEffectsImageIOModel
from .creator_plugins import AfterEffectsCreatorPlugins
Expand All @@ -14,23 +13,23 @@
class AfterEffectsSettings(BaseSettingsModel):
"""AfterEffects Project Settings."""

imageio: AfterEffectsImageIOModel = Field(
imageio: AfterEffectsImageIOModel = SettingsField(
default_factory=AfterEffectsImageIOModel,
title="OCIO config"
)
create: AfterEffectsCreatorPlugins = Field(
create: AfterEffectsCreatorPlugins = SettingsField(
default_factory=AfterEffectsCreatorPlugins,
title="Creator plugins"
)
publish: AfterEffectsPublishPlugins = Field(
publish: AfterEffectsPublishPlugins = SettingsField(
default_factory=AfterEffectsPublishPlugins,
title="Publish plugins"
)
workfile_builder: WorkfileBuilderPlugin = Field(
workfile_builder: WorkfileBuilderPlugin = SettingsField(
default_factory=WorkfileBuilderPlugin,
title="Workfile Builder"
)
templated_workfile_build: TemplatedWorkfileBuildModel = Field(
templated_workfile_build: TemplatedWorkfileBuildModel = SettingsField(
default_factory=TemplatedWorkfileBuildModel,
title="Templated Workfile Build Settings"
)
Expand Down
28 changes: 13 additions & 15 deletions server_addon/aftereffects/server/settings/publish_plugins.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
from pydantic import Field

from ayon_server.settings import BaseSettingsModel
from ayon_server.settings import BaseSettingsModel, SettingsField


class CollectReviewPluginModel(BaseSettingsModel):
enabled: bool = Field(True, title="Enabled")
enabled: bool = SettingsField(True, title="Enabled")


class ValidateSceneSettingsModel(BaseSettingsModel):
"""Validate naming of products and layers"""

# _isGroup = True
enabled: bool = Field(True, title="Enabled")
optional: bool = Field(False, title="Optional")
active: bool = Field(True, title="Active")
skip_resolution_check: list[str] = Field(
enabled: bool = SettingsField(True, title="Enabled")
optional: bool = SettingsField(False, title="Optional")
active: bool = SettingsField(True, title="Active")
skip_resolution_check: list[str] = SettingsField(
default_factory=list,
title="Skip Resolution Check for Tasks",
)
skip_timelines_check: list[str] = Field(
skip_timelines_check: list[str] = SettingsField(
default_factory=list,
title="Skip Timeline Check for Tasks",
)


class ValidateContainersModel(BaseSettingsModel):
enabled: bool = Field(True, title="Enabled")
optional: bool = Field(True, title="Optional")
active: bool = Field(True, title="Active")
enabled: bool = SettingsField(True, title="Enabled")
optional: bool = SettingsField(True, title="Optional")
active: bool = SettingsField(True, title="Active")


class AfterEffectsPublishPlugins(BaseSettingsModel):
CollectReview: CollectReviewPluginModel = Field(
CollectReview: CollectReviewPluginModel = SettingsField(
default_factory=CollectReviewPluginModel,
title="Collect Review",
)
ValidateSceneSettings: ValidateSceneSettingsModel = Field(
ValidateSceneSettings: ValidateSceneSettingsModel = SettingsField(
default_factory=ValidateSceneSettingsModel,
title="Validate Scene Settings",
)
ValidateContainers: ValidateContainersModel = Field(
ValidateContainers: ValidateContainersModel = SettingsField(
default_factory=ValidateContainersModel,
title="Validate Containers",
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
from pydantic import Field
from ayon_server.settings import (
BaseSettingsModel,
task_types_enum,
SettingsField,
)


class TemplatedWorkfileProfileModel(BaseSettingsModel):
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
)
task_names: list[str] = Field(
task_names: list[str] = SettingsField(
default_factory=list,
title="Task names"
)
path: str = Field(
path: str = SettingsField(
title="Path to template"
)
keep_placeholder: bool = Field(
keep_placeholder: bool = SettingsField(
False,
title="Keep placeholders")
create_first_version: bool = Field(
create_first_version: bool = SettingsField(
True,
title="Create first version"
)


class TemplatedWorkfileBuildModel(BaseSettingsModel):
profiles: list[TemplatedWorkfileProfileModel] = Field(
profiles: list[TemplatedWorkfileProfileModel] = SettingsField(
default_factory=list
)
16 changes: 9 additions & 7 deletions server_addon/aftereffects/server/settings/workfile_builder.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
from pydantic import Field

from ayon_server.settings import BaseSettingsModel, MultiplatformPathModel
from ayon_server.settings import (
BaseSettingsModel,
SettingsField,
MultiplatformPathModel,
)


class CustomBuilderTemplate(BaseSettingsModel):
task_types: list[str] = Field(
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
)
template_path: MultiplatformPathModel = Field(
template_path: MultiplatformPathModel = SettingsField(
default_factory=MultiplatformPathModel
)


class WorkfileBuilderPlugin(BaseSettingsModel):
_title = "Workfile Builder"
create_first_version: bool = Field(
create_first_version: bool = SettingsField(
False,
title="Create first workfile"
)

custom_templates: list[CustomBuilderTemplate] = Field(
custom_templates: list[CustomBuilderTemplate] = SettingsField(
default_factory=list
)
Loading

0 comments on commit f3b1570

Please sign in to comment.