Move Subset Grouping Profiles settings to Collect Subset Group

- This is moved from the Integrate Asset New settings
This commit is contained in:
Roy Nieterau 2022-03-26 19:58:55 +01:00
parent 7189954a3c
commit 8f8b578f0c
4 changed files with 71 additions and 67 deletions

View file

@ -24,28 +24,22 @@ class CollectSubsetGroup(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder + 0.495
label = "Collect Subset Group"
# Defined in OpenPype settings
subset_grouping_profiles = None
def process(self, instance):
"""Look into subset group profiles set by settings.
Attribute 'subset_grouping_profiles' is defined by OpenPype settings.
"""
# TODO: Move this setting to this Collector instead of Integrator
project_settings = instance.context.data["project_settings"]
subset_grouping_profiles = (
project_settings["global"]
["publish"]
["IntegrateAssetNew"]
["subset_grouping_profiles"]
)
# Skip if 'subset_grouping_profiles' is empty
if not subset_grouping_profiles:
if not self.subset_grouping_profiles:
return
# Skip if there is no matching profile
filter_criteria = self.get_profile_filter_criteria(instance)
profile = filter_profiles(subset_grouping_profiles,
profile = filter_profiles(self.subset_grouping_profiles,
filter_criteria,
logger=self.log)
if not profile:

View file

@ -110,7 +110,6 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
# Attributes set by settings
template_name_profiles = None
subset_grouping_profiles = None
def process(self, instance):

View file

@ -20,6 +20,17 @@
],
"skip_hosts_headless_publish": []
},
"CollectSubsetGroup": {
"subset_grouping_profiles": [
{
"families": [],
"hosts": [],
"task_types": [],
"tasks": [],
"template": ""
}
]
},
"ValidateEditorialAssetName": {
"enabled": true,
"optional": false
@ -193,15 +204,6 @@
"tasks": [],
"template_name": "render"
}
],
"subset_grouping_profiles": [
{
"families": [],
"hosts": [],
"task_types": [],
"tasks": [],
"template": ""
}
]
},
"CleanUp": {

View file

@ -39,6 +39,61 @@
}
]
},
{
"type": "dict",
"collapsible": true,
"key": "CollectSubsetGroup",
"label": "Collect Subset Group",
"is_group": true,
"children": [
{
"type": "list",
"key": "subset_grouping_profiles",
"label": "Subset grouping profiles",
"use_label_wrap": true,
"object_type": {
"type": "dict",
"children": [
{
"type": "label",
"label": "Set all published instances as a part of specific group named according to 'Template'. <br>Implemented all variants of placeholders [{task},{family},{host},{subset},{renderlayer}]"
},
{
"key": "families",
"label": "Families",
"type": "list",
"object_type": "text"
},
{
"type": "hosts-enum",
"key": "hosts",
"label": "Hosts",
"multiselection": true
},
{
"key": "task_types",
"label": "Task types",
"type": "task-types-enum"
},
{
"key": "tasks",
"label": "Task names",
"type": "list",
"object_type": "text"
},
{
"type": "separator"
},
{
"type": "text",
"key": "template",
"label": "Template"
}
]
}
}
]
},
{
"type": "dict",
"collapsible": true,
@ -603,52 +658,6 @@
}
]
}
},
{
"type": "list",
"key": "subset_grouping_profiles",
"label": "Subset grouping profiles",
"use_label_wrap": true,
"object_type": {
"type": "dict",
"children": [
{
"type": "label",
"label": "Set all published instances as a part of specific group named according to 'Template'. <br>Implemented all variants of placeholders [{task},{family},{host},{subset},{renderlayer}]"
},
{
"key": "families",
"label": "Families",
"type": "list",
"object_type": "text"
},
{
"type": "hosts-enum",
"key": "hosts",
"label": "Hosts",
"multiselection": true
},
{
"key": "task_types",
"label": "Task types",
"type": "task-types-enum"
},
{
"key": "tasks",
"label": "Task names",
"type": "list",
"object_type": "text"
},
{
"type": "separator"
},
{
"type": "text",
"key": "template",
"label": "Template"
}
]
}
}
]
},