mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Add Task Types profiles filtering for defaults (note that it uses current context, not the task type from the instance)
This commit is contained in:
parent
b9cc8c3507
commit
602faa81dc
2 changed files with 20 additions and 1 deletions
|
|
@ -470,8 +470,10 @@ class CollectUSDLayerContributions(pyblish.api.InstancePlugin,
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# Set default target layer based on product type
|
# Set default target layer based on product type
|
||||||
|
current_context_task_type = create_context.get_current_task_type()
|
||||||
profile = filter_profiles(cls.profiles, {
|
profile = filter_profiles(cls.profiles, {
|
||||||
"product_types": instance.data["productType"]
|
"product_types": instance.data["productType"],
|
||||||
|
"task_types": current_context_task_type
|
||||||
})
|
})
|
||||||
if not profile:
|
if not profile:
|
||||||
profile = {}
|
profile = {}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,17 @@ class CollectUSDLayerContributionsProfileModel(BaseSettingsModel):
|
||||||
" settings below would apply to the instance as default"
|
" settings below would apply to the instance as default"
|
||||||
" attributes."
|
" attributes."
|
||||||
),
|
),
|
||||||
|
section="Filter"
|
||||||
|
)
|
||||||
|
task_types: list[str] = SettingsField(
|
||||||
|
default_factory=list,
|
||||||
|
title="Task Types",
|
||||||
|
enum_resolver=task_types_enum,
|
||||||
|
description=(
|
||||||
|
"The current create context task type to filter against. This"
|
||||||
|
" allows to filter the profile to only be valid if currently "
|
||||||
|
" creating from within that task type."
|
||||||
|
),
|
||||||
)
|
)
|
||||||
contribution_layer: str = SettingsField(
|
contribution_layer: str = SettingsField(
|
||||||
"",
|
"",
|
||||||
|
|
@ -88,6 +99,7 @@ class CollectUSDLayerContributionsProfileModel(BaseSettingsModel):
|
||||||
" matching this profile. The layer name should be in the"
|
" matching this profile. The layer name should be in the"
|
||||||
" 'Department Layer Orders' list to get a sensible order."
|
" 'Department Layer Orders' list to get a sensible order."
|
||||||
),
|
),
|
||||||
|
section="Instance attribute defaults",
|
||||||
)
|
)
|
||||||
contribution_apply_as_variant: bool = SettingsField(
|
contribution_apply_as_variant: bool = SettingsField(
|
||||||
True,
|
True,
|
||||||
|
|
@ -1069,30 +1081,35 @@ DEFAULT_PUBLISH_VALUES = {
|
||||||
"profiles": [
|
"profiles": [
|
||||||
{
|
{
|
||||||
"product_types": ["model"],
|
"product_types": ["model"],
|
||||||
|
"task_types": [],
|
||||||
"contribution_layer": "model",
|
"contribution_layer": "model",
|
||||||
"contribution_apply_as_variant": True,
|
"contribution_apply_as_variant": True,
|
||||||
"contribution_target_product": "usdAsset"
|
"contribution_target_product": "usdAsset"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"product_types": ["look"],
|
"product_types": ["look"],
|
||||||
|
"task_types": [],
|
||||||
"contribution_layer": "look",
|
"contribution_layer": "look",
|
||||||
"contribution_apply_as_variant": True,
|
"contribution_apply_as_variant": True,
|
||||||
"contribution_target_product": "usdAsset"
|
"contribution_target_product": "usdAsset"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"product_types": ["groom"],
|
"product_types": ["groom"],
|
||||||
|
"task_types": [],
|
||||||
"contribution_layer": "groom",
|
"contribution_layer": "groom",
|
||||||
"contribution_apply_as_variant": True,
|
"contribution_apply_as_variant": True,
|
||||||
"contribution_target_product": "usdAsset"
|
"contribution_target_product": "usdAsset"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"product_types": ["rig"],
|
"product_types": ["rig"],
|
||||||
|
"task_types": [],
|
||||||
"contribution_layer": "rig",
|
"contribution_layer": "rig",
|
||||||
"contribution_apply_as_variant": True,
|
"contribution_apply_as_variant": True,
|
||||||
"contribution_target_product": "usdAsset"
|
"contribution_target_product": "usdAsset"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"product_types": ["usd"],
|
"product_types": ["usd"],
|
||||||
|
"task_types": [],
|
||||||
"contribution_layer": "assembly",
|
"contribution_layer": "assembly",
|
||||||
"contribution_apply_as_variant": False,
|
"contribution_apply_as_variant": False,
|
||||||
"contribution_target_product": "usdShot"
|
"contribution_target_product": "usdShot"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue