Merge branch 'develop' into enhancement/support_extract_review_for_substance_painter

This commit is contained in:
Kayla Man 2025-11-21 14:14:16 +08:00 committed by GitHub
commit 17769b5291
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
83 changed files with 4707 additions and 1873 deletions

View file

@ -1,8 +1,33 @@
import re
import copy
from typing import Any
from .publish_plugins import DEFAULT_PUBLISH_VALUES
PRODUCT_NAME_REPL_REGEX = re.compile(r"[^<>{}\[\]a-zA-Z0-9_.]")
def _convert_imageio_configs_1_6_5(overrides):
product_name_profiles = (
overrides
.get("tools", {})
.get("creator", {})
.get("product_name_profiles")
)
if isinstance(product_name_profiles, list):
for item in product_name_profiles:
# Remove unsupported product name characters
template = item.get("template")
if isinstance(template, str):
item["template"] = PRODUCT_NAME_REPL_REGEX.sub("", template)
for new_key, old_key in (
("host_names", "hosts"),
("task_names", "tasks"),
):
if old_key in item:
item[new_key] = item.get(old_key)
def _convert_imageio_configs_0_4_5(overrides):
"""Imageio config settings did change to profiles since 0.4.5."""

View file

@ -25,16 +25,27 @@ class ProductNameProfile(BaseSettingsModel):
_layout = "expanded"
product_types: list[str] = SettingsField(
default_factory=list, title="Product types"
default_factory=list,
title="Product types",
)
host_names: list[str] = SettingsField(
default_factory=list,
title="Host names",
)
hosts: list[str] = SettingsField(default_factory=list, title="Hosts")
task_types: list[str] = SettingsField(
default_factory=list,
title="Task types",
enum_resolver=task_types_enum
enum_resolver=task_types_enum,
)
task_names: list[str] = SettingsField(
default_factory=list,
title="Task names",
)
template: str = SettingsField(
"",
title="Template",
regex=r"^[<>{}\[\]a-zA-Z0-9_.]+$",
)
tasks: list[str] = SettingsField(default_factory=list, title="Task names")
template: str = SettingsField("", title="Template")
class FilterCreatorProfile(BaseSettingsModel):
@ -433,27 +444,27 @@ DEFAULT_TOOLS_VALUES = {
"product_name_profiles": [
{
"product_types": [],
"hosts": [],
"host_names": [],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "{product[type]}{variant}"
},
{
"product_types": [
"workfile"
],
"hosts": [],
"host_names": [],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "{product[type]}{Task[name]}"
},
{
"product_types": [
"render"
],
"hosts": [],
"host_names": [],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "{product[type]}{Task[name]}{Variant}<_{Aov}>"
},
{
@ -461,11 +472,11 @@ DEFAULT_TOOLS_VALUES = {
"renderLayer",
"renderPass"
],
"hosts": [
"host_names": [
"tvpaint"
],
"task_types": [],
"tasks": [],
"task_names": [],
"template": (
"{product[type]}{Task[name]}_{Renderlayer}_{Renderpass}"
)
@ -475,65 +486,65 @@ DEFAULT_TOOLS_VALUES = {
"review",
"workfile"
],
"hosts": [
"host_names": [
"aftereffects",
"tvpaint"
],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "{product[type]}{Task[name]}"
},
{
"product_types": ["render"],
"hosts": [
"host_names": [
"aftereffects"
],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "{product[type]}{Task[name]}{Composition}{Variant}"
},
{
"product_types": [
"staticMesh"
],
"hosts": [
"host_names": [
"maya"
],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "S_{folder[name]}{variant}"
},
{
"product_types": [
"skeletalMesh"
],
"hosts": [
"host_names": [
"maya"
],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "SK_{folder[name]}{variant}"
},
{
"product_types": [
"hda"
],
"hosts": [
"host_names": [
"houdini"
],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "{folder[name]}_{variant}"
},
{
"product_types": [
"textureSet"
],
"hosts": [
"host_names": [
"substancedesigner"
],
"task_types": [],
"tasks": [],
"task_names": [],
"template": "T_{folder[name]}{variant}"
}
],