diff --git a/client/ayon_core/hosts/maya/plugins/publish/extract_pointcache.py b/client/ayon_core/hosts/maya/plugins/publish/extract_pointcache.py index f83d2679cb..5de72f7674 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/extract_pointcache.py +++ b/client/ayon_core/hosts/maya/plugins/publish/extract_pointcache.py @@ -1,5 +1,4 @@ import os -import json from maya import cmds @@ -26,7 +25,10 @@ class ExtractAlembic(publish.Extractor): hosts = ["maya"] families = ["pointcache", "model", "vrayproxy.alembic"] targets = ["local", "remote"] - bake_attributes = "[]" + + # From settings + bake_attributes = [] + bake_attribute_prefixes = [] def process(self, instance): if instance.data.get("farm"): @@ -42,17 +44,12 @@ class ExtractAlembic(publish.Extractor): attrs = instance.data.get("attr", "").split(";") attrs = [value for value in attrs if value.strip()] attrs += instance.data.get("userDefinedAttributes", []) + attrs += self.bake_attributes attrs += ["cbId"] - # bake specified attributes in preset - bake_attributes = json.loads(self.bake_attributes) - assert isinstance(bake_attributes, list), ( - "Attributes to bake must be specified as a list" - ) - attrs += bake_attributes - attr_prefixes = instance.data.get("attrPrefix", "").split(";") attr_prefixes = [value for value in attr_prefixes if value.strip()] + attr_prefixes += self.bake_attribute_prefixes self.log.debug("Extracting pointcache..") dirname = self.staging_dir(instance) diff --git a/server_addon/maya/server/settings/publishers.py b/server_addon/maya/server/settings/publishers.py index ca99d8c57f..7ba2522e60 100644 --- a/server_addon/maya/server/settings/publishers.py +++ b/server_addon/maya/server/settings/publishers.py @@ -299,10 +299,15 @@ class ExtractAlembicModel(BaseSettingsModel): families: list[str] = SettingsField( default_factory=list, title="Families") - bake_attributes: str = SettingsField( - "[]", title="Bake Attributes", widget="textarea", + bake_attributes: list[str] = SettingsField( + "", title="Bake Attributes", widget="textarea", description="List of attributes that will be included in the alembic " "export.", + ), + bake_attribute_prefixes: list[str] = SettingsField( + "", title="Bake Attribute Prefixes", widget="textarea", + description="List of attribute prefixes for attributes that will be " + "included in the alembic export.", ) @@ -1199,7 +1204,8 @@ DEFAULT_PUBLISH_SETTINGS = { "model", "vrayproxy.alembic" ], - "bake_attributes": "[]" + "bake_attributes": [], + "bake_attribute_prefixes": [], }, "ExtractObj": { "enabled": False,