diff --git a/client/ayon_core/hosts/aftereffects/plugins/create/create_render.py b/client/ayon_core/hosts/aftereffects/plugins/create/create_render.py index a795d61b39..d7f7040953 100644 --- a/client/ayon_core/hosts/aftereffects/plugins/create/create_render.py +++ b/client/ayon_core/hosts/aftereffects/plugins/create/create_render.py @@ -11,7 +11,7 @@ from ayon_core.pipeline import ( from ayon_core.hosts.aftereffects.api.pipeline import cache_and_get_instances from ayon_core.hosts.aftereffects.api.lib import set_settings from ayon_core.lib import prepare_template_data -from ayon_core.pipeline.create import SUBSET_NAME_ALLOWED_SYMBOLS +from ayon_core.pipeline.create import PRODUCT_NAME_ALLOWED_SYMBOLS class RenderCreator(Creator): @@ -58,7 +58,7 @@ class RenderCreator(Creator): len(comps) > 1) for comp in comps: composition_name = re.sub( - "[^{}]+".format(SUBSET_NAME_ALLOWED_SYMBOLS), + "[^{}]+".format(PRODUCT_NAME_ALLOWED_SYMBOLS), "", comp.name ) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index ce6f66e3e0..426f93a187 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -445,7 +445,7 @@ def set_avalon_knob_data(node, data=None, prefix="avalon:"): create = OrderedDict() tab_name = NODE_TAB_NAME - editable = ["asset", "subset", "name", "namespace"] + editable = ["folderPath", "productName", "name", "namespace"] existed_knobs = node.knobs() @@ -714,6 +714,7 @@ def get_imageio_node_override_setting( if plugin_name not in onode["plugins"]: continue + # TODO change 'subsets' to 'product_names' in settings if ( onode["subsets"] and not any( diff --git a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py b/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py index daf12b9b84..d40513b7c8 100644 --- a/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py +++ b/client/ayon_core/hosts/nuke/plugins/publish/extract_review_intermediates.py @@ -57,7 +57,7 @@ class ExtractReviewIntermediates(publish.Extractor): families.add(instance.data["productType"]) task_type = instance.context.data["taskType"] - subset = instance.data["subset"] + product_name = instance.data["productName"] self.log.debug("Creating staging dir...") if "representations" not in instance.data: @@ -93,8 +93,8 @@ class ExtractReviewIntermediates(publish.Extractor): f_task_types, task_type)) self.log.debug( - "product_names `{}` > subset: {}".format( - product_names, subset)) + "product_names `{}` > product: {}".format( + product_names, product_name)) # test if family found in context # using intersection to make sure all defined @@ -111,7 +111,7 @@ class ExtractReviewIntermediates(publish.Extractor): # test subsets from filter if product_names and not any( - re.search(p, subset) for p in product_names + re.search(p, product_name) for p in product_names ): continue diff --git a/client/ayon_core/hosts/nuke/startup/custom_write_node.py b/client/ayon_core/hosts/nuke/startup/custom_write_node.py index 6573ccfbde..84e99f34c4 100644 --- a/client/ayon_core/hosts/nuke/startup/custom_write_node.py +++ b/client/ayon_core/hosts/nuke/startup/custom_write_node.py @@ -144,6 +144,7 @@ class WriteNodeKnobSettingPanel(nukescripts.PythonPanel): knobs_nodes = settings[i]["knobs"] for setting in settings: + # TODO change 'subsets' to 'product_names' in settings for subset in setting["subsets"]: preset_name.append(subset) diff --git a/client/ayon_core/hosts/photoshop/plugins/create/create_image.py b/client/ayon_core/hosts/photoshop/plugins/create/create_image.py index 5da275e10f..b524245243 100644 --- a/client/ayon_core/hosts/photoshop/plugins/create/create_image.py +++ b/client/ayon_core/hosts/photoshop/plugins/create/create_image.py @@ -8,7 +8,7 @@ from ayon_core.pipeline import ( CreatorError ) from ayon_core.lib import prepare_template_data -from ayon_core.pipeline.create import SUBSET_NAME_ALLOWED_SYMBOLS +from ayon_core.pipeline.create import PRODUCT_NAME_ALLOWED_SYMBOLS from ayon_core.hosts.photoshop.api.pipeline import cache_and_get_instances from ayon_core.hosts.photoshop.lib import clean_product_name @@ -80,7 +80,7 @@ class ImageCreator(Creator): if use_layer_name: layer_name = re.sub( - "[^{}]+".format(SUBSET_NAME_ALLOWED_SYMBOLS), + "[^{}]+".format(PRODUCT_NAME_ALLOWED_SYMBOLS), "", group.name ) diff --git a/client/ayon_core/hosts/photoshop/plugins/publish/validate_naming.py b/client/ayon_core/hosts/photoshop/plugins/publish/validate_naming.py index af4e646a67..ce940c47ce 100644 --- a/client/ayon_core/hosts/photoshop/plugins/publish/validate_naming.py +++ b/client/ayon_core/hosts/photoshop/plugins/publish/validate_naming.py @@ -3,7 +3,7 @@ import re import pyblish.api from ayon_core.hosts.photoshop import api as photoshop -from ayon_core.pipeline.create import SUBSET_NAME_ALLOWED_SYMBOLS +from ayon_core.pipeline.create import PRODUCT_NAME_ALLOWED_SYMBOLS from ayon_core.pipeline.publish import ( ValidateContentsOrder, PublishXmlValidationError, @@ -56,7 +56,7 @@ class ValidateNamingRepair(pyblish.api.Action): # format from Tool Creator product_name = re.sub( - "[^{}]+".format(SUBSET_NAME_ALLOWED_SYMBOLS), + "[^{}]+".format(PRODUCT_NAME_ALLOWED_SYMBOLS), "", product_name ) diff --git a/client/ayon_core/pipeline/create/README.md b/client/ayon_core/pipeline/create/README.md index 353f28e88b..bbfd1bfa0f 100644 --- a/client/ayon_core/pipeline/create/README.md +++ b/client/ayon_core/pipeline/create/README.md @@ -31,7 +31,7 @@ Product type tells how should be instance processed and product name what name w "productType": , # Mutable data - ## Subset name based on product name template - may change overtime (on context change) + ## Product name based on product name template - may change overtime (on context change) "productName": , ## Instance is active and will be published "active": True, diff --git a/client/ayon_core/pipeline/create/__init__.py b/client/ayon_core/pipeline/create/__init__.py index ca2c47f1ff..da9cafad5a 100644 --- a/client/ayon_core/pipeline/create/__init__.py +++ b/client/ayon_core/pipeline/create/__init__.py @@ -1,6 +1,6 @@ from .constants import ( - SUBSET_NAME_ALLOWED_SYMBOLS, - DEFAULT_SUBSET_TEMPLATE, + PRODUCT_NAME_ALLOWED_SYMBOLS, + DEFAULT_PRODUCT_TEMPLATE, PRE_CREATE_THUMBNAIL_KEY, DEFAULT_VARIANT_VALUE, ) @@ -48,17 +48,14 @@ from .legacy_create import ( __all__ = ( - "SUBSET_NAME_ALLOWED_SYMBOLS", - "DEFAULT_SUBSET_TEMPLATE", + "PRODUCT_NAME_ALLOWED_SYMBOLS", + "DEFAULT_PRODUCT_TEMPLATE", "PRE_CREATE_THUMBNAIL_KEY", "DEFAULT_VARIANT_VALUE", "get_last_versions_for_instances", "get_next_versions_for_instances", - "get_subset_name_template", - "get_subset_name", - "TaskNotSetError", "get_product_name", "get_product_name_template", diff --git a/client/ayon_core/pipeline/create/constants.py b/client/ayon_core/pipeline/create/constants.py index 7d1d0154e9..a0bcea55ff 100644 --- a/client/ayon_core/pipeline/create/constants.py +++ b/client/ayon_core/pipeline/create/constants.py @@ -1,12 +1,12 @@ -SUBSET_NAME_ALLOWED_SYMBOLS = "a-zA-Z0-9_." -DEFAULT_SUBSET_TEMPLATE = "{family}{Variant}" +PRODUCT_NAME_ALLOWED_SYMBOLS = "a-zA-Z0-9_." +DEFAULT_PRODUCT_TEMPLATE = "{family}{Variant}" PRE_CREATE_THUMBNAIL_KEY = "thumbnail_source" DEFAULT_VARIANT_VALUE = "Main" __all__ = ( - "SUBSET_NAME_ALLOWED_SYMBOLS", - "DEFAULT_SUBSET_TEMPLATE", + "PRODUCT_NAME_ALLOWED_SYMBOLS", + "DEFAULT_PRODUCT_TEMPLATE", "PRE_CREATE_THUMBNAIL_KEY", "DEFAULT_VARIANT_VALUE", ) diff --git a/client/ayon_core/pipeline/create/creator_plugins.py b/client/ayon_core/pipeline/create/creator_plugins.py index 21d4371dc3..acb1bb5c07 100644 --- a/client/ayon_core/pipeline/create/creator_plugins.py +++ b/client/ayon_core/pipeline/create/creator_plugins.py @@ -532,7 +532,7 @@ class BaseCreator: instance is passed in. Args: - variant(str): Subset name variant. In most of cases user input. + variant(str): Product name variant. In most of cases user input. task_name(str): For which task product is created. asset_doc(dict): Asset document for which product is created. project_name(str): Project name. @@ -687,7 +687,7 @@ class Creator(BaseCreator): Ideally should be stored to workfile using host implementation. Args: - product_name(str): Subset name of created instance. + product_name(str): Product name of created instance. instance_data(dict): Base data for instance. pre_create_data(dict): Data based on pre creation attributes. Those may affect how creator works. diff --git a/client/ayon_core/pipeline/create/product_name.py b/client/ayon_core/pipeline/create/product_name.py index 64a2760797..8413bfa9d8 100644 --- a/client/ayon_core/pipeline/create/product_name.py +++ b/client/ayon_core/pipeline/create/product_name.py @@ -3,7 +3,7 @@ import os from ayon_core.settings import get_project_settings from ayon_core.lib import filter_profiles, prepare_template_data -from .constants import DEFAULT_SUBSET_TEMPLATE +from .constants import DEFAULT_PRODUCT_TEMPLATE class TaskNotSetError(KeyError): @@ -40,7 +40,7 @@ def get_product_name_template( task_type (str): Type of task in which context the product is created. default_template (Union[str, None]): Default template which is used if settings won't find any matching possitibility. Constant - 'DEFAULT_SUBSET_TEMPLATE' is used if not defined. + 'DEFAULT_PRODUCT_TEMPLATE' is used if not defined. project_settings (Union[Dict[str, Any], None]): Prepared settings for project. Settings are queried if not passed. """ @@ -75,7 +75,7 @@ def get_product_name_template( # Make sure template is set (matching may have empty string) if not template: - template = default_template or DEFAULT_SUBSET_TEMPLATE + template = default_template or DEFAULT_PRODUCT_TEMPLATE return template @@ -96,7 +96,7 @@ def get_product_name( Subst name templates are defined in `project_settings/global/tools/creator /product_name_profiles` where are profiles with host name, product type, task name and task type filters. If context does not match any profile - then `DEFAULT_SUBSET_TEMPLATE` is used as default template. + then `DEFAULT_PRODUCT_TEMPLATE` is used as default template. That's main reason why so many arguments are required to calculate product name. @@ -114,7 +114,7 @@ def get_product_name( asset_doc (dict): Queried asset document with its tasks in data. Used to get task type. default_template (Optional[str]): Default template if any profile does - not match passed context. Constant 'DEFAULT_SUBSET_TEMPLATE' + not match passed context. Constant 'DEFAULT_PRODUCT_TEMPLATE' is used if is not passed. dynamic_data (Optional[Dict[str, Any]]): Dynamic data specific for a creator which creates instance. diff --git a/client/ayon_core/pipeline/load/plugins.py b/client/ayon_core/pipeline/load/plugins.py index 962417c6f2..1005f4a2c0 100644 --- a/client/ayon_core/pipeline/load/plugins.py +++ b/client/ayon_core/pipeline/load/plugins.py @@ -225,7 +225,7 @@ class LoaderPlugin(list): Returns static (cls) options or could collect from 'contexts'. Args: - contexts (list): of repre or subset contexts + contexts (list): of repre or product contexts Returns: (list) """ @@ -246,7 +246,7 @@ class LoaderPlugin(list): class SubsetLoaderPlugin(LoaderPlugin): - """Load subset into host application + """Load product into host application Arguments: context (dict): avalon-core:context-1.0 name (str, optional): Use pre-defined name diff --git a/client/ayon_core/pipeline/workfile/workfile_template_builder.py b/client/ayon_core/pipeline/workfile/workfile_template_builder.py index 3004e55861..8da3961a3d 100644 --- a/client/ayon_core/pipeline/workfile/workfile_template_builder.py +++ b/client/ayon_core/pipeline/workfile/workfile_template_builder.py @@ -1299,6 +1299,10 @@ class PlaceholderLoadMixin(object): " used." ) + product_type = options.get("product_type") + if product_type is None: + product_type = options.get("family") + return [ attribute_definitions.UISeparatorDef(), attribute_definitions.UILabelDef("Main attributes"), @@ -1312,9 +1316,9 @@ class PlaceholderLoadMixin(object): tooltip=build_type_help ), attribute_definitions.EnumDef( - "family", - label="Family", - default=options.get("family"), + "product_type", + label="Product type", + default=product_type, items=families ), attribute_definitions.TextDef(