Merge branch 'develop' into enhancement/better_error_on_unsaved_workfile

This commit is contained in:
Roy Nieterau 2024-09-02 14:41:16 +02:00 committed by GitHub
commit 98c5ea4792
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 5 deletions

View file

@ -144,13 +144,14 @@ def get_instance_uri_path(
folder_path = instance.data["folderPath"]
product_name = instance.data["productName"]
project_name = context.data["projectName"]
version_name = instance.data["version"]
# Get the layer's published path
path = construct_ayon_entity_uri(
project_name=project_name,
folder_path=folder_path,
product=product_name,
version="latest",
version=version_name,
representation_name="usd"
)
@ -577,6 +578,8 @@ class ExtractUSDLayerContribution(publish.Extractor):
label = "Extract USD Layer Contributions (Asset/Shot)"
order = pyblish.api.ExtractorOrder + 0.45
use_ayon_entity_uri = False
def process(self, instance):
folder_path = instance.data["folderPath"]
@ -594,7 +597,8 @@ class ExtractUSDLayerContribution(publish.Extractor):
contributions = instance.data.get("usd_contributions", [])
for contribution in sorted(contributions, key=attrgetter("order")):
path = get_instance_uri_path(contribution.instance)
path = get_instance_uri_path(contribution.instance,
resolve=not self.use_ayon_entity_uri)
if isinstance(contribution, VariantContribution):
# Add contribution as a reference inside a variant
self.log.debug(f"Adding variant: {contribution}")
@ -736,6 +740,8 @@ class ExtractUSDAssetContribution(publish.Extractor):
label = "Extract USD Asset/Shot Contributions"
order = ExtractUSDLayerContribution.order + 0.01
use_ayon_entity_uri = False
def process(self, instance):
folder_path = instance.data["folderPath"]
@ -811,15 +817,15 @@ class ExtractUSDAssetContribution(publish.Extractor):
layer_id = layer_instance.data["usd_layer_id"]
order = layer_instance.data["usd_layer_order"]
path = get_instance_uri_path(instance=layer_instance)
path = get_instance_uri_path(instance=layer_instance,
resolve=not self.use_ayon_entity_uri)
add_ordered_sublayer(target_layer,
contribution_path=path,
layer_id=layer_id,
order=order,
# Add the sdf argument metadata which allows
# us to later detect whether another path
# has the same layer id, so we can replace it
# it.
# has the same layer id, so we can replace it.
add_sdf_arguments_metadata=True)
# Save the file

View file

@ -84,6 +84,17 @@ class CollectUSDLayerContributionsModel(BaseSettingsModel):
return value
class AyonEntityURIModel(BaseSettingsModel):
use_ayon_entity_uri: bool = SettingsField(
title="Use AYON Entity URI",
description=(
"When enabled the USD paths written using the contribution "
"workflow will use ayon entity URIs instead of resolved published "
"paths. You can only load these if you use the AYON USD Resolver."
)
)
class PluginStateByHostModelProfile(BaseSettingsModel):
_layout = "expanded"
# Filtering
@ -857,6 +868,14 @@ class PublishPuginsModel(BaseSettingsModel):
default_factory=ExtractBurninModel,
title="Extract Burnin"
)
ExtractUSDAssetContribution: AyonEntityURIModel = SettingsField(
default_factory=AyonEntityURIModel,
title="Extract USD Asset Contribution",
)
ExtractUSDLayerContribution: AyonEntityURIModel = SettingsField(
default_factory=AyonEntityURIModel,
title="Extract USD Layer Contribution",
)
PreIntegrateThumbnails: PreIntegrateThumbnailsModel = SettingsField(
default_factory=PreIntegrateThumbnailsModel,
title="Override Integrate Thumbnail Representations"
@ -1167,6 +1186,12 @@ DEFAULT_PUBLISH_VALUES = {
}
]
},
"ExtractUSDAssetContribution": {
"use_ayon_entity_uri": False,
},
"ExtractUSDLayerContribution": {
"use_ayon_entity_uri": False,
},
"PreIntegrateThumbnails": {
"enabled": True,
"integrate_profiles": []