♻️ check for compatibility

This commit is contained in:
Ondřej Samohel 2025-12-01 18:17:08 +01:00
parent 85668a1b74
commit 43b557d95e
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
3 changed files with 21 additions and 13 deletions

View file

@ -13,4 +13,5 @@ def is_product_base_type_supported() -> bool:
bool: True if product base types are supported, False otherwise.
"""
return False
import ayon_api
return ayon_api.product_base_type_supported()

View file

@ -122,8 +122,8 @@ def get_publish_template_name(
task_type,
project_settings=None,
hero=False,
product_base_type: Optional[str] = None,
logger=None,
product_base_type: Optional[str] = None
):
"""Get template name which should be used for passed context.
@ -141,10 +141,10 @@ def get_publish_template_name(
task_type (str): Task type on which is instance working.
project_settings (Dict[str, Any]): Prepared project settings.
hero (bool): Template is for hero version publishing.
logger (logging.Logger): Custom logger used for 'filter_profiles'
function.
product_base_type (Optional[str]): Product type for which should
be found template.
logger (logging.Logger): Custom logger used for 'filter_profiles'
function.
Returns:
str: Template name which should be used for integration.

View file

@ -28,6 +28,7 @@ from ayon_core.pipeline.publish import (
KnownPublishError,
get_publish_template_name,
)
from pipeline import is_product_base_type_supported
log = logging.getLogger(__name__)
@ -396,15 +397,21 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
product_id = None
if existing_product_entity:
product_id = existing_product_entity["id"]
product_entity = new_product_entity(
product_name,
product_type,
folder_entity["id"],
data=data,
attribs=attributes,
entity_id=product_id,
product_base_type=product_base_type
)
new_product_entity_kwargs = {
"product_name": product_name,
"product_type": product_type,
"folder_id": folder_entity["id"],
"data": data,
"attribs": attributes,
"entity_id": product_id,
"product_base_type": product_base_type,
}
if not is_product_base_type_supported():
new_product_entity_kwargs.pop("product_base_type")
product_entity = new_product_entity(**new_product_entity_kwargs)
if existing_product_entity is None:
# Create a new product