Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/better_error_on_unsaved_workfile
Browse files Browse the repository at this point in the history
  • Loading branch information
BigRoy authored Sep 2, 2024
2 parents 3245a74 + 83befb2 commit 98c5ea4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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"]
Expand All @@ -594,7 +597,8 @@ def process(self, instance):

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}")
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -811,15 +817,15 @@ def sort_by_order(instance):
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
Expand Down
25 changes: 25 additions & 0 deletions server/settings/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ def validate_unique_outputs(cls, value):
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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1167,6 +1186,12 @@ class PublishPuginsModel(BaseSettingsModel):
}
]
},
"ExtractUSDAssetContribution": {
"use_ayon_entity_uri": False,
},
"ExtractUSDLayerContribution": {
"use_ayon_entity_uri": False,
},
"PreIntegrateThumbnails": {
"enabled": True,
"integrate_profiles": []
Expand Down

0 comments on commit 98c5ea4

Please sign in to comment.