mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Add setting to always enforce the default prim value
This commit is contained in:
parent
67d5422c94
commit
113d01ce99
2 changed files with 29 additions and 3 deletions
|
|
@ -641,6 +641,7 @@ class ExtractUSDLayerContribution(publish.Extractor):
|
|||
settings_category = "core"
|
||||
|
||||
use_ayon_entity_uri = False
|
||||
enforce_default_prim = False
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
|
|
@ -651,6 +652,15 @@ class ExtractUSDLayerContribution(publish.Extractor):
|
|||
path = get_last_publish(instance)
|
||||
if path and BUILD_INTO_LAST_VERSIONS:
|
||||
sdf_layer = Sdf.Layer.OpenAsAnonymous(path)
|
||||
|
||||
# If enabled in settings, ignore any default prim specified on
|
||||
# older publish versions and always publish with the AYON
|
||||
# standard default prim
|
||||
if self.enforce_default_prim:
|
||||
sdf_layer.defaultPrim = get_standard_default_prim_name(
|
||||
folder_path
|
||||
)
|
||||
|
||||
default_prim = sdf_layer.defaultPrim
|
||||
else:
|
||||
default_prim = get_standard_default_prim_name(folder_path)
|
||||
|
|
|
|||
|
|
@ -251,6 +251,19 @@ class AyonEntityURIModel(BaseSettingsModel):
|
|||
)
|
||||
|
||||
|
||||
class ExtractUSDLayerContributionModel(AyonEntityURIModel):
|
||||
enforce_default_prim: bool = SettingsField(
|
||||
title="Always set default prim to folder name.",
|
||||
description=(
|
||||
"When enabled ignore any default prim specified on older "
|
||||
"published versions of a layer and always override it to the "
|
||||
"AYON standard default prim. When disabled, preserve default prim "
|
||||
"on the layer and then only the initial version would be setting "
|
||||
"the AYON standard default prim."
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class PluginStateByHostModelProfile(BaseSettingsModel):
|
||||
_layout = "expanded"
|
||||
# Filtering
|
||||
|
|
@ -1134,9 +1147,11 @@ class PublishPuginsModel(BaseSettingsModel):
|
|||
default_factory=AyonEntityURIModel,
|
||||
title="Extract USD Asset Contribution",
|
||||
)
|
||||
ExtractUSDLayerContribution: AyonEntityURIModel = SettingsField(
|
||||
default_factory=AyonEntityURIModel,
|
||||
title="Extract USD Layer Contribution",
|
||||
ExtractUSDLayerContribution: ExtractUSDLayerContributionModel = (
|
||||
SettingsField(
|
||||
default_factory=ExtractUSDLayerContributionModel,
|
||||
title="Extract USD Layer Contribution",
|
||||
)
|
||||
)
|
||||
PreIntegrateThumbnails: PreIntegrateThumbnailsModel = SettingsField(
|
||||
default_factory=PreIntegrateThumbnailsModel,
|
||||
|
|
@ -1526,6 +1541,7 @@ DEFAULT_PUBLISH_VALUES = {
|
|||
},
|
||||
"ExtractUSDLayerContribution": {
|
||||
"use_ayon_entity_uri": False,
|
||||
"enforce_default_prim": False,
|
||||
},
|
||||
"PreIntegrateThumbnails": {
|
||||
"enabled": True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue