Skip to content

Commit

Permalink
Chore: Remove deprecated templates profiles (#6103)
Browse files Browse the repository at this point in the history
* do not use 'IntegrateAssetNew' settings which are not available anymore

* don't use 'IntegrateHeroVersion' settings to get hero version template name

* remove 'template_name_profiles' from 'IntegrateHeroVersion'

* remove unused attribute
  • Loading branch information
iLLiCiTiT committed Jan 9, 2024
1 parent 4fa4b78 commit 86cf800
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 117 deletions.
55 changes: 2 additions & 53 deletions openpype/pipeline/publish/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,41 +58,13 @@ def get_template_name_profiles(
if not project_settings:
project_settings = get_project_settings(project_name)

profiles = (
return copy.deepcopy(
project_settings
["global"]
["tools"]
["publish"]
["template_name_profiles"]
)
if profiles:
return copy.deepcopy(profiles)

# Use legacy approach for cases new settings are not filled yet for the
# project
legacy_profiles = (
project_settings
["global"]
["publish"]
["IntegrateAssetNew"]
["template_name_profiles"]
)
if legacy_profiles:
if not logger:
logger = Logger.get_logger("get_template_name_profiles")

logger.warning((
"Project \"{}\" is using legacy access to publish template."
" It is recommended to move settings to new location"
" 'project_settings/global/tools/publish/template_name_profiles'."
).format(project_name))

# Replace "tasks" key with "task_names"
profiles = []
for profile in copy.deepcopy(legacy_profiles):
profile["task_names"] = profile.pop("tasks", [])
profiles.append(profile)
return profiles


def get_hero_template_name_profiles(
Expand Down Expand Up @@ -121,36 +93,13 @@ def get_hero_template_name_profiles(
if not project_settings:
project_settings = get_project_settings(project_name)

profiles = (
return copy.deepcopy(
project_settings
["global"]
["tools"]
["publish"]
["hero_template_name_profiles"]
)
if profiles:
return copy.deepcopy(profiles)

# Use legacy approach for cases new settings are not filled yet for the
# project
legacy_profiles = copy.deepcopy(
project_settings
["global"]
["publish"]
["IntegrateHeroVersion"]
["template_name_profiles"]
)
if legacy_profiles:
if not logger:
logger = Logger.get_logger("get_hero_template_name_profiles")

logger.warning((
"Project \"{}\" is using legacy access to hero publish template."
" It is recommended to move settings to new location"
" 'project_settings/global/tools/publish/"
"hero_template_name_profiles'."
).format(project_name))
return legacy_profiles


def get_publish_template_name(
Expand Down
1 change: 0 additions & 1 deletion openpype/plugins/publish/integrate_hero_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
# permissions error on files (files were used or user didn't have perms)
# *but all other plugins must be sucessfully completed

template_name_profiles = []
_default_template_name = "hero"

def process(self, instance):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,49 +1023,6 @@
{
"type": "label",
"label": "<b>NOTE:</b> Hero publish template profiles settings were moved to <a href=\"settings://project_settings/global/tools/publish/hero_template_name_profiles\"><b>Tools/Publish/Hero template name profiles</b></a>. Please move values there."
},
{
"type": "list",
"key": "template_name_profiles",
"label": "Template name profiles (DEPRECATED)",
"use_label_wrap": true,
"object_type": {
"type": "dict",
"children": [
{
"key": "families",
"label": "Families",
"type": "list",
"object_type": "text"
},
{
"type": "hosts-enum",
"key": "hosts",
"label": "Hosts",
"multiselection": true
},
{
"key": "task_types",
"label": "Task types",
"type": "task-types-enum"
},
{
"key": "task_names",
"label": "Task names",
"type": "list",
"object_type": "text"
},
{
"type": "separator"
},
{
"type": "text",
"key": "template_name",
"label": "Template name",
"tooltip": "Name of template from Anatomy templates"
}
]
}
}
]
},
Expand Down
20 changes: 0 additions & 20 deletions server_addon/core/server/settings/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,13 +697,6 @@ class IntegrateHeroVersionModel(BaseSettingsModel):
optional: bool = Field(False, title="Optional")
active: bool = Field(True, title="Active")
families: list[str] = Field(default_factory=list, title="Families")
# TODO remove when removed from client code
template_name_profiles: list[IntegrateHeroTemplateNameProfileModel] = (
Field(
default_factory=list,
title="Template name profiles"
)
)


class CleanUpModel(BaseSettingsModel):
Expand Down Expand Up @@ -1049,19 +1042,6 @@ class PublishPuginsModel(BaseSettingsModel):
"layout",
"mayaScene",
"simpleUnrealTexture"
],
"template_name_profiles": [
{
"product_types": [
"simpleUnrealTexture"
],
"hosts": [
"standalonepublisher"
],
"task_types": [],
"task_names": [],
"template_name": "simpleUnrealTextureHero"
}
]
},
"CleanUp": {
Expand Down

0 comments on commit 86cf800

Please sign in to comment.