mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Expose bake attribute prefixes, plus make settings just a list of strings
This commit is contained in:
parent
404681e684
commit
3d9cd57df0
2 changed files with 15 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue