Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Maya / Nuke remove publish gui filters from settings #5570

Merged
merged 16 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 1 addition & 31 deletions openpype/settings/ayon_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,15 +478,6 @@ def _convert_maya_project_settings(ayon_settings, output):
for item in ayon_maya["ext_mapping"]
}

# Publish UI filters
new_filters = {}
for item in ayon_maya["filters"]:
new_filters[item["name"]] = {
subitem["name"]: subitem["value"]
for subitem in item["value"]
}
ayon_maya["filters"] = new_filters

# Maya dirmap
ayon_maya_dirmap = ayon_maya.pop("maya_dirmap")
ayon_maya_dirmap_path = ayon_maya_dirmap["paths"]
Expand Down Expand Up @@ -743,16 +734,6 @@ def _convert_nuke_project_settings(ayon_settings, output):
dirmap["paths"][dst_key] = dirmap["paths"].pop(src_key)
ayon_nuke["nuke-dirmap"] = dirmap

# --- Filters ---
new_gui_filters = {}
for item in ayon_nuke.pop("filters"):
subvalue = {}
key = item["name"]
for subitem in item["value"]:
subvalue[subitem["name"]] = subitem["value"]
new_gui_filters[key] = subvalue
ayon_nuke["filters"] = new_gui_filters
iLLiCiTiT marked this conversation as resolved.
Show resolved Hide resolved

# --- Load ---
ayon_load = ayon_nuke["load"]
ayon_load["LoadClip"]["_representations"] = (
Expand Down Expand Up @@ -896,7 +877,7 @@ def _convert_hiero_project_settings(ayon_settings, output):
_convert_host_imageio(ayon_hiero)

new_gui_filters = {}
for item in ayon_hiero.pop("filters"):
for item in ayon_hiero.pop("filters", []):
subvalue = {}
key = item["name"]
for subitem in item["value"]:
Expand Down Expand Up @@ -963,17 +944,6 @@ def _convert_tvpaint_project_settings(ayon_settings, output):

_convert_host_imageio(ayon_tvpaint)

filters = {}
for item in ayon_tvpaint["filters"]:
value = item["value"]
try:
value = json.loads(value)

except ValueError:
value = {}
filters[item["name"]] = value
ayon_tvpaint["filters"] = filters

ayon_publish_settings = ayon_tvpaint["publish"]
for plugin_name in (
"ValidateProjectSettings",
Expand Down
9 changes: 0 additions & 9 deletions openpype/settings/defaults/project_settings/maya.json
Original file line number Diff line number Diff line change
Expand Up @@ -1608,14 +1608,5 @@
},
"templated_workfile_build": {
"profiles": []
},
"filters": {
"preset 1": {
"ValidateNoAnimation": false,
"ValidateShapeDefaultNames": false
},
"preset 2": {
"ValidateNoAnimation": false
}
}
}
3 changes: 1 addition & 2 deletions openpype/settings/defaults/project_settings/nuke.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,5 @@
},
"templated_workfile_build": {
"profiles": []
},
"filters": {}
}
}
3 changes: 1 addition & 2 deletions openpype/settings/defaults/project_settings/tvpaint.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,5 @@
"workfile_builder": {
"create_first_version": false,
"custom_templates": []
},
"filters": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@
{
"type": "schema",
"name": "schema_templated_workfile_build"
},
{
"type": "schema",
"name": "schema_publish_gui_filter"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,6 @@
{
"type": "schema",
"name": "schema_templated_workfile_build"
},
{
"type": "schema",
"name": "schema_publish_gui_filter"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,6 @@
"workfile_builder/builder_on_start",
"workfile_builder/profiles"
]
},
{
"type": "schema",
"name": "schema_publish_gui_filter"
}
]
}
39 changes: 2 additions & 37 deletions server_addon/maya/server/settings/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@ class ExtMappingItemModel(BaseSettingsModel):
value: str = Field(title="Extension")


class PublishGUIFilterItemModel(BaseSettingsModel):
_layout = "compact"
name: str = Field(title="Name")
value: bool = Field(True, title="Active")


class PublishGUIFiltersModel(BaseSettingsModel):
_layout = "compact"
name: str = Field(title="Name")
value: list[PublishGUIFilterItemModel] = Field(default_factory=list)

