From c19d311c7564af702f8aa283656ab4f8362211f7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 10 Nov 2021 16:41:38 +0100 Subject: [PATCH] added settings for layer name regex --- .../publish/collect_tvpaint_instances.py | 6 +++--- .../project_settings/webpublisher.json | 3 +++ .../schema_project_webpublisher.json | 19 ++++++++++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/webpublisher/plugins/publish/collect_tvpaint_instances.py b/openpype/hosts/webpublisher/plugins/publish/collect_tvpaint_instances.py index 7c574fde5b..ab23b5ff84 100644 --- a/openpype/hosts/webpublisher/plugins/publish/collect_tvpaint_instances.py +++ b/openpype/hosts/webpublisher/plugins/publish/collect_tvpaint_instances.py @@ -3,7 +3,7 @@ Requires: CollectTVPaintWorkfileData Provides: - Instance + Instances """ import os import re @@ -13,8 +13,8 @@ import pyblish.api from openpype.lib import get_subset_name_with_asset_doc -class CollectTVPaintWorkfileData(pyblish.api.InstancePlugin): - label = "Collect TVPaint Workfile data" +class CollectTVPaintInstances(pyblish.api.InstancePlugin): + label = "Collect TVPaint Instances" order = pyblish.api.CollectorOrder + 0.1 hosts = ["webpublisher"] targets = ["tvpaint"] diff --git a/openpype/settings/defaults/project_settings/webpublisher.json b/openpype/settings/defaults/project_settings/webpublisher.json index f57b79a609..d0fd7ffaf3 100644 --- a/openpype/settings/defaults/project_settings/webpublisher.json +++ b/openpype/settings/defaults/project_settings/webpublisher.json @@ -115,6 +115,9 @@ "default_task_type": "Default task type" } } + }, + "CollectTVPaintInstances": { + "layer_name_regex": "(?PL[0-9]{3}_\\w+)_(?P.+)" } } } \ No newline at end of file diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json index 91337da2b2..62d4780513 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_webpublisher.json @@ -62,8 +62,25 @@ } } ] + }, + { + "type": "dict", + "collapsible": true, + "key": "CollectTVPaintInstances", + "label": "Collect TVPaint Instances", + "children": [ + { + "type": "label", + "label": "Regex helps to extract render layer and pass names from TVPaint layer name.
The regex must contain named groups 'layer' and 'variant' which are used for creation of RenderPass instances.

Example layer name: \"L001_Person_Hand\"
Example regex: \"(?P<layer>L[0-9]{3}_\\w+)_(?P<variant>.+)\"
Extracted layer: \"L001_Person\"
Extracted variant: \"Hand\"" + }, + { + "type": "text", + "key": "layer_name_regex", + "label": "Layer name regex" + } + ] } ] } ] -} \ No newline at end of file +}