Merge pull request #1609 from BigRoy/chore/remove_asset_family_subset

Remove legacy usage of asset, family and subset
This commit is contained in:
Jakub Trllo 2025-12-18 12:04:50 +01:00 committed by GitHub
commit 46da65bf82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 22 additions and 58 deletions

View file

@ -137,7 +137,7 @@ class HostBase(AbstractHost):
def get_current_folder_path(self) -> Optional[str]:
"""
Returns:
Optional[str]: Current asset name.
Optional[str]: Current folder path.
"""
return os.environ.get("AYON_FOLDER_PATH")

View file

@ -948,7 +948,7 @@ def get_representation_by_names(
version_name: Union[int, str],
representation_name: str,
) -> Optional[dict]:
"""Get representation entity for asset and subset.
"""Get representation entity for folder and product.
If version_name is "hero" then return the hero version
If version_name is "latest" then return the latest version
@ -966,7 +966,7 @@ def get_representation_by_names(
return None
if isinstance(product_name, dict) and "name" in product_name:
# Allow explicitly passing subset document
# Allow explicitly passing product entity document
product_entity = product_name
else:
product_entity = ayon_api.get_product_by_name(

View file

@ -96,7 +96,6 @@ def get_folder_template_data(folder_entity, project_name):
Output dictionary contains keys:
- 'folder' - dictionary with 'name' key filled with folder name
- 'asset' - folder name
- 'hierarchy' - parent folder names joined with '/'
- 'parent' - direct parent name, project name used if is under
project
@ -132,7 +131,6 @@ def get_folder_template_data(folder_entity, project_name):
"path": path,
"parents": parents,
},
"asset": folder_name,
"hierarchy": hierarchy,
"parent": parent_name
}

View file

@ -1,16 +1,19 @@
from __future__ import annotations
from typing import Optional, Any
from ayon_core.lib.profiles_filtering import filter_profiles
from ayon_core.settings import get_project_settings
def get_versioning_start(
project_name,
host_name,
task_name=None,
task_type=None,
product_type=None,
product_name=None,
project_settings=None,
):
project_name: str,
host_name: str,
task_name: Optional[str] = None,
task_type: Optional[str] = None,
product_type: Optional[str] = None,
product_name: Optional[str] = None,
project_settings: Optional[dict[str, Any]] = None,
) -> int:
"""Get anatomy versioning start"""
if not project_settings:
project_settings = get_project_settings(project_name)
@ -22,14 +25,12 @@ def get_versioning_start(
if not profiles:
return version_start
# TODO use 'product_types' and 'product_name' instead of
# 'families' and 'subsets'
filtering_criteria = {
"host_names": host_name,
"families": product_type,
"product_types": product_type,
"product_names": product_name,
"task_names": task_name,
"task_types": task_type,
"subsets": product_name
}
profile = filter_profiles(profiles, filtering_criteria)

View file

@ -1483,7 +1483,7 @@ class PlaceholderLoadMixin(object):
tooltip=(
"Link Type\n"
"\nDefines what type of link will be used to"
" link the asset to the current folder."
" link the product to the current folder."
)
),
attribute_definitions.EnumDef(

View file

@ -62,8 +62,8 @@ class CreateHeroVersion(load.ProductLoaderPlugin):
ignored_representation_names: list[str] = []
db_representation_context_keys = [
"project", "folder", "asset", "hierarchy", "task", "product",
"subset", "family", "representation", "username", "user", "output"
"project", "folder", "hierarchy", "task", "product",
"representation", "username", "user", "output"
]
use_hardlinks = False

View file

@ -301,8 +301,6 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin):
product_name = instance.data["productName"]
product_type = instance.data["productType"]
anatomy_data.update({
"family": product_type,
"subset": product_name,
"product": {
"name": product_name,
"type": product_type,

View file

@ -25,7 +25,7 @@ class CollectManagedStagingDir(pyblish.api.InstancePlugin):
Location of the folder is configured in:
`ayon+anatomy://_/templates/staging`.
Which family/task type/subset is applicable is configured in:
Which product type/task type/product is applicable is configured in:
`ayon+settings://core/tools/publish/custom_staging_dir_profiles`
"""

View file

@ -316,22 +316,8 @@ class ExtractBurnin(publish.Extractor):
burnin_values = {}
for key in self.positions:
value = burnin_def.get(key)
if not value:
continue
# TODO remove replacements
burnin_values[key] = (
value
.replace("{task}", "{task[name]}")
.replace("{product[name]}", "{subset}")
.replace("{Product[name]}", "{Subset}")
.replace("{PRODUCT[NAME]}", "{SUBSET}")
.replace("{product[type]}", "{family}")
.replace("{Product[type]}", "{Family}")
.replace("{PRODUCT[TYPE]}", "{FAMILY}")
.replace("{folder[name]}", "{asset}")
.replace("{Folder[name]}", "{Asset}")
.replace("{FOLDER[NAME]}", "{ASSET}")
)
if value:
burnin_values[key] = value
# Remove "delete" tag from new representation
if "delete" in new_repre["tags"]:

View file

@ -123,10 +123,6 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
"representation",
"username",
"output",
# OpenPype keys - should be removed
"asset", # folder[name]
"subset", # product[name]
"family", # product[type]
]
def process(self, instance):

View file

@ -81,12 +81,9 @@ class IntegrateHeroVersion(
db_representation_context_keys = [
"project",
"folder",
"asset",
"hierarchy",
"task",
"product",
"subset",
"family",
"representation",
"username",
"output"

View file

@ -62,10 +62,8 @@ class IntegrateProductGroup(pyblish.api.InstancePlugin):
product_type = instance.data["productType"]
fill_pairs = prepare_template_data({
"family": product_type,
"task": filter_criteria["tasks"],
"host": filter_criteria["hosts"],
"subset": product_name,
"product": {
"name": product_name,
"type": product_type,

View file

@ -969,12 +969,6 @@ SearchItemDisplayWidget #ValueWidget {
background: {color:bg-buttons};
}
/* Subset Manager */
#SubsetManagerDetailsText {}
#SubsetManagerDetailsText[state="invalid"] {
border: 1px solid #ff0000;
}
/* Creator */
#CreatorsView::item {
padding: 1px 5px;

View file

@ -1129,8 +1129,6 @@ class ProjectPushItemProcess:
self.host_name
)
formatting_data.update({
"subset": self._product_name,
"family": self._product_type,
"product": {
"name": self._product_name,
"type": self._product_type,

View file

@ -32,8 +32,6 @@ class TextureCopy:
product_type = "texture"
template_data = get_template_data(project_entity, folder_entity)
template_data.update({
"family": product_type,
"subset": product_name,
"product": {
"name": product_name,
"type": product_type,