mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +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"
|
settings_category = "core"
|
||||||
|
|
||||||
use_ayon_entity_uri = False
|
use_ayon_entity_uri = False
|
||||||
|
enforce_default_prim = False
|
||||||
|
|
||||||
def process(self, instance):
|
def process(self, instance):
|
||||||
|
|
||||||
|
|
@ -651,6 +652,15 @@ class ExtractUSDLayerContribution(publish.Extractor):
|
||||||
path = get_last_publish(instance)
|
path = get_last_publish(instance)
|
||||||
if path and BUILD_INTO_LAST_VERSIONS:
|
if path and BUILD_INTO_LAST_VERSIONS:
|
||||||
sdf_layer = Sdf.Layer.OpenAsAnonymous(path)
|
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
|
default_prim = sdf_layer.defaultPrim
|
||||||
else:
|
else:
|
||||||
default_prim = get_standard_default_prim_name(folder_path)
|
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):
|
class PluginStateByHostModelProfile(BaseSettingsModel):
|
||||||
_layout = "expanded"
|
_layout = "expanded"
|
||||||
# Filtering
|
# Filtering
|
||||||
|
|
@ -1134,9 +1147,11 @@ class PublishPuginsModel(BaseSettingsModel):
|
||||||
default_factory=AyonEntityURIModel,
|
default_factory=AyonEntityURIModel,
|
||||||
title="Extract USD Asset Contribution",
|
title="Extract USD Asset Contribution",
|
||||||
)
|
)
|
||||||
ExtractUSDLayerContribution: AyonEntityURIModel = SettingsField(
|
ExtractUSDLayerContribution: ExtractUSDLayerContributionModel = (
|
||||||
default_factory=AyonEntityURIModel,
|
SettingsField(
|
||||||
title="Extract USD Layer Contribution",
|
default_factory=ExtractUSDLayerContributionModel,
|
||||||
|
title="Extract USD Layer Contribution",
|
||||||
|
)
|
||||||
)
|
)
|
||||||
PreIntegrateThumbnails: PreIntegrateThumbnailsModel = SettingsField(
|
PreIntegrateThumbnails: PreIntegrateThumbnailsModel = SettingsField(
|
||||||
default_factory=PreIntegrateThumbnailsModel,
|
default_factory=PreIntegrateThumbnailsModel,
|
||||||
|
|
@ -1526,6 +1541,7 @@ DEFAULT_PUBLISH_VALUES = {
|
||||||
},
|
},
|
||||||
"ExtractUSDLayerContribution": {
|
"ExtractUSDLayerContribution": {
|
||||||
"use_ayon_entity_uri": False,
|
"use_ayon_entity_uri": False,
|
||||||
|
"enforce_default_prim": False,
|
||||||
},
|
},
|
||||||
"PreIntegrateThumbnails": {
|
"PreIntegrateThumbnails": {
|
||||||
"enabled": True,
|
"enabled": True,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue