Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set an explicit AOV identifier for USD render product using attribute ayon:aov_identifier #120

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
10 changes: 10 additions & 0 deletions client/ayon_houdini/plugins/publish/collect_render_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import hou
import pxr.UsdRender
from pxr import Usd

import pyblish.api

Expand Down Expand Up @@ -166,6 +167,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.GetPrim().GetAttribute(
"ayon:aov_identifier").Get(time=Usd.TimeCode.EarliestTime())
if aov_identifier:
self.log.debug(
"Using explicit ayon:aov_identifier on render product"
f" '{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:
Expand Down
Loading