mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge pull request #1609 from BigRoy/chore/remove_asset_family_subset
Remove legacy usage of asset, family and subset
This commit is contained in:
commit
46da65bf82
15 changed files with 22 additions and 58 deletions
|
|
@ -137,7 +137,7 @@ class HostBase(AbstractHost):
|
||||||
def get_current_folder_path(self) -> Optional[str]:
|
def get_current_folder_path(self) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
Returns:
|
Returns:
|
||||||
Optional[str]: Current asset name.
|
Optional[str]: Current folder path.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return os.environ.get("AYON_FOLDER_PATH")
|
return os.environ.get("AYON_FOLDER_PATH")
|
||||||
|
|
|
||||||
|
|
@ -948,7 +948,7 @@ def get_representation_by_names(
|
||||||
version_name: Union[int, str],
|
version_name: Union[int, str],
|
||||||
representation_name: str,
|
representation_name: str,
|
||||||
) -> Optional[dict]:
|
) -> 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 "hero" then return the hero version
|
||||||
If version_name is "latest" then return the latest version
|
If version_name is "latest" then return the latest version
|
||||||
|
|
@ -966,7 +966,7 @@ def get_representation_by_names(
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if isinstance(product_name, dict) and "name" in product_name:
|
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
|
product_entity = product_name
|
||||||
else:
|
else:
|
||||||
product_entity = ayon_api.get_product_by_name(
|
product_entity = ayon_api.get_product_by_name(
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,6 @@ def get_folder_template_data(folder_entity, project_name):
|
||||||
|
|
||||||
Output dictionary contains keys:
|
Output dictionary contains keys:
|
||||||
- 'folder' - dictionary with 'name' key filled with folder name
|
- 'folder' - dictionary with 'name' key filled with folder name
|
||||||
- 'asset' - folder name
|
|
||||||
- 'hierarchy' - parent folder names joined with '/'
|
- 'hierarchy' - parent folder names joined with '/'
|
||||||
- 'parent' - direct parent name, project name used if is under
|
- 'parent' - direct parent name, project name used if is under
|
||||||
project
|
project
|
||||||
|
|
@ -132,7 +131,6 @@ def get_folder_template_data(folder_entity, project_name):
|
||||||
"path": path,
|
"path": path,
|
||||||
"parents": parents,
|
"parents": parents,
|
||||||
},
|
},
|
||||||
"asset": folder_name,
|
|
||||||
"hierarchy": hierarchy,
|
"hierarchy": hierarchy,
|
||||||
"parent": parent_name
|
"parent": parent_name
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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.lib.profiles_filtering import filter_profiles
|
||||||
from ayon_core.settings import get_project_settings
|
from ayon_core.settings import get_project_settings
|
||||||
|
|
||||||
|
|
||||||
def get_versioning_start(
|
def get_versioning_start(
|
||||||
project_name,
|
project_name: str,
|
||||||
host_name,
|
host_name: str,
|
||||||
task_name=None,
|
task_name: Optional[str] = None,
|
||||||
task_type=None,
|
task_type: Optional[str] = None,
|
||||||
product_type=None,
|
product_type: Optional[str] = None,
|
||||||
product_name=None,
|
product_name: Optional[str] = None,
|
||||||
project_settings=None,
|
project_settings: Optional[dict[str, Any]] = None,
|
||||||
):
|
) -> int:
|
||||||
"""Get anatomy versioning start"""
|
"""Get anatomy versioning start"""
|
||||||
if not project_settings:
|
if not project_settings:
|
||||||
project_settings = get_project_settings(project_name)
|
project_settings = get_project_settings(project_name)
|
||||||
|
|
@ -22,14 +25,12 @@ def get_versioning_start(
|
||||||
if not profiles:
|
if not profiles:
|
||||||
return version_start
|
return version_start
|
||||||
|
|
||||||
# TODO use 'product_types' and 'product_name' instead of
|
|
||||||
# 'families' and 'subsets'
|
|
||||||
filtering_criteria = {
|
filtering_criteria = {
|
||||||
"host_names": host_name,
|
"host_names": host_name,
|
||||||
"families": product_type,
|
"product_types": product_type,
|
||||||
|
"product_names": product_name,
|
||||||
"task_names": task_name,
|
"task_names": task_name,
|
||||||
"task_types": task_type,
|
"task_types": task_type,
|
||||||
"subsets": product_name
|
|
||||||
}
|
}
|
||||||
profile = filter_profiles(profiles, filtering_criteria)
|
profile = filter_profiles(profiles, filtering_criteria)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1483,7 +1483,7 @@ class PlaceholderLoadMixin(object):
|
||||||
tooltip=(
|
tooltip=(
|
||||||
"Link Type\n"
|
"Link Type\n"
|
||||||
"\nDefines what type of link will be used to"
|
"\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(
|
attribute_definitions.EnumDef(
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ class CreateHeroVersion(load.ProductLoaderPlugin):
|
||||||
|
|
||||||
ignored_representation_names: list[str] = []
|
ignored_representation_names: list[str] = []
|
||||||
db_representation_context_keys = [
|
db_representation_context_keys = [
|
||||||
"project", "folder", "asset", "hierarchy", "task", "product",
|
"project", "folder", "hierarchy", "task", "product",
|
||||||
"subset", "family", "representation", "username", "user", "output"
|
"representation", "username", "user", "output"
|
||||||
]
|
]
|
||||||
use_hardlinks = False
|
use_hardlinks = False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -301,8 +301,6 @@ class CollectAnatomyInstanceData(pyblish.api.ContextPlugin):
|
||||||
product_name = instance.data["productName"]
|
product_name = instance.data["productName"]
|
||||||
product_type = instance.data["productType"]
|
product_type = instance.data["productType"]
|
||||||
anatomy_data.update({
|
anatomy_data.update({
|
||||||
"family": product_type,
|
|
||||||
"subset": product_name,
|
|
||||||
"product": {
|
"product": {
|
||||||
"name": product_name,
|
"name": product_name,
|
||||||
"type": product_type,
|
"type": product_type,
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class CollectManagedStagingDir(pyblish.api.InstancePlugin):
|
||||||
Location of the folder is configured in:
|
Location of the folder is configured in:
|
||||||
`ayon+anatomy://_/templates/staging`.
|
`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`
|
`ayon+settings://core/tools/publish/custom_staging_dir_profiles`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -316,22 +316,8 @@ class ExtractBurnin(publish.Extractor):
|
||||||
burnin_values = {}
|
burnin_values = {}
|
||||||
for key in self.positions:
|
for key in self.positions:
|
||||||
value = burnin_def.get(key)
|
value = burnin_def.get(key)
|
||||||
if not value:
|
if value:
|
||||||
continue
|
burnin_values[key] = value
|
||||||
# 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}")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Remove "delete" tag from new representation
|
# Remove "delete" tag from new representation
|
||||||
if "delete" in new_repre["tags"]:
|
if "delete" in new_repre["tags"]:
|
||||||
|
|
|
||||||
|
|
@ -123,10 +123,6 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
||||||
"representation",
|
"representation",
|
||||||
"username",
|
"username",
|
||||||
"output",
|
"output",
|
||||||
# OpenPype keys - should be removed
|
|
||||||
"asset", # folder[name]
|
|
||||||
"subset", # product[name]
|
|
||||||
"family", # product[type]
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def process(self, instance):
|
def process(self, instance):
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,9 @@ class IntegrateHeroVersion(
|
||||||
db_representation_context_keys = [
|
db_representation_context_keys = [
|
||||||
"project",
|
"project",
|
||||||
"folder",
|
"folder",
|
||||||
"asset",
|
|
||||||
"hierarchy",
|
"hierarchy",
|
||||||
"task",
|
"task",
|
||||||
"product",
|
"product",
|
||||||
"subset",
|
|
||||||
"family",
|
|
||||||
"representation",
|
"representation",
|
||||||
"username",
|
"username",
|
||||||
"output"
|
"output"
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,8 @@ class IntegrateProductGroup(pyblish.api.InstancePlugin):
|
||||||
product_type = instance.data["productType"]
|
product_type = instance.data["productType"]
|
||||||
|
|
||||||
fill_pairs = prepare_template_data({
|
fill_pairs = prepare_template_data({
|
||||||
"family": product_type,
|
|
||||||
"task": filter_criteria["tasks"],
|
"task": filter_criteria["tasks"],
|
||||||
"host": filter_criteria["hosts"],
|
"host": filter_criteria["hosts"],
|
||||||
"subset": product_name,
|
|
||||||
"product": {
|
"product": {
|
||||||
"name": product_name,
|
"name": product_name,
|
||||||
"type": product_type,
|
"type": product_type,
|
||||||
|
|
|
||||||
|
|
@ -969,12 +969,6 @@ SearchItemDisplayWidget #ValueWidget {
|
||||||
background: {color:bg-buttons};
|
background: {color:bg-buttons};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Subset Manager */
|
|
||||||
#SubsetManagerDetailsText {}
|
|
||||||
#SubsetManagerDetailsText[state="invalid"] {
|
|
||||||
border: 1px solid #ff0000;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Creator */
|
/* Creator */
|
||||||
#CreatorsView::item {
|
#CreatorsView::item {
|
||||||
padding: 1px 5px;
|
padding: 1px 5px;
|
||||||
|
|
|
||||||
|
|
@ -1129,8 +1129,6 @@ class ProjectPushItemProcess:
|
||||||
self.host_name
|
self.host_name
|
||||||
)
|
)
|
||||||
formatting_data.update({
|
formatting_data.update({
|
||||||
"subset": self._product_name,
|
|
||||||
"family": self._product_type,
|
|
||||||
"product": {
|
"product": {
|
||||||
"name": self._product_name,
|
"name": self._product_name,
|
||||||
"type": self._product_type,
|
"type": self._product_type,
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@ class TextureCopy:
|
||||||
product_type = "texture"
|
product_type = "texture"
|
||||||
template_data = get_template_data(project_entity, folder_entity)
|
template_data = get_template_data(project_entity, folder_entity)
|
||||||
template_data.update({
|
template_data.update({
|
||||||
"family": product_type,
|
|
||||||
"subset": product_name,
|
|
||||||
"product": {
|
"product": {
|
||||||
"name": product_name,
|
"name": product_name,
|
||||||
"type": product_type,
|
"type": product_type,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue