Skip to content

Commit

Permalink
upade pinning generation for udims
Browse files Browse the repository at this point in the history
  • Loading branch information
ynput committed Sep 11, 2024
1 parent 684deea commit 433305a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ def _resolve_udim(udim_identifier: str, layer: Sdf.Layer) -> Dict[str, str]:
resolved_udims = UsdShade.UdimUtils.ResolveUdimTilePaths(
str(udim_identifier), layer
)

for path, tile in resolved_udims:
udim_replaced_identifier = udim_identifier.replace(
"<UDIM>",
tile,
)
udim_data[udim_replaced_identifier] = path
udim_data[layer.ComputeAbsolutePath(udim_replaced_identifier)] = path

return udim_data


Expand Down Expand Up @@ -184,7 +184,7 @@ def get_asset_dependencies(
identifier = _remove_sdf_args(identifier)
resolved_path = resolver.Resolve(layer.ComputeAbsolutePath(identifier))
resolved_path_str = resolved_path.GetPathString()
identifier_to_path[identifier] = resolved_path_str
identifier_to_path[layer.ComputeAbsolutePath(identifier)] = resolved_path_str

if "<UDIM>" in resolved_path_str:
# Include all tiles/paths of the UDIM
Expand Down Expand Up @@ -325,6 +325,7 @@ def generate_pinning_file(
"""


if not pinning_file_path.endswith(".json"):
raise RuntimeError(
f"Pinning file path is not a json file {pinning_file_path}")
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_usd/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring AYON addon 'ayon_usd' version."""
__version__ = "0.1.0-alpha"
__version__ = "0.1.0-alpha-dev-pinning01"
17 changes: 17 additions & 0 deletions maya_pin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"ayon_resolver_pinning_data": {
"ayon+entity://Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB?product=usdShot&version=v002&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB/publish/usd/usdShot/v002/UT_shB_usdShot_v002.usd",
"ayon://Usd_Testing//Hou_Ues_Exp/Test_Sceenes/shB?product=usdShot_layout&version=1&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB/publish/usd/usdShot_layout/v001/UT_shB_usdShot_layout_v001.usd",
"ayon://Usd_Testing//Hou_Ues_Exp/Test_Sceenes/shB?product=usdMain&version=1&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB/publish/usd/usdMain/v001/UT_shB_usdMain_v001.usd",
"ayon+entity://Usd_Testing/Hou_Ues_Exp/Test_Assets/assetB?product=usdAsset&version=v002&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Assets/assetB/publish/usd/usdAsset/v002/UT_assetB_usdAsset_v002.usd",
"{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Assets/assetB/publish/usd/usdAsset/v002/payload.usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Assets/assetB/publish/usd/usdAsset/v002/payload.usd",
"ayon://Usd_Testing//Hou_Ues_Exp/Test_Assets/assetB?product=usdAsset_look&version=1&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Assets/assetB/publish/usd/usdAsset_look/v001/UT_assetB_usdAsset_look_v001.usd",
"ayon://Usd_Testing//Hou_Ues_Exp/Test_Assets/assetB?product=lookMain&version=1&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Assets/assetB/publish/look/lookMain/v001/UT_assetB_lookMain_v001.usd",
"ayon://Usd_Testing//Hou_Ues_Exp/Test_Assets/assetB?product=usdAsset_model&version=1&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Assets/assetB/publish/usd/usdAsset_model/v001/UT_assetB_usdAsset_model_v001.usd",
"ayon://Usd_Testing//Hou_Ues_Exp/Test_Assets/assetB?product=usdMain&version=1&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Assets/assetB/publish/usd/usdMain/v001/UT_assetB_usdMain_v001.usd",
"ayon://Usd_Testing//Hou_Ues_Exp/Test_Sceenes/shB?product=usdShot_model&version=1&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB/publish/usd/usdShot_model/v001/UT_shB_usdShot_model_v001.usd",
"ayon://Usd_Testing//Hou_Ues_Exp/Test_Sceenes/shB?product=usdMain&version=2&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB/publish/usd/usdMain/v002/UT_shB_usdMain_v002.usd",
"ayon+entity://Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB?product=usdShot&version=v001&representation=usd": "{root[work]}/Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB/publish/usd/usdShot/v001/UT_shB_usdShot_v001.usd",
"ayon_pinning_data_entry_scene": "ayon+entity://Usd_Testing/Hou_Ues_Exp/Test_Sceenes/shB?product=usdShot&version=v002&representation=usd"
}
}
2 changes: 1 addition & 1 deletion package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name = "ayon_usd"
title = "Usd Addon"
version = "0.1.0-alpha"
version = "0.1.0-alpha-dev-pinning01"
client_dir = "ayon_usd"

services = {}
Expand Down

0 comments on commit 433305a

Please sign in to comment.