From 01aaa9b284e07f934bfea5082bb816899189c1ed Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 11 Oct 2024 17:49:52 +0200 Subject: [PATCH 1/4] Allow to set an explicit AOV identifier for USD render product using attribute `ayon:aov_identifier` --- .../plugins/publish/collect_render_products.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/ayon_houdini/plugins/publish/collect_render_products.py b/client/ayon_houdini/plugins/publish/collect_render_products.py index 9dea2364f8..30ebf4eb85 100644 --- a/client/ayon_houdini/plugins/publish/collect_render_products.py +++ b/client/ayon_houdini/plugins/publish/collect_render_products.py @@ -166,6 +166,15 @@ def get_aov_identifier(self, render_product): str: The AOV identifier """ + # Allow explicit naming through custom attribute on the render product + aov_identifier = render_product.GetAttribute( + "ayon:aov_identifier").Get() + if aov_identifier: + self.log.debug( + "Using explicit ayon:aov_identifier on render product" + " '{render_product}': {aov_identifier}") + return str(aov_identifier) + targets = render_product.GetOrderedVarsRel().GetTargets() if len(targets) > 1: # Cryptomattes usually are combined render vars, for example: From c0fdc236e1858b546ea45ee12c69fdb0651bb44f Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 15 Oct 2024 17:29:40 +0200 Subject: [PATCH 2/4] Trigger GetAttribute on the prim --- client/ayon_houdini/plugins/publish/collect_render_products.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_houdini/plugins/publish/collect_render_products.py b/client/ayon_houdini/plugins/publish/collect_render_products.py index 30ebf4eb85..18ab8df26f 100644 --- a/client/ayon_houdini/plugins/publish/collect_render_products.py +++ b/client/ayon_houdini/plugins/publish/collect_render_products.py @@ -167,7 +167,7 @@ def get_aov_identifier(self, render_product): """ # Allow explicit naming through custom attribute on the render product - aov_identifier = render_product.GetAttribute( + aov_identifier = render_product.GetPrim().GetAttribute( "ayon:aov_identifier").Get() if aov_identifier: self.log.debug( From 0efdae42c882b555580aaaf274aab3f1f91a3bd6 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 12 Dec 2024 09:56:26 +0200 Subject: [PATCH 3/4] Use `EarliestTime` when getting aov identifier --- client/ayon_houdini/plugins/publish/collect_render_products.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/ayon_houdini/plugins/publish/collect_render_products.py b/client/ayon_houdini/plugins/publish/collect_render_products.py index 2be449c13a..12a30eef53 100644 --- a/client/ayon_houdini/plugins/publish/collect_render_products.py +++ b/client/ayon_houdini/plugins/publish/collect_render_products.py @@ -3,6 +3,7 @@ import hou import pxr.UsdRender +from pxr import Usd import pyblish.api @@ -168,7 +169,7 @@ def get_aov_identifier(self, render_product): """ # Allow explicit naming through custom attribute on the render product aov_identifier = render_product.GetPrim().GetAttribute( - "ayon:aov_identifier").Get() + "ayon:aov_identifier").Get(time=Usd.TimeCode.EarliestTime()) if aov_identifier: self.log.debug( "Using explicit ayon:aov_identifier on render product" From 0ee240d024550b1bce1ead7ee3a96427d8090f43 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 12 Dec 2024 09:56:48 +0200 Subject: [PATCH 4/4] Add missing `f` in a string --- client/ayon_houdini/plugins/publish/collect_render_products.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_houdini/plugins/publish/collect_render_products.py b/client/ayon_houdini/plugins/publish/collect_render_products.py index 12a30eef53..703e0fc748 100644 --- a/client/ayon_houdini/plugins/publish/collect_render_products.py +++ b/client/ayon_houdini/plugins/publish/collect_render_products.py @@ -173,7 +173,7 @@ def get_aov_identifier(self, render_product): if aov_identifier: self.log.debug( "Using explicit ayon:aov_identifier on render product" - " '{render_product}': {aov_identifier}") + f" '{render_product}': {aov_identifier}") return str(aov_identifier) targets = render_product.GetOrderedVarsRel().GetTargets()