diff --git a/client/ayon_core/pipeline/create/creator_plugins.py b/client/ayon_core/pipeline/create/creator_plugins.py
index cbc06145fb..e367044280 100644
--- a/client/ayon_core/pipeline/create/creator_plugins.py
+++ b/client/ayon_core/pipeline/create/creator_plugins.py
@@ -15,6 +15,9 @@ from ayon_core.pipeline.plugin_discover import (
deregister_plugin,
deregister_plugin_path
)
+
+from ayon_core.pipeline.product_type_aliases import get_alias_for_product_type
+
from ayon_core.pipeline.staging_dir import get_staging_dir_info, StagingDir
from .constants import DEFAULT_VARIANT_VALUE
@@ -647,6 +650,16 @@ class BaseCreator(ABC):
self.create_context.project_name, instances
)
+ def get_product_alias(self):
+ """Return product alias for the creator.
+
+ Returns:
+ str: Product alias.
+
+ """
+ return get_alias_for_product_type(
+ self.product_type, self.project_settings)
+
class Creator(BaseCreator):
"""Creator that has more information for artist to show in UI.
diff --git a/client/ayon_core/pipeline/create/product_name.py b/client/ayon_core/pipeline/create/product_name.py
index f2ce63d416..450e1b7ef0 100644
--- a/client/ayon_core/pipeline/create/product_name.py
+++ b/client/ayon_core/pipeline/create/product_name.py
@@ -5,7 +5,7 @@ from ayon_core.lib import (
prepare_template_data,
)
-from ayon_core.pipeline import get_alias_for_product_type
+from ayon_core.pipeline.product_type_aliases import get_alias_for_product_type
from ayon_core.settings import get_project_settings
from .constants import DEFAULT_PRODUCT_TEMPLATE
diff --git a/client/ayon_core/pipeline/product_type_aliases.py b/client/ayon_core/pipeline/product_type_aliases.py
index da180bf982..e7b8e9aeb7 100644
--- a/client/ayon_core/pipeline/product_type_aliases.py
+++ b/client/ayon_core/pipeline/product_type_aliases.py
@@ -3,27 +3,18 @@ from __future__ import annotations
from typing import Optional
-from ayon_core.settings import get_project_settings
-from ayon_core.pipeline import get_current_project_name
-
-def get_product_type_aliases(
- project_settings: Optional[dict] = None) -> dict[str, str]:
+def get_product_type_aliases(project_settings: dict) -> list[dict[str,str]]:
"""Get product type aliases from project settings.
Args:
- project_settings (Optional[dict], optional): Project settings.
- Defaults to None. If not passed, the current project settings
- will be used.
+ project_settings (dict): Project settings.
Returns:
- dict[str, str]: A dictionary of product type aliases.
+ list[dict[str, str]: A list of product type aliases.
"""
- if project_settings is None:
- project_settings = get_project_settings(
- project_name=get_current_project_name())
-
- product_type_aliases_raw = project_settings.get("product_type_aliases", {})
+ product_type_aliases_raw = project_settings["core"].get(
+ "product_type_aliases", {})
if not product_type_aliases_raw:
return {}
@@ -32,19 +23,27 @@ def get_product_type_aliases(
def get_alias_for_product_type(
product_type: str,
- project_settings: Optional[dict] = None
- ) -> Optional[str]:
+ project_settings: dict
+ ) -> str:
"""Get the alias for a product type.
Args:
product_type (str): The product type to get the alias for.
- project_settings (Optional[dict], optional): Project settings.
+ project_settings (dict): Project settings.
Defaults to None. If not passed, the current project settings
will be used.
Returns:
str: The alias for the product type. If no alias is found,
- None is returned.
+ product_type is returned.
"""
- product_type_aliases = get_product_type_aliases(project_settings)
- return product_type_aliases.get(product_type)
+ product_type_aliases: list = get_product_type_aliases(project_settings)
+
+ return next(
+ (
+ alias_pair.get("alias")
+ for alias_pair in product_type_aliases
+ if alias_pair.get("base") == product_type
+ ),
+ product_type,
+ )
diff --git a/client/ayon_core/tools/publisher/models/create.py b/client/ayon_core/tools/publisher/models/create.py
index 9644af43e0..33812a5bae 100644
--- a/client/ayon_core/tools/publisher/models/create.py
+++ b/client/ayon_core/tools/publisher/models/create.py
@@ -88,6 +88,7 @@ class CreatorItem:
identifier: str,
creator_type: CreatorType,
product_type: str,
+ product_alias: str,
label: str,
group_label: str,
icon: Union[str, Dict[str, Any], None],
@@ -103,6 +104,7 @@ class CreatorItem:
self.identifier: str = identifier
self.creator_type: CreatorType = creator_type
self.product_type: str = product_type
+ self.product_alias: str = product_alias
self.label: str = label
self.group_label: str = group_label
self.icon: Union[str, Dict[str, Any], None] = icon
@@ -155,6 +157,7 @@ class CreatorItem:
identifier,
creator_type,
creator.product_type,
+ creator.get_product_alias(),
creator.label or identifier,
creator.get_group_label(),
creator.get_icon(),
@@ -179,6 +182,7 @@ class CreatorItem:
"identifier": self.identifier,
"creator_type": str(self.creator_type),
"product_type": self.product_type,
+ "product_alias": self.product_alias,
"label": self.label,
"group_label": self.group_label,
"icon": self.icon,
diff --git a/client/ayon_core/tools/publisher/widgets/create_widget.py b/client/ayon_core/tools/publisher/widgets/create_widget.py
index aecea2ec44..5f73631385 100644
--- a/client/ayon_core/tools/publisher/widgets/create_widget.py
+++ b/client/ayon_core/tools/publisher/widgets/create_widget.py
@@ -89,7 +89,13 @@ class CreatorShortDescWidget(QtWidgets.QWidget):
description = creator_item.description or ""
self._icon_widget.set_icon_def(plugin_icon)
- self._product_type_label.setText("{}".format(creator_item.product_type))
+ if creator_item.product_alias:
+ self._product_type_label.setText(
+ "{} ({})".format(
+ creator_item.product_alias, creator_item.product_type))
+ else:
+ self._product_type_label.setText(
+ "{}".format(creator_item.product_type))
self._product_type_label.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
self._description_label.setText(description)
diff --git a/server/settings/main.py b/server/settings/main.py
index e406c65b33..ada1c5ccbd 100644
--- a/server/settings/main.py
+++ b/server/settings/main.py
@@ -260,7 +260,7 @@ class FilterEnvsProfileModel(BaseSettingsModel):
class ProductAliasMappingItemModel(BaseSettingsModel):
- _layout = "expanded"
+ _layout = "compact"
base: str = SettingsField("", title="Base product type")
alias: str = SettingsField("", title="Alias name")