@validator("value")
def validate_unique_outputs(cls, value):
ensure_unique_names(value)
return value


class MayaSettings(BaseSettingsModel):
"""Maya Project Settings."""

Expand Down Expand Up @@ -76,11 +59,8 @@ class MayaSettings(BaseSettingsModel):
templated_workfile_build: TemplatedProfilesModel = Field(
default_factory=TemplatedProfilesModel,
title="Templated Workfile Build Settings")
filters: list[PublishGUIFiltersModel] = Field(
default_factory=list,
title="Publish GUI Filters")

@validator("filters", "ext_mapping")
@validator("ext_mapping")
def validate_unique_outputs(cls, value):
ensure_unique_names(value)
return value
Expand Down Expand Up @@ -123,20 +103,5 @@ def validate_unique_outputs(cls, value):
"publish": DEFAULT_PUBLISH_SETTINGS,
"load": DEFAULT_LOADERS_SETTING,
"workfile_build": DEFAULT_WORKFILE_SETTING,
"templated_workfile_build": DEFAULT_TEMPLATED_WORKFILE_SETTINGS,
"filters": [
{
"name": "preset 1",
"value": [
{"name": "ValidateNoAnimation", "value": False},
{"name": "ValidateShapeDefaultNames", "value": False},
]
},
{
"name": "preset 2",
"value": [
{"name": "ValidateNoAnimation", "value": False},
]
},
]
"templated_workfile_build": DEFAULT_TEMPLATED_WORKFILE_SETTINGS
}
19 changes: 0 additions & 19 deletions server_addon/nuke/server/settings/filters.py

This file was deleted.

14 changes: 1 addition & 13 deletions server_addon/nuke/server/settings/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
from .templated_workfile_build import (
TemplatedWorkfileBuildModel
)
from .filters import PublishGUIFilterItemModel


class NukeSettings(BaseSettingsModel):
Expand Down Expand Up @@ -98,16 +97,6 @@ class NukeSettings(BaseSettingsModel):
default_factory=TemplatedWorkfileBuildModel
)

filters: list[PublishGUIFilterItemModel] = Field(
default_factory=list
)

@validator("filters")
def ensure_unique_names(cls, value):
"""Ensure name fields within the lists have unique names."""
ensure_unique_names(value)
return value


DEFAULT_VALUES = {
"general": DEFAULT_GENERAL_SETTINGS,
Expand All @@ -121,6 +110,5 @@ def ensure_unique_names(cls, value):
"workfile_builder": DEFAULT_WORKFILE_BUILDER_SETTINGS,
"templated_workfile_build": {
"profiles": []
},
"filters": []
}
}
2 changes: 1 addition & 1 deletion server_addon/nuke/server/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.7"
__version__ = "0.1.8"
27 changes: 1 addition & 26 deletions server_addon/tvpaint/server/settings/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import Field, validator
from pydantic import Field
from ayon_server.settings import (
BaseSettingsModel,
ensure_unique_names,
Expand All @@ -14,23 +14,6 @@
)


class PublishGUIFilterItemModel(BaseSettingsModel):
_layout = "compact"
name: str = Field(title="Name")
value: bool = Field(True, title="Active")


class PublishGUIFiltersModel(BaseSettingsModel):
_layout = "compact"
name: str = Field(title="Name")
value: list[PublishGUIFilterItemModel] = Field(default_factory=list)

@validator("value")
def validate_unique_outputs(cls, value):
ensure_unique_names(value)
return value


class TvpaintSettings(BaseSettingsModel):
imageio: TVPaintImageIOModel = Field(
default_factory=TVPaintImageIOModel,
Expand All @@ -52,14 +35,6 @@ class TvpaintSettings(BaseSettingsModel):
default_factory=WorkfileBuilderPlugin,
title="Workfile Builder"
)
filters: list[PublishGUIFiltersModel] = Field(
default_factory=list,
title="Publish GUI Filters")

@validator("filters")
def validate_unique_outputs(cls, value):
ensure_unique_names(value)
return value


DEFAULT_VALUES = {
Expand Down
2 changes: 1 addition & 1 deletion server_addon/tvpaint/server/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0"
__version__ = "0.1.1"